A reference to the currently running game.
A reference to the owner of this Animation.
The unique name for this animation, used in playback commands.
The FrameData object that contains all frames used by this Animation.
An array of numbers or strings indicating which frames to play in which order.
The speed at which the animation should play. The speed is given in frames per second.
Whether or not the animation is looped or just plays once.
Called internally when the animation finishes playback.
Called internally when the animation finishes playback. Sets the isPlaying and isFinished states and dispatches the onAnimationComplete event if it exists on the parent and local onComplete event.
The currently displayed frame of the Animation.
The delay in ms between each frame of the Animation, based on the given frameRate.
Cleans up this animation ready for deletion.
Cleans up this animation ready for deletion. Nulls all values and references.
Gets or sets if this animation will dispatch the onUpdate events upon changing frame.
Gets or sets the current frame index and updates the Texture Cache for display.
The FrameData object that contains all frames used by this Animation.
The speed at which the animation should play.
The speed at which the animation should play. The speed is given in frames per second.
The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded.
An array of numbers or strings indicating which frames to play in which order.
A reference to the currently running game.
The finished state of the Animation.
The finished state of the Animation. Set to true once playback completes, false during playback.
The paused state of the Animation.
The playing state of the Animation.
The playing state of the Animation. Set to false once playback completes, true during playback.
Indicates if the animation will play backwards.
Should the parent of this Animation be killed when the animation completes?
Whether or not the animation is looped or just plays once.
The number of times the animation has looped since it was last started.
The unique name for this animation, used in playback commands.
Advances by the given number of frames in the Animation, taking the loop value into consideration.
Advances by the given number of frames in the Animation, taking the loop value into consideration.
The number of frames to advance.
This event is dispatched when this Animation completes playback.
This event is dispatched when this Animation completes playback. If the animation is set to loop this is never fired, listen for onLoop instead.
This event is dispatched when this Animation starts playback.
Called when the Game enters a paused state.
Called when the Game resumes from a paused state.
This event is dispatched when the Animation changes frame.
This event is dispatched when the Animation changes frame.
By default this event is disabled due to its intensive nature. Enable it with: Animation.enableUpdate = true
.
Note that the event is only dispatched with the current frame. In a low-FPS environment Animations
will automatically frame-skip to try and claw back time, so do not base your code on expecting to
receive a perfectly sequential set of frames from this event.
A reference to the owner of this Animation.
Gets and sets the paused state of this Animation.
Plays this animation.
Plays this animation.
The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.
A reference to this Animation instance.
Moves backwards the given number of frames in the Animation, taking the loop value into consideration.
Moves backwards the given number of frames in the Animation, taking the loop value into consideration.
The number of frames to move back.
Sets this animation back to the first frame and restarts the animation.
Reverses the animation direction.
Reverses the animation direction.
A reference to this Animation instance.
Reverses the animation direction for the current/next animation only Once the onComplete event is called this method will be called again and revert the reversed state.
Reverses the animation direction for the current/next animation only Once the onComplete event is called this method will be called again and revert the reversed state.
The animation instance.
Gets and sets the isReversed state of this Animation.
Sets this animations playback to a given frame with the given ID.
Sets this animations playback to a given frame with the given ID.
The identifier of the frame to set. Can be the name of the frame, the sprite index of the frame, or the animation-local frame index.
If you provide a number for frameId, should it use the numeric indexes of the frameData, or the 0-indexed frame index local to the animation.
Gets or sets the current speed of the animation in frames per second.
Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Value must be greater than 0.
Stops playback of this animation and set it to a finished state.
Stops playback of this animation and set it to a finished state. If a resetFrame is provided it will
stop playback and set frame to the first in the animation.
If dispatchComplete
is true it will dispatch the complete events, otherwise they'll be ignored.
If true after the animation stops the currentFrame value will be set to the first frame in this animation.
Dispatch the Animation.onComplete and parent.onAnimationComplete events?
Updates this animation.
Updates this animation. Called automatically by the AnimationManager.
Changes the FrameData object this Animation is using.
Changes the FrameData object this Animation is using.
The FrameData object that contains all frames used by this Animation.
An Animation instance contains a single animation and the controls to play it.
It is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite.
https://phaser.io/docs/2.6.2/Phaser.Animation.html