|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.animation.AnimationFrameSequencer.MultiFunction
public static class AnimationFrameSequencer.MultiFunction
A sequencer that can step through a series of frames in any order and speed and notify (via
SequencedAnimationObserver) when specific frames are reached.
| Nested Class Summary | |
|---|---|
protected static class |
AnimationFrameSequencer.MultiFunction.FrameReachedOp
Used to dispatch SequencedAnimationObserver.frameReached(com.threerings.media.animation.Animation, long, int, int). |
| Nested classes/interfaces inherited from interface com.threerings.media.animation.AnimationFrameSequencer |
|---|
AnimationFrameSequencer.MultiFunction |
| Nested classes/interfaces inherited from interface com.threerings.media.util.FrameSequencer |
|---|
FrameSequencer.ConstantRate |
| Field Summary | |
|---|---|
protected Animation |
_animation
The animation that we're sequencing for. |
protected int |
_curIdx
The current sequence index. |
protected long |
_delay
Or a single delay for all frames. |
protected long[] |
_delays
The corresponding delay for each frame, in ms. |
protected long |
_lastStamp
The time at which we were last ticked. |
protected int |
_length
The length of our animation sequence. |
protected boolean |
_loop
Does the animation loop? |
protected boolean[] |
_marks
Whether to send a FrameReachedEvent on a sequence index. |
protected boolean |
_resets
Do we reset on init? |
protected int[] |
_sequence
The sequence of frames to display. |
| Constructor Summary | |
|---|---|
AnimationFrameSequencer.MultiFunction(int[] sequence,
long[] msPerFrame,
boolean[] marks,
boolean loop)
Creates a fully-specified multifunction frame sequencer. |
|
AnimationFrameSequencer.MultiFunction(int[] sequence,
long msPerFrame,
boolean loop)
Creates the simplest multifunction frame sequencer. |
|
| Method Summary | |
|---|---|
protected void |
checkNotify(long tickStamp)
Check to see if we need to notify that we've reached a marked frame. |
void |
fastForward(long timeDelta)
Called if the display is paused for some length of time and then unpaused. |
protected long |
getDelay(int index)
Get the delay to use for the specified frame. |
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? |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _curIdx
protected int _length
protected boolean _resets
protected int[] _sequence
protected long[] _delays
protected long _delay
protected boolean[] _marks
protected boolean _loop
protected long _lastStamp
protected Animation _animation
| Constructor Detail |
|---|
public AnimationFrameSequencer.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 AnimationFrameSequencer.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.| Method Detail |
|---|
public void setDelay(long msPerFrame)
public void setLength(int len)
public void setResetOnInit(boolean resets)
public int init(MultiFrameImage source)
FrameSequencer
init in interface FrameSequencersource - the multi-frame image that is providing the animation frames.
public void setAnimation(Animation anim)
AnimationFrameSequencer
setAnimation in interface AnimationFrameSequencerpublic int tick(long tickStamp)
FrameSequencer
tick in interface FrameSequencerpublic void fastForward(long timeDelta)
FrameSequencer
fastForward in interface FrameSequencerprotected final long getDelay(int index)
protected void checkNotify(long tickStamp)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||