Class Flipbook

java.lang.Object
tripleplay.anim.Flipbook

public class Flipbook extends Object
Encapsulates a set of frames and timings for animating those frames.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final 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

    Constructors
    Constructor
    Description
    Flipbook(Frames frames, float secsPerFrame)
    Creates a flipbook with the specified frames.
    Flipbook(Frames frames, float[] frameEnds)
    Creates a flipbook with the specified frames.
    Flipbook(Frames frames, int[] frameIndexes, float[] frameEnds)
    Creates a flipbook with the specified frames.
  • Method Summary

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • frames

      public final Frames frames
      The frames to be animated.
    • frameIndexes

      public final int[] frameIndexes
      The 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[] frameEnds
      The timestamp at which to stop playing each frame and move to the next.
  • Constructor Details

    • Flipbook

      public Flipbook(Frames frames, float secsPerFrame)
      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

      public Flipbook(Frames frames, float[] frameEnds)
      Creates a flipbook with the specified frames. The frames will be played in order, each for its associated duration in frameEnds.
      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

      public Flipbook(Frames frames, int[] frameIndexes, float[] frameEnds)
      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 in frameIndex ends. The values must be monotonically increasing (e.g. (1.5f, 2f, 2.5f, 4f).