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 Default description
key string

A unique key used to reference the Scene, i.e. MainMenu or Level1.

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

The config for the Scene

autoStart boolean <optional> false

If true the Scene will be started immediately after being added.

data object <optional>

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

Returns:
Description:

The added Scene, if it was added immediately, otherwise null.

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