Phaser API Documentation

  Version: 
create(config)

Description:

Creates a new Animation and adds it to the Animation Manager.

Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific.

If an invalid key is given this method will return false.

If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned.

A brand new animation is only created if the key is valid and not already in use.

If you wish to re-use an existing key, call AnimationManager.remove first, then this method.

Parameters:

name type description
config Phaser.Types.Animations.Animation

The configuration settings for the Animation.

Returns:
Description:

The Animation that was created, or false if the key is already in use.

Since: 3.0.0