classafFantomMappy::AnimFunc
sys::Obj afFantomMappy::AnimFunc
@Js
A collection of standard animation functions as defined by Mappy.
Should be a const class with static fields. See http://fantom.org/sidewalk/topic/1973
- animateOnce
|AnimBlock animateOnce := |AnimBlock->Void| { ... }AN_ONCEAfter the animation sequence finishes the currentFrameIndex resets to the first frame and the animFunc changes to animateOnceFinished.
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 0 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 . . . ]
- animateOnceAndHalt
|AnimBlock animateOnceAndHalt := |AnimBlock->Void| { ... }AN_ONCEH
After the animation sequence finishes the current frame sticks to the last frame. Unlike animateOnce the animFunc does not change.
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 0 1 2 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 . . . ]
- animateOnceFinished
|AnimBlock animateOnceFinished := |AnimBlock->Void| { ... }AN_ONCESThe animation type is automatically set to this after the animateOnce sequence has finished.
animateOnceFinishedbehaves the same as none.- loopForward
|AnimBlock loopForward := |AnimBlock->Void| { ... }AN_LOOPFGiven 5 frames of animation, currentFrameIndex would update as follows:
[ 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 3 . . . ]
- loopReverse
|AnimBlock loopReverse := |AnimBlock->Void| { ... }AN_LOOPRGiven 5 frames of animation, currentFrameIndex would update as follows:
[ 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 4 3 2 . . . ]
- none
|AnimBlock none := |Obj?->Void| { ... }AN_NONEDo Not Animate. By setting the animation type to
nonethe current frame will stay as it is.Given 5 frames of animation, currentFrameIndex would update as follows:
[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . . . ]
- pingPongForwardOutwardLeg
|AnimBlock pingPongForwardOutwardLeg := |AnimBlock->Void| { ... }AN_PPFFWhen the animation sequence reaches the end of the forward
pingthe animFunc changes to pingPongForwardReturnLeg and the sequence begins its return journey.It could be argued there is no difference between pingPongForwardOutwardLeg and pingPongReverseReturnLeg
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 . . . ]
- pingPongForwardReturnLeg
|AnimBlock pingPongForwardReturnLeg := |AnimBlock->Void| { ... }AN_PPFRWhen the animation sequence reaches the end of the forward
pongthe animFunc changes to pingPongForwardOutwardLeg and the sequence starts all over again.It could be argued there is no difference between pingPongForwardReturnLeg and pingPongReverseOutwardLeg.
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 . . . ]
- pingPongReverseOutwardLeg
|AnimBlock pingPongReverseOutwardLeg := |AnimBlock->Void| { ... }AN_PPRFWhen the animation sequence reaches the end of the reverse
pingthe animFunc changes to pingPongReverseReturnLeg and the sequence begins its return journey.It could be argued there is no difference between pingPongReverseOutwardLeg and pingPongForwardReturnLeg.
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 . . . ]
- pingPongReverseReturnLeg
|AnimBlock pingPongReverseReturnLeg := |AnimBlock->Void| { ... }When the animation sequence reaches the end of the reverse
pongthe animFunc changes to pingPongReverseOutwardLeg and the sequence starts all over again.It could be argued there is no difference between pingPongReverseReturnLeg and pingPongForwardOutwardLeg.
Given 5 frames of animation, currentFrameIndex would update as follows:
[ 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 . . . ]