Package ch.sahits.game.graphic.image
Class SpriteAnimation
- java.lang.Object
-
- javafx.animation.Animation
-
- javafx.animation.Transition
-
- ch.sahits.game.graphic.image.SpriteAnimation
-
public class SpriteAnimation extends javafx.animation.Transition
Animation for a sprite image.
-
-
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
-
-
-
-
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 locatedduration
- total duration of the animationcount
- number of images in the animationcolumns
- number of columns in the spriteoffsetX
- x offset of the first imageoffsetY
- y offset of the first imagewidth
- of single frame image in the spriteheight
- of single frame image in the sprite
-
-