Class ActorAnimator.Clip
java.lang.Object
com.codename1.gaming.platformer.view.ActorAnimator.Clip
- Enclosing class:
ActorAnimator
A run of frames.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintframeAt(int ticks) The frame shown a number of ticks into the clip.
-
Constructor Details
-
Clip
public Clip(int[] frames, int ticksPerFrame, boolean loop) Creates a clip.
Parameters
frames: frame indices into the sheet, at least oneticksPerFrame: world ticks (1/60 s) each frame showsloop: 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
-