classafFantomMappy::AnimFunc
sys::Obj afFantomMappy::AnimFunc
@
Js
A collection of standard animation functions as defined by Mappy. FIXME: http://fantom.org/sidewalk/topic/1973# Should be const class with static fields
- animateOnce
|AnimBlock animateOnce := |AnimBlock->Void| { ... }
AN_ONCE
After the animation sequence finishes the currentFrameIndex resets to the first frame and the animType 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 animType 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_ONCES
The animation type is automatically set to this after the animateOnce sequence has finished.
animateOnceFinished
behaves the same as none.- instance
static AnimFunc instance()
I lie!
- loopForward
|AnimBlock loopForward := |AnimBlock->Void| { ... }
AN_LOOPF
Given 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_LOOPR
Given 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_NONE
Do Not Animate. By setting the animation type to
none
the 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_PPFF
When the animation sequence reaches the end of the forward
ping
the animType 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_PPFR
When the animation sequence reaches the end of the forward
pong
the animType 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_PPRF
When the animation sequence reaches the end of the reverse
ping
the animType 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| { ... }
Fandoc ERRORS: Line 12 - Invalid annotation [] When the animation sequence reaches the end of the reverse 'pong' the [animType]`AnimBlock.animType` changes to [pingPongReverseOutwardLeg]`AnimType.pingPongReverseOutwardLeg` and the sequence starts all over again. It could be argued there is no difference between [pingPongReverseReturnLeg]`AnimType.pingPongReverseReturnLeg` and [pingPongForwardOutwardLeg]`AnimType.pingPongForwardOutwardLeg` Given 5 frames of animation, [currentFrameIndex]`AnimBlock.currentFrameIndex` would update as follows: [ 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 . . . ]