Class EntityAnimation
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.gameobjects.EntityAnimation
-
- All Implemented Interfaces:
Animatable,Component
public class EntityAnimation extends java.lang.Object implements Animatable, Component
An animation interface for entitys.
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()removes itself from parentvoidsetOffset(float time)set an offset in time.voidsetParent(AbstractEntity parent)voidstart()Starts the animation.voidstop()Stops the animation.voidupdate(float dt)updates the entity and the animation.
-
-
-
Constructor Detail
-
EntityAnimation
public 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.- Parameters:
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.
-
-
Method Detail
-
update
public void update(float dt)
updates the entity and the animation.
-
start
public void start()
Description copied from interface:AnimatableStarts the animation.- Specified by:
startin interfaceAnimatable
-
stop
public void stop()
Description copied from interface:AnimatableStops the animation.- Specified by:
stopin interfaceAnimatable
-
setParent
public void setParent(AbstractEntity parent)
-
setOffset
public void setOffset(float time)
set an offset in time.- Parameters:
time- in ms
-
-