AndEngine TIPs‎ > ‎

AndEngineのEntityModifier一覧

EntityModifierはEntityのパラメータを時間経過に応じて変化させるものです。たくさん種類があるので今回まとめてみました。抜けがあればお知らせください。

簡単な説明とコンストラクタの一覧を添えています。調べ切れていないものは今後調査していきます。


共通事項

引数のfloat pDurationで、Modifierの変化を何秒間かけて行うかを指定します。

1なら1秒、2.5fなら2.5秒です。

引数のIEaseFunction pEaseFunctionで変化の度合いをコントロールするオブジェクトを指定します。 このコントロールをイージングといったりします。 変化の後半に急激に目的の値に近づくような変化や、一度目的の値を越えてバウンドするような変化をさせることが出来ます。

デフォルトでは、線形(変化の度合いは一定)です。 イージング関数のバリエーションは時間があれば調査します。

引数のIEntityModifierListener pEntityModifierListenerは、変化の開始、終了時に行う処理を記述したリスナーを指定します。

座標を動かすModifier

MoveXModifier

x座標を始点と終点を指定して変化させます。

public MoveXModifier(final float pDuration, final float pFromX, final float pToX)
public MoveXModifier(final float pDuration, final float pFromX, final float pToX, final IEaseFunction pEaseFunction)
public MoveXModifier(final float pDuration, final float pFromX, final float pToX, final IEntityModifierListener pEntityModifierListener)
public MoveXModifier(final float pDuration, final float pFromX, final float pToX, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

MoveYModifier

y座標を始点と終点を指定して変化させます。

public MoveYModifier(final float pDuration, final float pFromY, final float pToY)
public MoveYModifier(final float pDuration, final float pFromY, final float pToY, final IEaseFunction pEaseFunction)
public MoveYModifier(final float pDuration, final float pFromY, final float pToY, final IEntityModifierListener pEntityModifierListener)
public MoveYModifier(final float pDuration, final float pFromY, final float pToY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

MoveModifier

x座標とy座標を始点と終点を指定して変化させます。

public MoveModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY)
public MoveModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final IEaseFunction pEaseFunction)
public MoveModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final IEntityModifierListener pEntityModifierListener)
public MoveModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

MoveByModifier

現在の座標からの相対的な変化量を指定して移動させます。

public MoveByModifier(final float pDuration, final float pX, final float pY)
public MoveByModifier(final float pDuration, final float pX, final float pY, final IEntityModifierListener pEntityModifierListener)

CardinalSplineMoveModifier

未調査

public CardinalSplineMoveModifier(final float pDuration, final CardinalSplineMoveModifierConfig pCardinalSplineMoveModifierConfig)
public CardinalSplineMoveModifier(final float pDuration, final CardinalSplineMoveModifierConfig pCardinalSplineMoveModifierConfig, final IEaseFunction pEaseFunction)
public CardinalSplineMoveModifier(final float pDuration, final CardinalSplineMoveModifierConfig pCardinalSplineMoveModifierConfig, final IEntityModifierListener pEntityModifierListener)
public CardinalSplineMoveModifier(final float pDuration, final CardinalSplineMoveModifierConfig pCardinalSplineMoveModifierConfig, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

CubicBezierCurveMoveModifier

未調査

public CubicBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final float pX4, final float pY4)
public CubicBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final float pX4, final float pY4, final IEaseFunction pEaseFunction)
public CubicBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final float pX4, final float pY4, final IEntityModifierListener pEntityModifierListener)
public CubicBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final float pX4, final float pY4, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

QuadraticBezierCurveMoveModifier

未調査

public QuadraticBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3)
public QuadraticBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final IEaseFunction pEaseFunction)
public QuadraticBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final IEntityModifierListener pEntityModifierListener)
public QuadraticBezierCurveMoveModifier(final float pDuration, final float pX1, final float pY1, final float pX2, final float pY2, final float pX3, final float pY3, final IEaseFunction pEaseFunction, final IEntityModifierListener pEntityModifierListener)

CatmullRomSplineMoveModifier

未調査

