Animation#Animation

new Animation(game, parent, name, frameData, frames, frameRate, loop)

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 Argument Default 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.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.

frameRate number <optional>
60

The speed at which the animation should play. The speed is given in frames per second.

loop boolean <optional>
false

Whether or not the animation is looped or just plays once.

Source code: animation/Animation.js (Line 22)
doc_phaser
2017-02-14 10:35:47
Comments
Leave a Comment

Please login to continue.