Class ActorAnimator.Clip

java.lang.Object
com.codename1.gaming.platformer.view.ActorAnimator.Clip
Enclosing class:
ActorAnimator

public static final class ActorAnimator.Clip extends Object
A run of frames.
  • Constructor Details

    • Clip

      public Clip(int[] frames, int ticksPerFrame, boolean loop)

      Creates a clip.

      Parameters
      • frames: frame indices into the sheet, at least one
      • ticksPerFrame: world ticks (1/60 s) each frame shows
      • loop: whether it repeats; otherwise it holds the last frame
  • Method Details

    • frameAt

      public int frameAt(int ticks)

      The frame shown a number of ticks into the clip.

      Parameters
      • ticks: ticks since the clip started
      Returns

      a sheet frame index