mirror of
https://github.com/wassname/phaser.git
synced 2026-08-03 13:10:25 +08:00
More docs.
This commit is contained in:
+26
-24
@@ -2,16 +2,15 @@
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2013 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
* @module Phaser.StateManager
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* The State Manager is responsible for loading, setting up and switching game states.
|
||||
*
|
||||
* @class Phaser.StateManager
|
||||
* @constructor
|
||||
* @param {Phaser.Game} game - A reference to the currently running game.
|
||||
* @param {Description} pendingState - Description.
|
||||
* @param {Phaser.State|Object} [pendingState=null] - A State object to seed the manager with.
|
||||
*/
|
||||
Phaser.StateManager = function (game, pendingState) {
|
||||
|
||||
@@ -130,7 +129,8 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method boot
|
||||
* @method Phaser.StateManager#boot
|
||||
* @private
|
||||
*/
|
||||
boot: function () {
|
||||
|
||||
@@ -157,7 +157,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Add a new State.
|
||||
* @method add
|
||||
* @method Phaser.StateManager#add
|
||||
* @param key {string} - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
|
||||
* @param state {State} - The state you want to switch to.
|
||||
* @param autoStart {boolean} - Start the state immediately after creating it? (default true)
|
||||
@@ -211,7 +211,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Delete the given state.
|
||||
* @method remove
|
||||
* @method Phaser.StateManager#remove
|
||||
* @param {string} key - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
|
||||
*/
|
||||
remove: function (key) {
|
||||
@@ -239,7 +239,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Start the given state
|
||||
* @method start
|
||||
* @method Phaser.StateManager#start
|
||||
* @param {string} key - The key of the state you want to start.
|
||||
* @param {boolean} [clearWorld] - clear everything in the world? (Default to true)
|
||||
* @param {boolean} [clearCache] - clear asset cache? (Default to false and ONLY available when clearWorld=true)
|
||||
@@ -317,7 +317,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Used by onInit and onShutdown when those functions don't exist on the state
|
||||
* @method dummy
|
||||
* @method Phaser.StateManager#dummy
|
||||
* @private
|
||||
*/
|
||||
dummy: function () {
|
||||
@@ -325,7 +325,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method checkState
|
||||
* @method Phaser.StateManager#checkState
|
||||
* @param {string} key - The key of the state you want to check.
|
||||
* @return {boolean} Description.
|
||||
*/
|
||||
@@ -362,9 +362,10 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method link
|
||||
* @param {string} key - Description.
|
||||
* Links game properties to the State given by the key.
|
||||
* @method Phaser.StateManager#link
|
||||
* @param {string} key - State key.
|
||||
* @protected
|
||||
*/
|
||||
link: function (key) {
|
||||
|
||||
@@ -388,9 +389,10 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method setCurrentState
|
||||
* @param {string} key - Description.
|
||||
* Sets the current State. Should not be called directly (use StateManager.start)
|
||||
* @method Phaser.StateManager#setCurrentState
|
||||
* @param {string} key - State key.
|
||||
* @protected
|
||||
*/
|
||||
setCurrentState: function (key) {
|
||||
|
||||
@@ -421,8 +423,8 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method loadComplete
|
||||
* @method Phaser.StateManager#loadComplete
|
||||
* @protected
|
||||
*/
|
||||
loadComplete: function () {
|
||||
|
||||
@@ -442,8 +444,8 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method update
|
||||
* @method Phaser.StateManager#update
|
||||
* @protected
|
||||
*/
|
||||
update: function () {
|
||||
|
||||
@@ -462,8 +464,8 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method preRender
|
||||
* @method Phaser.StateManager#preRender
|
||||
* @protected
|
||||
*/
|
||||
preRender: function () {
|
||||
|
||||
@@ -475,8 +477,8 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Description.
|
||||
* @method render
|
||||
* @method Phaser.StateManager#render
|
||||
* @protected
|
||||
*/
|
||||
render: function () {
|
||||
|
||||
@@ -496,7 +498,7 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
/**
|
||||
* Nuke the entire game from orbit
|
||||
* @method destroy
|
||||
* @method Phaser.StateManager#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user