Documented the ScenePlugin class.

This commit is contained in:
Chris Andrew 2018-04-02 18:29:23 +01:00
parent 7eb0342663
commit e047977f52
2 changed files with 57 additions and 48 deletions

View file

@ -890,7 +890,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#sleep * @method Phaser.Scenes.SceneManager#sleep
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - The Scene to sleep. * @param {string} key - The Scene to put to sleep.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -935,7 +935,7 @@ var SceneManager = new Class({
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - The Scene to start. * @param {string} key - The Scene to start.
* @param {object} [data] - Scene config data. * @param {object} [data] - The Scene data.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -1091,7 +1091,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#bringToTop * @method Phaser.Scenes.SceneManager#bringToTop
* @since 3.0.0 * @since 3.0.0
* *
* @param {(string|Phaser.Scene)} key - The Scene to affect. * @param {(string|Phaser.Scene)} key - The Scene to move.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -1125,7 +1125,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#sendToBack * @method Phaser.Scenes.SceneManager#sendToBack
* @since 3.0.0 * @since 3.0.0
* *
* @param {(string|Phaser.Scene)} key - The Scene to affect. * @param {(string|Phaser.Scene)} key - The Scene to move.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -1157,7 +1157,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#moveDown * @method Phaser.Scenes.SceneManager#moveDown
* @since 3.0.0 * @since 3.0.0
* *
* @param {(string|Phaser.Scene)} key - The Scene to affect. * @param {(string|Phaser.Scene)} key - The Scene to move.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -1191,7 +1191,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#moveUp * @method Phaser.Scenes.SceneManager#moveUp
* @since 3.0.0 * @since 3.0.0
* *
* @param {(string|Phaser.Scene)} key - The Scene to affect. * @param {(string|Phaser.Scene)} key - The Scene to move.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */

View file

@ -17,7 +17,7 @@ var PluginManager = require('../boot/PluginManager');
* @constructor * @constructor
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.Scene} scene - [description] * @param {Phaser.Scene} scene - The Scene that this ScenePlugin belongs to.
*/ */
var ScenePlugin = new Class({ var ScenePlugin = new Class({
@ -26,7 +26,7 @@ var ScenePlugin = new Class({
function ScenePlugin (scene) function ScenePlugin (scene)
{ {
/** /**
* [description] * The Scene that this ScenePlugin belongs to.
* *
* @name Phaser.Scenes.ScenePlugin#scene * @name Phaser.Scenes.ScenePlugin#scene
* @type {Phaser.Scene} * @type {Phaser.Scene}
@ -35,7 +35,7 @@ var ScenePlugin = new Class({
this.scene = scene; this.scene = scene;
/** /**
* [description] * The Scene Systems instance of the Scene that this ScenePlugin belongs to.
* *
* @name Phaser.Scenes.ScenePlugin#systems * @name Phaser.Scenes.ScenePlugin#systems
* @type {Phaser.Scenes.Systems} * @type {Phaser.Scenes.Systems}
@ -49,7 +49,7 @@ var ScenePlugin = new Class({
} }
/** /**
* [description] * The settings of the Scene this ScenePlugin belongs to.
* *
* @name Phaser.Scenes.ScenePlugin#settings * @name Phaser.Scenes.ScenePlugin#settings
* @type {SettingsObject} * @type {SettingsObject}
@ -58,7 +58,7 @@ var ScenePlugin = new Class({
this.settings = scene.sys.settings; this.settings = scene.sys.settings;
/** /**
* [description] * The key of the Scene this ScenePlugin belongs to.
* *
* @name Phaser.Scenes.ScenePlugin#key * @name Phaser.Scenes.ScenePlugin#key
* @type {string} * @type {string}
@ -67,7 +67,7 @@ var ScenePlugin = new Class({
this.key = scene.sys.settings.key; this.key = scene.sys.settings.key;
/** /**
* [description] * The Game's SceneManager.
* *
* @name Phaser.Scenes.ScenePlugin#manager * @name Phaser.Scenes.ScenePlugin#manager
* @type {Phaser.Scenes.SceneManager} * @type {Phaser.Scenes.SceneManager}
@ -77,7 +77,9 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Boot the ScenePlugin.
*
* Registers event handlers.
* *
* @method Phaser.Scenes.ScenePlugin#boot * @method Phaser.Scenes.ScenePlugin#boot
* @since 3.0.0 * @since 3.0.0
@ -96,8 +98,8 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#start * @method Phaser.Scenes.ScenePlugin#start
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to start.
* @param {object} [data] - [description] * @param {object} [data] - The Scene data.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -125,9 +127,9 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#add * @method Phaser.Scenes.ScenePlugin#add
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene key.
* @param {object} sceneConfig - [description] * @param {(Phaser.Scene|SettingsConfig|function)} sceneConfig - The config for the Scene.
* @param {boolean} autoStart - [description] * @param {boolean} autoStart - Whether to start the Scene after it's added.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -144,8 +146,8 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#launch * @method Phaser.Scenes.ScenePlugin#launch
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to launch.
* @param {object} [data] - [description] * @param {object} [data] - The Scene data.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -172,7 +174,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#pause * @method Phaser.Scenes.ScenePlugin#pause
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to pause.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -191,7 +193,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#resume * @method Phaser.Scenes.ScenePlugin#resume
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to resume.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -210,7 +212,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#sleep * @method Phaser.Scenes.ScenePlugin#sleep
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to put to sleep.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -229,7 +231,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#wake * @method Phaser.Scenes.ScenePlugin#wake
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to wake up.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -248,7 +250,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#switch * @method Phaser.Scenes.ScenePlugin#switch
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to start.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -275,7 +277,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#stop * @method Phaser.Scenes.ScenePlugin#stop
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to stop.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -294,7 +296,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#setActive * @method Phaser.Scenes.ScenePlugin#setActive
* @since 3.0.0 * @since 3.0.0
* *
* @param {boolean} value - [description] * @param {boolean} value - The Scene to set the active state for.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -311,7 +313,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#setVisible * @method Phaser.Scenes.ScenePlugin#setVisible
* @since 3.0.0 * @since 3.0.0
* *
* @param {boolean} value - [description] * @param {boolean} value - The Scene to set the visible state for.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -328,9 +330,9 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#isSleeping * @method Phaser.Scenes.ScenePlugin#isSleeping
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to check.
* *
* @return {boolean} [description] * @return {boolean} Whether the Scene is sleeping.
*/ */
isSleeping: function (key) isSleeping: function (key)
{ {
@ -345,9 +347,9 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#isActive * @method Phaser.Scenes.ScenePlugin#isActive
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to check.
* *
* @return {boolean} [description] * @return {boolean} Whether the Scene is active.
*/ */
isActive: function (key) isActive: function (key)
{ {
@ -362,9 +364,9 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#isVisible * @method Phaser.Scenes.ScenePlugin#isVisible
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to check.
* *
* @return {boolean} [description] * @return {boolean} Whether the Scene is visible.
*/ */
isVisible: function (key) isVisible: function (key)
{ {
@ -375,6 +377,7 @@ var ScenePlugin = new Class({
/** /**
* Swaps the position of two scenes in the Scenes list. * Swaps the position of two scenes in the Scenes list.
*
* This controls the order in which they are rendered and updated. * This controls the order in which they are rendered and updated.
* *
* @method Phaser.Scenes.ScenePlugin#swapPosition * @method Phaser.Scenes.ScenePlugin#swapPosition
@ -399,6 +402,7 @@ var ScenePlugin = new Class({
/** /**
* Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A. * Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A.
*
* This controls the order in which they are rendered and updated. * This controls the order in which they are rendered and updated.
* *
* @method Phaser.Scenes.ScenePlugin#moveAbove * @method Phaser.Scenes.ScenePlugin#moveAbove
@ -423,6 +427,7 @@ var ScenePlugin = new Class({
/** /**
* Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A. * Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A.
*
* This controls the order in which they are rendered and updated. * This controls the order in which they are rendered and updated.
* *
* @method Phaser.Scenes.ScenePlugin#moveBelow * @method Phaser.Scenes.ScenePlugin#moveBelow
@ -457,7 +462,7 @@ var ScenePlugin = new Class({
* @method Phaser.Scenes.ScenePlugin#remove * @method Phaser.Scenes.ScenePlugin#remove
* @since 3.2.0 * @since 3.2.0
* *
* @param {(string|Phaser.Scene)} scene - The Scene to be removed. * @param {(string|Phaser.Scene)} key - The Scene to be removed.
* *
* @return {Phaser.Scenes.SceneManager} This SceneManager. * @return {Phaser.Scenes.SceneManager} This SceneManager.
*/ */
@ -471,12 +476,12 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Moves a Scene up one position in the Scenes list.
* *
* @method Phaser.Scenes.ScenePlugin#moveUp * @method Phaser.Scenes.ScenePlugin#moveUp
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to move.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -490,12 +495,12 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Moves a Scene down one position in the Scenes list.
* *
* @method Phaser.Scenes.ScenePlugin#moveDown * @method Phaser.Scenes.ScenePlugin#moveDown
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to move.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -509,12 +514,14 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Brings a Scene to the top of the Scenes list.
*
* This means it will render above all other Scenes.
* *
* @method Phaser.Scenes.ScenePlugin#bringToTop * @method Phaser.Scenes.ScenePlugin#bringToTop
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to move.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -528,12 +535,14 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Sends a Scene to the back of the Scenes list.
*
* This means it will render below all other Scenes.
* *
* @method Phaser.Scenes.ScenePlugin#sendToBack * @method Phaser.Scenes.ScenePlugin#sendToBack
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to move.
* *
* @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.
*/ */
@ -547,14 +556,14 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Retrieve a Scene.
* *
* @method Phaser.Scenes.ScenePlugin#get * @method Phaser.Scenes.ScenePlugin#get
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The Scene to retrieve.
* *
* @return {Phaser.Scene} [description] * @return {Phaser.Scene} The Scene.
*/ */
get: function (key) get: function (key)
{ {
@ -562,7 +571,7 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Shut down the given Scene.
* *
* @method Phaser.Scenes.ScenePlugin#shutdown * @method Phaser.Scenes.ScenePlugin#shutdown
* @since 3.0.0 * @since 3.0.0
@ -573,7 +582,7 @@ var ScenePlugin = new Class({
}, },
/** /**
* [description] * Destroy the given Scene.
* *
* @method Phaser.Scenes.ScenePlugin#destroy * @method Phaser.Scenes.ScenePlugin#destroy
* @since 3.0.0 * @since 3.0.0