Class: Animation

Animation

Phaser.Animation

new Animation(game, parent, name, frameData, frames, delay, looped)

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.
Parameters:
Name Type Description
game Phaser.Game A reference to the currently running game.
parent Phaser.Sprite A reference to the owner of this Animation.
name string The unique name for this animation, used in playback commands.
frameData Phaser.Animation.FrameData The FrameData object that contains all frames used by this Animation.
frames Array.<number> | Array.<string> An array of numbers or strings indicating which frames to play in which order.
delay number The time between each frame of the animation, given in ms.
looped boolean Should this animation loop or play through once.
Source:
  • Animation.js, line 22

Classes

Frame
FrameData
Parser

Members

currentFrame

Properties:
Name Type Description
currentFrame Phaser.Animation.Frame The currently displayed frame of the Animation.
Source:
  • Animation.js, line 112

delay

Properties:
Name Type Description
delay number The delay in ms between each frame of the Animation.
Source:
  • Animation.js, line 56

game

Properties:
Name Type Description
game Phaser.Game A reference to the currently running Game.
Source:
  • Animation.js, line 27

isFinished

Properties:
Name Type Description
isFinished boolean The finished state of the Animation. Set to true once playback completes, false during playback.
Default Value:
  • false
Source:
  • Animation.js, line 67

isPaused

Properties:
Name Type Description
isPaused boolean The paused state of the Animation.
Default Value:
  • false
Source:
  • Animation.js, line 79

isPlaying

Properties:
Name Type Description
isPlaying boolean The playing state of the Animation. Set to false once playback completes, true during playback.
Default Value:
  • false
Source:
  • Animation.js, line 73

looped

Properties:
Name Type Description
looped boolean The loop state of the Animation.
Source:
  • Animation.js, line 61

name

Properties:
Name Type Description
name string The user defined name given to this Animation.
Source:
  • Animation.js, line 44