classafFantomMappy::AnimBlock
sys::Obj afFantomMappy::AnimBlock
@Js
Represents a AnimBlock as used by Mappy.
- animFunc
|AnimBlock animFunc := AnimFunc.<ctor>().noneThe function that defines the animation frame sequence. Defaults to
AnimFunc.none- decFrameIndex
Void decFrameIndex(|->Void clipFunc)Decrements the frame index. Should the index drop below zero then the given
clipFuncis called.- delay
Int delayThe
delayis the number of times AnimBlock.updateAnimation needs to be called before thecurrentFrameIndexchanges. In effect this controls the speed of the animation.- delayCountdown
Int delayCountdownReturns the number of times AnimBlock.updateAnimation has to be called before the current frame is changed to the next in sequence.
If
delayCountdown == 0the current frame will change on the next call to AnimBlock.updateAnimation anddelayCountdownwill reset todelay.- frame
Int frame { private set }Returns the current frame (image index). If this AnimBlock has no frames then 0 is returned
- frameIndex
Int frameIndexThe current frame index.
- frames
Int[] frames := Int[,]An array of frames (image indexes) that represent the animation sequence
- incFrameIndex
Void incFrameIndex(|->Void clipFunc)Increments the frame index. Should the index exceed the maximum (
frames.size) then the givenclipFuncis called.- updateAnimation
Void updateAnimation()Counts down the delay and updates the current frame to the next in the animation sequence.
- userData
Int? userDataUser data.