Module hanyaeger

Interface Animation

All Known Implementing Classes:
FiniteAnimation, FiniteAnimationWithCallBack, LinkedAnimation, LinkedAnimationWithCallBack, LoopingAnimation

public interface Animation
An Animation encapsulate an animation that uses only a selection of the frames from a sprite sheet.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The default interval for sprite cycling that will be used if none is set.
  • Method Summary

    Modifier and Type
    Method
    Description
    The AnimationCallback is a functional interface the method AnimationCallback.call(), which will be called after the animation calls the last sprite.
    int
    The column-index of the last sprite to be shown.
    int
    The column-index of the first sprite to be shown.
    long
    The interval for sprite cycling that will be used when playing this Animation.
    default boolean
    A value that states whether this Animation should loop after it has finished.
    default Animation
    A value that returns the next Animation to be played, after this instance has finished.
    int
    The row-index of the last sprite to be shown.
    int
    The row-index of the first sprite to be shown.
  • Field Details

    • DEFAULT_AUTOCYCLE_INTERVAL

      static final long DEFAULT_AUTOCYCLE_INTERVAL
      The default interval for sprite cycling that will be used if none is set. This value is in ms.
      See Also:
  • Method Details

    • rowStart

      int rowStart()
      The row-index of the first sprite to be shown. Note that this value is 0-based.
      Returns:
      the 0-based row-index of the first sprite to be shown
    • columnStart

      int columnStart()
      The column-index of the first sprite to be shown. Note that this value is 0-based.
      Returns:
      the 0-based column-index of the first sprite to be shown
    • rowEnd

      int rowEnd()
      The row-index of the last sprite to be shown. Note that this value is 0-based.
      Returns:
      the 0-based row-index of the last sprite to be shown
    • columnEnd

      int columnEnd()
      The column-index of the last sprite to be shown. Note that this value is 0-based.
      Returns:
      the 0-based column-index of the last sprite to be shown
    • loop

      default boolean loop()
      A value that states whether this Animation should loop after it has finished. Only a LoopingAnimation will return true for this value.
      Returns:
      whether this Animation should loop after it has finished
    • next

      default Animation next()
      A value that returns the next Animation to be played, after this instance has finished. Only a LinkedAnimation will support this value.
      Returns:
      the next Animation to be played, after this instance has finished
    • callback

      default AnimationCallback callback()
      The AnimationCallback is a functional interface the method AnimationCallback.call(), which will be called after the animation calls the last sprite.
      Returns:
      the AnimationCallback
    • cycleTimeInMs

      long cycleTimeInMs()
      The interval for sprite cycling that will be used when playing this Animation.
      Returns:
      the interval for sprite cycling that will be used when playing this Animation