public class EntityAnimation extends java.lang.Object implements Animatable
Constructor and Description |
---|
EntityAnimation(int[] animationsinformation,
boolean autostart,
boolean loop)
Create an entity with an animation with an array wich has the time of every animation step in ms in it.
|
Modifier and Type | Method and Description |
---|---|
void |
ignoreGameSpeed(boolean ignore)
ignores the delta time of the game world. use this if you want to have an animation independent of game speed (e.g. slow motion.)
|
void |
start()
Starts the animation.
|
void |
stop()
Stops the animation.
|
void |
update(float dt)
updates the entity and the animation.
|
public EntityAnimation(int[] animationsinformation, boolean autostart, boolean loop)
animationsinformation
- the time in ms for each animation stepautostart
- True when it should automatically start.loop
- Set to true when it should loop, when false it stops after one time.public void update(float dt)
dt
- the time wich has passed since last updatepublic void start()
Animatable
start
in interface Animatable
public void stop()
Animatable
stop
in interface Animatable
public void ignoreGameSpeed(boolean ignore)
ignore
- true ignores game time