public CatmullRomSplineMoveModifier(final float pDuration, final CatmullRomMoveModifierConfig pCatmullRomMoveModifierConfig)
public CatmullRomSplineMoveModifier(final float pDuration, final CatmullRomMoveModifierConfig pCatmullRomMoveModifierConfig, final IEaseFunction pEaseFunction)
public CatmullRomSplineMoveModifier(final float pDuration, final CatmullRomMoveModifierConfig pCatmullRomMoveModifierConfig, final IEntityModifierListener pEntityModifierListener)
public CatmullRomSplineMoveModifier(final float pDuration, final CatmullRomMoveModifierConfig pCatmullRomMoveModifierConfig, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

JumpModifier

始点と終点と高さを指定してジャンプしているように移動させます。 ジャンプ回数も指定できます。

public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEaseFunction pEaseFunction)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEntityModifierListener pEntityModifierListener)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEaseFunction pEaseFunction)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEntityModifierListener pEntityModifierListener)
public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

PathModifier

複数の地点の座標を表すPathというクラスのオブジェクトを指定して、その地点を通るように移動します。

このPathは「org.andengine.entity.modifier.PathModifier.Path」です。 「org.andengine.util.algorithm.path.Path」ではないのでインポートする時は注意しましょう。

使い方の例はAndEngineExamplesのPathModifierExampleにあります。

public PathModifier(final float pDuration, final Path pPath)
public PathModifier(final float pDuration, final Path pPath, final IEaseFunction pEaseFunction)
public PathModifier(final float pDuration, final Path pPath, final IEntityModifierListener pEntityModiferListener)
public PathModifier(final float pDuration, final Path pPath, final IPathModifierListener pPathModifierListener)
public PathModifier(final float pDuration, final Path pPath, final IPathModifierListener pPathModifierListener, final IEaseFunction pEaseFunction)
public PathModifier(final float pDuration, final Path pPath, final IEntityModifierListener pEntityModiferListener, final IEaseFunction pEaseFunction)
public PathModifier(final float pDuration, final Path pPath, final IEntityModifierListener pEntityModiferListener, final IPathModifierListener pPathModifierListener) throws IllegalArgumentException
public PathModifier(final float pDuration, final Path pPath, final IEntityModifierListener pEntityModiferListener, final IPathModifierListener pPathModifierListener, final IEaseFunction pEaseFunction) throws IllegalArgumentException

回転させるModifier

角度の単位は度数法(1回転=360度)で、時計回りです。 デフォルトの回転の中心はそのオブジェクトの中心です。

RotationModifier

変化前と変化後の回転角度を指定して変化させます。

public RotationModifier(final float pDuration, final float pFromRotation, final float pToRotation)
public RotationModifier(final float pDuration, final float pFromRotation, final float pToRotation, final IEaseFunction pEaseFunction)
public RotationModifier(final float pDuration, final float pFromRotation, final float pToRotation, final IEntityModifierListener pEntityModifierListener)
public RotationModifier(final float pDuration, final float pFromRotation, final float pToRotation, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

RotationByModifier

角度の変化量を指定して変化させます。

public RotationByModifier(final float pDuration, final float pRotation)
public RotationByModifier(final float pDuration, final float pRotation, final IEntityModifierListener pEntityModifierListener)

RotationAtModifier

変化前と変化後の回転角度、回転の中心座標を指定して変化させます。

public RotationAtModifier(final float pDuration, final float pFromRotation, final float pToRotation, final float pRotationCenterX, final float pRotationCenterY)
public RotationAtModifier(final float pDuration, final float pFromRotation, final float pToRotation, final float pRotationCenterX, final float pRotationCenterY, final IEaseFunction pEaseFunction)
public RotationAtModifier(final float pDuration, final float pFromRotation, final float pToRotation, final float pRotationCenterX, final float pRotationCenterY, final IEntityModifierListener pEntityModifierListener)
public RotationAtModifier(final float pDuration, final float pFromRotation, final float pToRotation, final float pRotationCenterX, final float pRotationCenterY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

拡大縮小させるModifier

拡大率は1で等倍です。 デフォルトの拡大の中心はオブジェクトの中心です。

ScaleModifier

変化前と変化後の拡大率を指定して変化させます。 x方向、y方向の拡大率を個別に指定することも可能。

public ScaleModifier(final float pDuration, final float pFromScale, final float pToScale)
public ScaleModifier(final float pDuration, final float pFromScale, final float pToScale, final IEaseFunction pEaseFunction)
public ScaleModifier(final float pDuration, final float pFromScale, final float pToScale, final IEntityModifierListener pEntityModifierListener)
public ScaleModifier(final float pDuration, final float pFromScale, final float pToScale, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)
public ScaleModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY)
public ScaleModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final IEaseFunction pEaseFunction)
public ScaleModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final IEntityModifierListener pEntityModifierListener)
public ScaleModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

ScaleAtModifier

変化前と変化後の拡大率、拡大縮小の中心座標を指定して変化させます。

public ScaleAtModifier(final float pDuration, final float pFromScale, final float pToScale, final float pScaleCenterX, final float pScaleCenterY)
public ScaleAtModifier(final float pDuration, final float pFromScale, final float pToScale, final float pScaleCenterX, final float pScaleCenterY, final IEaseFunction pEaseFunction)
public ScaleAtModifier(final float pDuration, final float pFromScale, final float pToScale, final float pScaleCenterX, final float pScaleCenterY, final IEntityModifierListener pEntityModifierListener)
public ScaleAtModifier(final float pDuration, final float pFromScale, final float pToScale, final float pScaleCenterX, final float pScaleCenterY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)
public ScaleAtModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final float pScaleCenterX, final float pScaleCenterY)
public ScaleAtModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final float pScaleCenterX, final float pScaleCenterY, final IEaseFunction pEaseFunction)
public ScaleAtModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final float pScaleCenterX, final float pScaleCenterY, final IEntityModifierListener pEntityModifierListener)
public ScaleAtModifier(final float pDuration, final float pFromScaleX, final float pToScaleX, final float pFromScaleY, final float pToScaleY, final float pScaleCenterX, final float pScaleCenterY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

アルファ値を変えるModifier

アルファ値は1で完全な不透明。0で完全な透明です。 TextやSpriteの場合、TextureOptionsの設定によっては半透明に出来ないことがあるので注意してください。

AlphaModifier

変化前と変化後のアルファ値を指定して変化させます。

public AlphaModifier(final float pDuration, final float pFromAlpha, final float pToAlpha)
public AlphaModifier(final float pDuration, final float pFromAlpha, final float pToAlpha, final IEaseFunction pEaseFunction)
public AlphaModifier(final float pDuration, final float pFromAlpha, final float pToAlpha, final IEntityModifierListener pEntityModifierListener)
public AlphaModifier(final float pDuration, final float pFromAlpha, final float pToAlpha, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

FadeInModifier

フェードインさせます。AlphaModifierの変化前が0、変化後が1に固定されているだけです。

public FadeInModifier(final float pDuration)
public FadeInModifier(final float pDuration, final IEaseFunction pEaseFunction)
public FadeInModifier(final float pDuration, final IEntityModifierListener pEntityModifierListener)
public FadeInModifier(final float pDuration, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

FadeOutModifier

フェードアウトさせます。AlphaModifierの変化前が1、変化後が0に固定されているだけです。

public FadeOutModifier(final float pDuration)
public FadeOutModifier(final float pDuration, final IEaseFunction pEaseFunction)
public FadeOutModifier(final float pDuration, final IEntityModifierListener pEntityModifierListener)
public FadeOutModifier(final float pDuration, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

傾き(スキュー)を変えるModifier

スキューさせます。単位は度数法(1回転=360度)

SkewXModifier

変化前と変化後のx方向のスキューの値を指定して変化させます。

public SkewXModifier(final float pDuration, final float pFromSkewX, final float pToSkewX)
public SkewXModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final IEaseFunction pEaseFunction)
public SkewXModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final IEntityModifierListener pEntityModifierListener)
public SkewXModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

SkewYModifier

変化前と変化後のy方向のスキューの値を指定して変化させます。

public SkewYModifier(final float pDuration, final float pFromSkewY, final float pToSkewY)
public SkewYModifier(final float pDuration, final float pFromSkewY, final float pToSkewY, final IEaseFunction pEaseFunction)
public SkewYModifier(final float pDuration, final float pFromSkewY, final float pToSkewY, final IEntityModifierListener pEntityModifierListener)
public SkewYModifier(final float pDuration, final float pFromSkewY, final float pToSkewY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

SkewModifier

変化前と変化後のx方向、y方向のスキューの値を指定して変化させます。

public SkewModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final float pFromSkewY, final float pToSkewY)
public SkewModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final float pFromSkewY, final float pToSkewY, final IEaseFunction pEaseFunction)
public SkewModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final float pFromSkewY, final float pToSkewY, final IEntityModifierListener pEntityModifierListener)
public SkewModifier(final float pDuration, final float pFromSkewX, final float pToSkewX, final float pFromSkewY, final float pToSkewY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

色を変えるModifier

ColorModifier

変化前と変化後の色を指定して変化させます。

public ColorModifier(final float pDuration, final Color pFromColor, final Color pToColor)
public ColorModifier(final float pDuration, final float pFromRed, final float pToRed, final float pFromGreen, final float pToGreen, final float pFromBlue, final float pToBlue)
public ColorModifier(final float pDuration, final Color pFromColor, final Color pToColor, final IEaseFunction pEaseFunction)
public ColorModifier(final float pDuration, final float pFromRed, final float pToRed, final float pFromGreen, final float pToGreen, final float pFromBlue, final float pToBlue, final IEaseFunction pEaseFunction)
public ColorModifier(final float pDuration, final Color pFromColor, final Color pToColor, final IEntityModifierListener pEntityModifierListener)
public ColorModifier(final float pDuration, final float pFromRed, final float pToRed, final float pFromGreen, final float pToGreen, final float pFromBlue, final float pToBlue, final IEntityModifierListener pEntityModifierListener)
public ColorModifier(final float pDuration, final Color pFromColor, final Color pToColor, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)
public ColorModifier(final float pDuration, final float pFromRed, final float pToRed, final float pFromGreen, final float pToGreen, final float pFromBlue, final float pToBlue, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction)

その他のModifier

DelayModifier

何も変化させないModifierです。リスナーを指定して、指定時間後に処理を行ったり、この後で紹介するParallelEntityModifierやSequenceEntityModifierでタイミング調整に使ったりします。

public DelayModifier(final float pDuration, final IEntityModifierListener pEntityModifierListener)
public DelayModifier(final float pDuration)

LoopEntityModifier

Modifierを指定して、繰り返させます。回数指定も可能です。 ループの様々なタイミングをリスナーで処理できます。

public LoopEntityModifier(final IEntityModifier pEntityModifier)
public LoopEntityModifier(final IEntityModifier pEntityModifier, final int pLoopCount)
public LoopEntityModifier(final IEntityModifier pEntityModifier, final int pLoopCount, final ILoopEntityModifierListener pLoopModifierListener)
public LoopEntityModifier(final IEntityModifier pEntityModifier, final int pLoopCount, final IEntityModifierListener pEntityModifierListener)
public LoopEntityModifier(final IEntityModifierListener pEntityModifierListener, final int pLoopCount, final ILoopEntityModifierListener pLoopModifierListener, final IEntityModifier pEntityModifier)

ParallelEntityModifier

複数のModifierを指定して、同時に変化させます。 長さが違うModifierの処理は未調査。

public ParallelEntityModifier(final IEntityModifier... pEntityModifiers) throws IllegalArgumentException
public ParallelEntityModifier(final IEntityModifierListener pEntityModifierListener, final IEntityModifier... pEntityModifiers) throws IllegalArgumentException

SequenceEntityModifier

複数のModifierを指定して、順番に変化させます。 最初のModifierでの変化が終わったら、次のModifierの変化を開始。と言う感じです。

個々のModifierのイベントをリスナーで処理できます。

public SequenceEntityModifier(final IEntityModifier... pEntityModifiers) throws IllegalArgumentException
public SequenceEntityModifier(final ISubSequenceShapeModifierListener pSubSequenceShapeModifierListener, final IEntityModifier... pEntityModifiers) throws IllegalArgumentException
public SequenceEntityModifier(final IEntityModifierListener pEntityModifierListener, final IEntityModifier... pEntityModifiers) throws IllegalArgumentException
public SequenceEntityModifier(final ISubSequenceShapeModifierListener pSubSequenceShapeModifierListener, final IEntityModifierListener pEntityModifierListener, final IEntityModifier... pEntityModifiers) throws IllegalArgumentException

Comments