public class Animation extends java.lang.Object implements IUpdateable, ILaunchable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FRAME_DURATION |
| Constructor and Description |
|---|
Animation(Spritesheet spritesheet,
boolean loop,
boolean randomizeStart,
int... keyFrameDurations) |
Animation(Spritesheet spritesheet,
boolean loop,
int... keyFrameDurations) |
Animation(java.lang.String spriteSheetName,
boolean loop,
boolean randomizeStart,
int... keyFrameDurations) |
Animation(java.lang.String name,
Spritesheet spritesheet,
boolean loop,
boolean randomizeStart,
int... keyFrameDurations) |
Animation(java.lang.String name,
Spritesheet spritesheet,
boolean loop,
int... keyFrameDurations) |
| Modifier and Type | Method and Description |
|---|---|
KeyFrame |
getCurrentKeyFrame() |
java.util.List<KeyFrame> |
getKeyframes() |
java.lang.String |
getName() |
Spritesheet |
getSpritesheet() |
int |
getTotalDuration()
Gets to aggregated duration of all
KeyFrames in this animation. |
boolean |
isLoop() |
boolean |
isPaused() |
boolean |
isPlaying() |
void |
pause() |
void |
restart() |
void |
setFrameDuration(int frameDuration)
Sets the frame duration for all keyframes in this animation to the
specified value.
|
void |
setkeyFrameDurations(int... keyFrameDurations) |
void |
start() |
void |
terminate() |
void |
unpause() |
void |
update()
This method is called by the game loop on all objects that need to update
their attributes.
|
public static final int DEFAULT_FRAME_DURATION
public Animation(java.lang.String spriteSheetName,
boolean loop,
boolean randomizeStart,
int... keyFrameDurations)
public Animation(Spritesheet spritesheet, boolean loop, boolean randomizeStart, int... keyFrameDurations)
public Animation(Spritesheet spritesheet, boolean loop, int... keyFrameDurations)
public Animation(java.lang.String name,
Spritesheet spritesheet,
boolean loop,
boolean randomizeStart,
int... keyFrameDurations)
public Animation(java.lang.String name,
Spritesheet spritesheet,
boolean loop,
int... keyFrameDurations)
public KeyFrame getCurrentKeyFrame()
public java.util.List<KeyFrame> getKeyframes()
public int getTotalDuration()
KeyFrames in this animation.public java.lang.String getName()
public Spritesheet getSpritesheet()
public boolean isLoop()
public boolean isPaused()
public boolean isPlaying()
public void pause()
public void setFrameDuration(int frameDuration)
frameDuration - The frameduration for all keyframes.public void setkeyFrameDurations(int... keyFrameDurations)
public void start()
start in interface ILaunchablepublic void restart()
public void terminate()
terminate in interface ILaunchablepublic void unpause()
public void update()
IUpdateableupdate in interface IUpdateable