Package tripleplay.anim
Class Flipbook
java.lang.Object
tripleplay.anim.Flipbook
Encapsulates a set of frames and timings for animating those frames.
-
Field Summary
Modifier and TypeFieldDescriptionfinal float[]
The timestamp at which to stop playing each frame and move to the next.final int[]
The index of the frames to be shown.final Frames
The frames to be animated. -
Constructor Summary
ConstructorDescriptionCreates a flipbook with the specified frames.Creates a flipbook with the specified frames.Creates a flipbook with the specified frames. -
Method Summary
-
Field Details
-
frames
The frames to be animated. -
frameIndexes
public final int[] frameIndexesThe index of the frames to be shown. The animation will display the frame at the 0th position in this array, then the frame at the 1st position, etc. -
frameEnds
public final float[] frameEndsThe timestamp at which to stop playing each frame and move to the next.
-
-
Constructor Details
-
Flipbook
Creates a flipbook with the specified frames. The frames will be played in order, each for the specified duration.- Parameters:
secsPerFrame
- the number of seconds to display each frame.
-
Flipbook
Creates a flipbook with the specified frames. The frames will be played in order, each for its associated duration inframeEnds
.- Parameters:
frameEnds
- the time (in seconds since animation start) at which each frame ends. The values must be monotonically increasing (e.g.(1.5f, 2f, 2.5f, 4f)
.
-
Flipbook
Creates a flipbook with the specified frames.- Parameters:
frameIndexes
- an array of frame indexes to be played in the specified order.frameEnds
- the time (in seconds since animation start) at which the frame specified at the corresponding position inframeIndex
ends. The values must be monotonically increasing (e.g.(1.5f, 2f, 2.5f, 4f)
.
-