Phaser API Documentation

  Version: 

Member of: Phaser.Actions

<static> PlayAnimation(items, key, [ignoreIfPlaying])

Description:

Play an animation on all Game Objects in the array that have an Animation component.

You can pass either an animation key, or an animation configuration object for more control over the playback.

Parameters:

name type arguments Default description
items array | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects. The contents of this array are updated by this Action.

key string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig

The string-based key of the animation to play, or an Animation instance, or a PlayAnimationConfig object.

ignoreIfPlaying boolean <optional> false

If this animation is already playing then ignore this call.

Returns:
Description:

The array of Game Objects that was passed to this Action.

Type:
Examples:
Since: 3.0.0