Class Animation
java.lang.Object
buildengine.engine.graphics.animation.Animation
Basic animation utility.
Sprite has its own Animation utility.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAnimation
(long speed, BufferedImage[] frames) Create instanceAnimation
(long speed, BufferedImage[] frames, boolean playOnlyOnce) Animation
(BufferedImage... frames) -
Method Summary
Modifier and TypeMethodDescriptiongetFrame()
Current frameint
getIndex()
boolean
boolean
void
void
play()
void
void
reverse()
void
setIndex
(int index) void
setPlaying
(boolean playing) void
setPlayOnlyOnce
(boolean playOnlyOnce) void
setSpeed
(long interval)
-
Field Details
-
DEFAULT_FRAME_INTERVAL
public static final long DEFAULT_FRAME_INTERVAL- See Also:
-
-
Constructor Details
-
Animation
-
Animation
Create instance- Parameters:
speed
- The speed in ms it takes to go to the next frameframes
- The images that makes up the animation
-
Animation
-
-
Method Details
-
nextFrame
public void nextFrame() -
resetIndex
public void resetIndex() -
play
public void play() -
reverse
-
flipFramesHorizontally
-
flipFramesVertically
-
setSpeed
public void setSpeed(long interval) -
getFrame
Current frame -
isPlayingOnlyOnce
public boolean isPlayingOnlyOnce() -
setPlayOnlyOnce
public void setPlayOnlyOnce(boolean playOnlyOnce) -
isPlaying
public boolean isPlaying() -
setPlaying
public void setPlaying(boolean playing) -
getIndex
public int getIndex() -
setIndex
public void setIndex(int index) -
getFrames
-
getRepeatingEvent
-