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

Source

|AnimBlock animateOnce := |AnimBlock->Void| { ... }

AN_ONCE

After 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

Source

|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

Source

|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.

loopForward

Source

|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

Source

|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

Source

|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

Source

|AnimBlock pingPongForwardOutwardLeg := |AnimBlock->Void| { ... }

AN_PPFF

When the animation sequence reaches the end of the forward ping the 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

Source

|AnimBlock pingPongForwardReturnLeg := |AnimBlock->Void| { ... }

AN_PPFR

When the animation sequence reaches the end of the forward pong the 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

Source

|AnimBlock pingPongReverseOutwardLeg := |AnimBlock->Void| { ... }

AN_PPRF

When the animation sequence reaches the end of the reverse ping the 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

Source

|AnimBlock pingPongReverseReturnLeg := |AnimBlock->Void| { ... }

When the animation sequence reaches the end of the reverse pong the 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 . . . ]