Phaser API Documentation

  Version: 
add(key, sceneConfig, autoStart, [data])

Description:

Add the Scene into the Scene Manager and start it if 'autoStart' is true or the Scene config 'active' property is set.

Parameters:

name type arguments description
key string

The Scene key.

sceneConfig function | Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig

The config for the Scene.

autoStart boolean

Whether to start the Scene after it's added.

data object <optional>

Optional data object. This will be set as Scene.settings.data and passed to Scene.init.

Returns:
Description:

An instance of the Scene that was added to the Scene Manager.

Type:
Since: 3.0.0
Source: src/scene/ScenePlugin.js (Line 430)