A single frame in an Animation sequence.
An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other frames in the animation, and index data. It also has the ability to modify the animation timing.
AnimationFrames are generated automatically by the Animation class.
new AnimationFrame(textureKey, textureFrame, index, frame, [isKeyFrame])
name | type | arguments | Default | description |
---|---|---|---|---|
textureKey | string |
The key of the Texture this AnimationFrame uses. |
||
textureFrame | string | number |
The key of the Frame within the Texture that this AnimationFrame uses. |
||
index | number |
The index of this AnimationFrame within the Animation sequence. |
||
frame | Phaser.Textures.Frame |
A reference to the Texture Frame this AnimationFrame uses for rendering. |
||
isKeyFrame | boolean | <optional> | false |
Is this Frame a Keyframe within the Animation? |
The duration, in ms, of this frame of the animation.
A reference to the Texture Frame this AnimationFrame uses for rendering.
The index of this AnimationFrame within the Animation sequence.
Is this the first frame in an animation sequence?
Is this Frame a KeyFrame within the Animation?
Is this the last frame in an animation sequence?
A reference to the AnimationFrame that comes after this one in the animation, if any.
A reference to the AnimationFrame that comes before this one in the animation, if any.
What % through the animation does this frame come? This value is generated when the animation is created and cached here.
The key of the Frame within the Texture that this AnimationFrame uses.
The key of the Texture this AnimationFrame uses.
Destroys this object by removing references to external resources and callbacks.
Generates a JavaScript object suitable for converting to JSON.
The AnimationFrame data.