name | type | arguments | Default | description |
---|---|---|---|---|
key | string | <optional> |
The key that the animation will be associated with. i.e. sprite.animations.play(key) |
|
frames | string | Array.<Phaser.Types.Animations.AnimationFrame> | <optional> |
Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. |
|
sortFrames | boolean | <optional> | true |
If you provide a string for |
defaultTextureKey | string | <optional> | null |
The key of the texture all frames of the animation will use. Can be overridden on a per frame basis. |
frameRate | number | <optional> |
The frame rate of playback in frames per second (default 24 if duration is null) |
|
duration | number | <optional> |
How long the animation should play for in milliseconds. If not given its derived from frameRate. |
|
skipMissedFrames | boolean | <optional> | true |
Skip frames if the time lags, or always advanced anyway? |
delay | number | <optional> | 0 |
Delay before starting playback. Value given in milliseconds. |
repeat | number | <optional> | 0 |
Number of times to repeat the animation (-1 for infinity) |
repeatDelay | number | <optional> | 0 |
Delay before the animation repeats. Value given in milliseconds. |
yoyo | boolean | <optional> | false |
Should the animation yoyo? (reverse back down to the start) before repeating? |
showOnStart | boolean | <optional> | false |
Should sprite.visible = true when the animation starts to play? |
hideOnComplete | boolean | <optional> | false |
Should sprite.visible = false when the animation finishes? |