Skip to content

Commit f9797d0

Browse files
committed
Add Phaser.Scenes.Types.CreateSceneFromObjectConfig
1 parent 698fc7d commit f9797d0

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/core/typedefs/GameConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @property {HTMLCanvasElement} [canvas=null] - Provide your own Canvas element for Phaser to use instead of creating one.
1212
* @property {string} [canvasStyle=null] - CSS styles to apply to the game canvas instead of Phaser's default styles.
1313
* @property {CanvasRenderingContext2D} [context] - Provide your own Canvas Context for Phaser to use, instead of creating one.
14-
* @property {object} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have { active: true }.
14+
* @property {(Phaser.Scene|Phaser.Scene[]|Phaser.Scenes.Types.SettingsConfig|Phaser.Scenes.Types.SettingsConfig[]|Phaser.Scenes.Types.CreateSceneFromObjectConfig|Phaser.Scenes.Types.CreateSceneFromObjectConfig[]|function|function[])} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have `{ active: true }`. See the `sceneConfig` argument in {@link Phaser.Scenes.SceneManager#add}.
1515
* @property {string[]} [seed] - Seed for the random number generator.
1616
* @property {string} [title=''] - The title of the game. Shown in the browser console.
1717
* @property {string} [url='http://phaser.io'] - The URL of the game. Shown in the browser console.

src/scene/SceneManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ var SceneManager = new Class({
312312
* @since 3.0.0
313313
*
314314
* @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.
315-
* @param {(Phaser.Scene|Phaser.Scenes.Types.SettingsConfig|function)} sceneConfig - The config for the Scene
315+
* @param {(Phaser.Scene|Phaser.Scenes.Types.SettingsConfig|Phaser.Scenes.Types.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene
316316
* @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added.
317317
* @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`.
318318
*
@@ -710,7 +710,7 @@ var SceneManager = new Class({
710710
* @since 3.0.0
711711
*
712712
* @param {string} key - The key of the Scene.
713-
* @param {(string|Phaser.Scenes.Types.SettingsConfig)} sceneConfig - The Scene config.
713+
* @param {(string|Phaser.Scenes.Types.SettingsConfig|Phaser.Scenes.Types.CreateSceneFromObjectConfig)} sceneConfig - The Scene config.
714714
*
715715
* @return {Phaser.Scene} The created Scene.
716716
*/

src/scene/ScenePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ var ScenePlugin = new Class({
430430
* @since 3.0.0
431431
*
432432
* @param {string} key - The Scene key.
433-
* @param {(Phaser.Scene|Phaser.Scenes.Types.SettingsConfig|function)} sceneConfig - The config for the Scene.
433+
* @param {(Phaser.Scene|Phaser.Scenes.Types.SettingsConfig|Phaser.Scenes.Types.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene.
434434
* @param {boolean} autoStart - Whether to start the Scene after it's added.
435435
* @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`.
436436
*
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @typedef {object} Phaser.Scenes.Types.CreateSceneFromObjectConfig
3+
* @since 3.17.0
4+
*
5+
* @property {function} [init] - See {@link Phaser.Scene#init}.
6+
* @property {function} [preload] - See See {@link Phaser.Scene#preload}.
7+
* @property {function} [create] - See {@link Phaser.Scene#create}.
8+
* @property {function} [update] - See {@link Phaser.Scene#update}.
9+
* @property {any} [extend] - Any additional properties, which will be copied to the Scene after it's created (except `data` or `sys`).
10+
* @property {any} [extend.data] - Any values, which will be merged into the Scene's Data Manager store.
11+
*/

0 commit comments

Comments
 (0)