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 void
dispose()
removes itself from parentvoid
setOffset(float time)
set an offset in time.void
setParent(AbstractEntity parent)
void
start()
Starts the animation.void
stop()
Stops the animation.void
update(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:Animatable
Starts the animation.- Specified by:
start
in interfaceAnimatable
-
stop
public void stop()
Description copied from interface:Animatable
Stops the animation.- Specified by:
stop
in interfaceAnimatable
-
setParent
public void setParent(AbstractEntity parent)
-
setOffset
public void setOffset(float time)
set an offset in time.- Parameters:
time
- in ms
-
-