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/Animation.js, line 22
Members
-
currentFrame
-
- Source:
- animation/Animation.js, line 112
Properties:
Name Type Description currentFrame
Phaser.Animation.Frame The currently displayed frame of the Animation. -
delay
-
- Source:
- animation/Animation.js, line 56
Properties:
Name Type Description delay
number The delay in ms between each frame of the Animation. -
game
-
- Source:
- animation/Animation.js, line 27
Properties:
Name Type Description game
Phaser.Game A reference to the currently running Game. -
isFinished
-
- Default Value:
- false
- Source:
- animation/Animation.js, line 67
Properties:
Name Type Description isFinished
boolean The finished state of the Animation. Set to true once playback completes, false during playback. -
isPaused
-
- Default Value:
- false
- Source:
- animation/Animation.js, line 79
Properties:
Name Type Description isPaused
boolean The paused state of the Animation. -
isPlaying
-
- Default Value:
- false
- Source:
- animation/Animation.js, line 73
Properties:
Name Type Description isPlaying
boolean The playing state of the Animation. Set to false once playback completes, true during playback. -
looped
-
- Source:
- animation/Animation.js, line 61
Properties:
Name Type Description looped
boolean The loop state of the Animation. -
name
-
- Source:
- animation/Animation.js, line 44
Properties:
Name Type Description name
string The user defined name given to this Animation.