public static class AnimationFrameSequencer.MultiFunction extends Object implements AnimationFrameSequencer
SequencedAnimationObserver) when specific frames are reached.AnimationFrameSequencer.MultiFunctionFrameSequencer.ConstantRate| Constructor and Description |
|---|
MultiFunction(int[] sequence,
long[] msPerFrame,
boolean[] marks,
boolean loop)
Creates a fully-specified multifunction frame sequencer.
|
MultiFunction(int[] sequence,
long msPerFrame,
boolean loop)
Creates the simplest multifunction frame sequencer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fastForward(long timeDelta)
Called if the display is paused for some length of time and then unpaused.
|
int |
init(MultiFrameImage source)
Called prior to the execution of an animation sequence (not necessarily immediately, so
time stamps should be obtained in the first call to tick).
|
void |
setAnimation(Animation anim)
Called after init to set the animation.
|
void |
setDelay(long msPerFrame)
Set the delay to use.
|
void |
setLength(int len)
Set the length of the sequence we are to use, or 0 means set it to the length of the
sequence array that we were constructed with.
|
void |
setResetOnInit(boolean resets)
Do we reset the animation on init? Default is true.
|
int |
tick(long tickStamp)
Called every display frame, the frame sequencer should return the index of the animation
frame that should be displayed during this tick.
|
public MultiFunction(int[] sequence,
long msPerFrame,
boolean loop)
sequence - the ordering to display the frames.msPerFrame - the number of ms to display each frame.loop - if false, the sequencer will report the end of the animation after
progressing through all of the frames once, otherwise it will loop indefinitely.public MultiFunction(int[] sequence,
long[] msPerFrame,
boolean[] marks,
boolean loop)
sequence - the ordering to display the frames.msPerFrame - the number of ms to display each frame.marks - if true for a frame, a FrameReachedEvent will be generated when that frame
is reached.loop - if false, the sequencer will report the end of the animation after
progressing through all of the frames once, otherwise it will loop indefinitely.public void setDelay(long msPerFrame)
public void setLength(int len)
public void setResetOnInit(boolean resets)
public int init(MultiFrameImage source)
FrameSequencerinit in interface FrameSequencersource - the multi-frame image that is providing the animation frames.public void setAnimation(Animation anim)
AnimationFrameSequencersetAnimation in interface AnimationFrameSequencerpublic int tick(long tickStamp)
FrameSequencertick in interface FrameSequencerpublic void fastForward(long timeDelta)
FrameSequencerfastForward in interface FrameSequencerCopyright © 2015. All rights reserved.