|
1 | 1 | var Scene = require('../../local/Scene'); |
2 | 2 |
|
3 | 3 | /** |
4 | | -* Adds a new Scene into the GlobalSceneManager. You must give each Scene a unique key by which you'll identify it. |
5 | | -* The Scene can be either a Phaser.Scene object (or an object that extends it), a plain JavaScript object or a function. |
6 | | -* If a function is given a new scene object will be created by calling it. |
7 | | -* |
8 | | -* @param {string} key - A unique key you use to reference this scene, i.e. "MainMenu", "Level1". |
9 | | -* @param {Phaser.Scene|object|function} scene - The scene you want to switch to. |
10 | | -* @param {boolean} [autoStart=false] - If true the Scene will be started immediately after adding it. |
11 | | -*/ |
| 4 | + * Adds a new Scene into the SceneManager. |
| 5 | + * You must give each Scene a unique key by which you'll identify it. |
| 6 | + * |
| 7 | + * The `sceneConfig` can be: |
| 8 | + * |
| 9 | + * * A `Phaser.Scene` object, or an object that extends it. |
| 10 | + * * A plain JavaScript object |
| 11 | + * * A JavaScript ES6 Class that extends `Phaser.Scene` |
| 12 | + * * A JavaScript ES5 prototype based Class |
| 13 | + * * A JavaScript function |
| 14 | + * |
| 15 | + * If a function is given then a new Scene will be created by calling it. |
| 16 | + * |
| 17 | + * @method Phaser.Scenes.GlobalSceneManager#add |
| 18 | + * @since 3.0.0 |
| 19 | + * |
| 20 | + * @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`. |
| 21 | + * @param {Phaser.Scene|object|function} sceneConfig - [description] |
| 22 | + * @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added. |
| 23 | + * |
| 24 | + * @return {Phaser.Scene} [description] |
| 25 | + */ |
12 | 26 | var Add = function (key, sceneConfig, autoStart) |
13 | 27 | { |
14 | 28 | if (autoStart === undefined) { autoStart = false; } |
|
0 commit comments