Class Animation

java.lang.Object
buildengine.engine.graphics.animation.Animation

public class Animation extends Object
Basic animation utility. Sprite has its own Animation utility.
See Also:
  • Field Details

    • DEFAULT_FRAME_INTERVAL

      public static final long DEFAULT_FRAME_INTERVAL
      See Also:
  • Constructor Details

    • Animation

      public Animation(BufferedImage... frames)
    • Animation

      public Animation(long speed, BufferedImage[] frames)
      Create instance
      Parameters:
      speed - The speed in ms it takes to go to the next frame
      frames - The images that makes up the animation
    • Animation

      public Animation(long speed, BufferedImage[] frames, boolean playOnlyOnce)
  • Method Details

    • nextFrame

      public void nextFrame()
    • resetIndex

      public void resetIndex()
    • play

      public void play()
    • reverse

      @Unstable(concerning="NOT_TESTED") public void reverse()
    • flipFramesHorizontally

      public Animation flipFramesHorizontally()
    • flipFramesVertically

      public Animation flipFramesVertically()
    • setSpeed

      public void setSpeed(long interval)
    • getFrame

      public BufferedImage 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

      public BufferedImage[] getFrames()
    • getRepeatingEvent

      public RepeatingEvent getRepeatingEvent()