|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.graphics.g2d.Animation
public class Animation
An Animation stores a list of TextureRegion
s representing an animated sequence, e.g. for running or jumping. Each
region of an Animation is called a key frame, multiple key frames make up the animation.
Field Summary | |
---|---|
float |
frameDuration
|
Constructor Summary | |
---|---|
Animation(float frameDuration,
java.util.List keyFrames)
Constructor, storing the frame duration and key frames. |
|
Animation(float frameDuration,
TextureRegion... keyFrames)
Constructor, storing the frame duration and key frames. |
Method Summary | |
---|---|
TextureRegion |
getKeyFrame(float stateTime,
boolean looping)
Returns a TextureRegion based on the so called state time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float frameDuration
Constructor Detail |
---|
public Animation(float frameDuration, java.util.List keyFrames)
frameDuration
- the time between frames in seconds.keyFrames
- the TextureRegion
s representing the frames.public Animation(float frameDuration, TextureRegion... keyFrames)
frameDuration
- the time between frames in seconds.keyFrames
- the TextureRegion
s representing the frames.Method Detail |
---|
public TextureRegion getKeyFrame(float stateTime, boolean looping)
TextureRegion
based on the so called state time. This is the amount of seconds an object has spent in the
state this Animation instance represents, e.g. running, jumping and so on. The mode specifies whether the animation is
looping or not.
stateTime
- the time spent in the state represented by this animation.looping
- whether the animation is looping or not.
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |