Package jexer.bits
Class Animation
- java.lang.Object
-
- jexer.bits.Animation
-
public class Animation extends java.lang.ObjectAn animation that can be displayed in an image.
-
-
Constructor Summary
Constructors Constructor Description Animation(java.util.List<java.awt.image.BufferedImage> frames, int frameDelay, int frameLoops)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()Get the number of frames in this animation.intcurrentFrameNumber()Get the number of the current frame in view.java.awt.image.BufferedImagegetFrame()Get the frame currently in view.java.awt.image.BufferedImagegetFrame(int frameNumber)Get a frame by number.booleanisRunning()Check if this animation is running.voidreset()Reset the animation.voidstart(TApplication application)Start the animation.voidstop()Stop the animation.
-
-
-
Constructor Detail
-
Animation
public Animation(java.util.List<java.awt.image.BufferedImage> frames, int frameDelay, int frameLoops)Public constructor.- Parameters:
frames- the framesframeDelay- the number of millis to wait until next animation frameframeLoops- the number of times to loop the animation. 0 means play it once. -1 means to play it forever.
-
-
Method Detail
-
isRunning
public boolean isRunning()
Check if this animation is running.- Returns:
- true if the animation is running
-
start
public void start(TApplication application)
Start the animation.- Parameters:
application- the application
-
stop
public void stop()
Stop the animation.
-
reset
public void reset()
Reset the animation.
-
count
public int count()
Get the number of frames in this animation.- Returns:
- the number of frames
-
currentFrameNumber
public int currentFrameNumber()
Get the number of the current frame in view.- Returns:
- the frame number
-
getFrame
public java.awt.image.BufferedImage getFrame(int frameNumber)
Get a frame by number.- Parameters:
frameNumber- the frame number- Returns:
- the frame
-
getFrame
public java.awt.image.BufferedImage getFrame()
Get the frame currently in view.- Returns:
- the frame
-
-