AnimationManager#add()

add(name, frames, frameRate, loop, useNumericIndex) → {Phaser.Animation} Adds a new animation under the given key. Optionally set the frames, frame rate and loop.Animations added in this way are played back with the play function. Parameters Name Type Argument Default Description name string The unique (within this Sprite) name for the animation, i.e. "run", "fire", "walk". frames Array <optional> null An array of numbers/strings that correspond to the frames to add to this

Animation.generateFrameNames()

<static> generateFrameNames(prefix, start, stop, suffix, zeroPad) → {Array.<string>} Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers.For example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion0030-large'You could use this function to generate those by doing: Phaser.Animation.generateFrameNames('explosion', 1, 30, '-large', 4); Parameters Name Type Argument Default Description prefix str

Animation#updateFrameData()

updateFrameData(frameData) Changes the FrameData object this Animation is using. Parameters Name Type Description frameData Phaser.FrameData The FrameData object that contains all frames used by this Animation. Source code: animation/Animation.js (Line 595)

Animation#update()

update() Updates this animation. Called automatically by the AnimationManager. Source code: animation/Animation.js (Line 393)

Animation#stop()

stop(resetFrame, dispatchComplete) 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. Parameters Name Type Argument Default Description resetFrame boolean <optional> false If true after the animation stops the currentFrame value will be set to the first frame in this animation. di

Animation#setFrame()

setFrame(frameId, useLocalFrameIndex) Sets this animations playback to a given frame with the given ID. Parameters Name Type Argument Default Description frameId string | number <optional> 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. useLocalFrameIndex boolean <optional> false If you provide a number for frameId, should it use the numeric indexes of the frameData, or the 0-indexed fr

Animation#speed

speed : number 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. Source code: animation/Animation.js (Line 777)

Animation#reverseOnce()

reverseOnce() → {Phaser.Animation} Reverses the animation direction for the current/next animation onlyOnce the onComplete event is called this method will be called again and revertthe reversed state. Returns Phaser.Animation - The animation instance. Source code: animation/Animation.js (Line 260)

Animation#reverse()

reverse() → {Phaser.Animation} Reverses the animation direction. Returns Phaser.Animation - The animation instance. Source code: animation/Animation.js (Line 246)

Animation#reversed

reversed : boolean Gets and sets the isReversed state of this Animation. Source code: animation/Animation.js (Line 706)