Class Animation
- java.lang.Object
-
- nl.colorize.multimedialib.graphics.Animation
-
public class Animation extends java.lang.ObjectShows a number of images in sequence. Every frame in the animation is shown for a certain amount of time, indicated in seconds. After all images have been shown, the animation will either loop or keep showing the last image.Note that this class *describes* the animation, it does not contain any state that relates to *showing* the animation. This allows for using the same animation data to display the animation multiple times simultaneously, but it does mean the animation's playback state needs to be managed by the user of this class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFrame(Image frame, float frameTime)floatgetDuration()ImagegetFrameAtIndex(int index)ImagegetFrameAtTime(float time)intgetFrameCount()java.util.List<Image>getFrameImages()floatgetFrameTime(int index)booleanisLoop()voidsetFrameTime(int index, float frameTime)
-
-
-
Method Detail
-
addFrame
public void addFrame(Image frame, float frameTime)
-
getFrameCount
public int getFrameCount()
-
getFrameImages
public java.util.List<Image> getFrameImages()
-
getFrameAtIndex
public Image getFrameAtIndex(int index)
-
getFrameAtTime
public Image getFrameAtTime(float time)
-
getDuration
public float getDuration()
-
setFrameTime
public void setFrameTime(int index, float frameTime)
-
getFrameTime
public float getFrameTime(int index)
-
isLoop
public boolean isLoop()
-
-