com.b3dgs.lionengine.drawable
Interface Animator

All Known Subinterfaces:
AnimatedSprite
All Known Implementing Classes:
AbstractBuilding, AbstractEnemy, AbstractEntry, AbstractHero, AbstractPlatformEntity, AbstractRasteredPlatformEntity, AbstractUnit, Projectile

public interface Animator

Anim routine, which can play an animation from anim container.


Method Summary
 AnimState getAnimState()
          Get current animation state.
 int getFrame()
          Get the current playing frame number.
 float getRealFrame()
          Get the current playing frame with accurate precision.
 void play(Animation animation)
          Play the animated sprite with a specific animation, previously created.
 void play(Animation animation, float speed)
          Play the animated sprite with a specific animation, previously created.
 void play(int start, int end, float speed, boolean reverse, boolean repeat)
          Play the animated sprite with a specific animation data.
 void setFrame(int frame)
          Set a fixed frame (it will overwrite the current animation).
 void setSkipLastFrameOnReverse(boolean skip)
          Skip last frame when reverse playing is enable It will directly play the last-1 frame when reversing if set to true.
 void stopAnimation()
          Stop current animation (animation state set to READY).
 void updateAnimation(float extrp)
          Animation update routine.
 

Method Detail

play

void play(Animation animation)
Play the animated sprite with a specific animation, previously created.

Parameters:
animation - animation reference.

play

void play(Animation animation,
          float speed)
Play the animated sprite with a specific animation, previously created. The specified speed will overwrite the default animation speed.

Parameters:
animation - animation reference.
speed - specified speed.

play

void play(int start,
          int end,
          float speed,
          boolean reverse,
          boolean repeat)
Play the animated sprite with a specific animation data.

Parameters:
start - first frame to play.
end - last frame to reach.
speed - specified speed.
reverse - reverse play when end is reached.
repeat - play in loop.

setSkipLastFrameOnReverse

void setSkipLastFrameOnReverse(boolean skip)
Skip last frame when reverse playing is enable It will directly play the last-1 frame when reversing if set to true.


stopAnimation

void stopAnimation()
Stop current animation (animation state set to READY).


updateAnimation

void updateAnimation(float extrp)
Animation update routine.

Parameters:
extrp - extrapolation value.

getAnimState

AnimState getAnimState()
Get current animation state.

Returns:
animation state (READY, ANIMATING...).
See Also:
AnimState

setFrame

void setFrame(int frame)
Set a fixed frame (it will overwrite the current animation).

Parameters:
frame - frame to set.

getFrame

int getFrame()
Get the current playing frame number.

Returns:
current playing frame number.

getRealFrame

float getRealFrame()
Get the current playing frame with accurate precision.

Returns:
real frame.