Class SpriteAnimation


  • public class SpriteAnimation
    extends javafx.animation.Transition
    Animation for a sprite image.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javafx.animation.Animation

        javafx.animation.Animation.Status
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int columns  
      private int count  
      private int height  
      private javafx.scene.image.ImageView imageView  
      private int lastIndex  
      private int offsetX  
      private int offsetY  
      private int width  
      • Fields inherited from class javafx.animation.Animation

        INDEFINITE
    • Constructor Summary

      Constructors 
      Constructor Description
      SpriteAnimation​(javafx.scene.image.ImageView imageView, javafx.util.Duration duration, int count, int columns, int offsetX, int offsetY, int width, int height)
      Initialize the sprite animation
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void interpolate​(double k)  
      • Methods inherited from class javafx.animation.Transition

        getCachedInterpolator, getInterpolator, getParentTargetNode, interpolatorProperty, setInterpolator
      • Methods inherited from class javafx.animation.Animation

        autoReverseProperty, currentRateProperty, currentTimeProperty, cycleCountProperty, cycleDurationProperty, delayProperty, getCuePoints, getCurrentRate, getCurrentTime, getCycleCount, getCycleDuration, getDelay, getOnFinished, getRate, getStatus, getTargetFramerate, getTotalDuration, isAutoReverse, jumpTo, jumpTo, onFinishedProperty, pause, play, playFrom, playFrom, playFromStart, rateProperty, setAutoReverse, setCycleCount, setCycleDuration, setDelay, setOnFinished, setRate, setStatus, statusProperty, stop, totalDurationProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • imageView

        private final javafx.scene.image.ImageView imageView
      • count

        private final int count
      • columns

        private final int columns
      • offsetX

        private final int offsetX
      • offsetY

        private final int offsetY
      • width

        private final int width
      • height

        private final int height
      • lastIndex

        private int lastIndex
    • Constructor Detail

      • SpriteAnimation

        public SpriteAnimation​(javafx.scene.image.ImageView imageView,
                               javafx.util.Duration duration,
                               int count,
                               int columns,
                               int offsetX,
                               int offsetY,
                               int width,
                               int height)
        Initialize the sprite animation
        Parameters:
        imageView - on which the animated image is located
        duration - total duration of the animation
        count - number of images in the animation
        columns - number of columns in the sprite
        offsetX - x offset of the first image
        offsetY - y offset of the first image
        width - of single frame image in the sprite
        height - of single frame image in the sprite
    • Method Detail

      • interpolate

        protected void interpolate​(double k)
        Specified by:
        interpolate in class javafx.animation.Transition