From 6ce6330f50a9e368e9142f9a5d571147d34ab2e3 Mon Sep 17 00:00:00 2001
From: Richard Davey
Date: Wed, 2 Oct 2013 11:22:20 +0100
Subject: [PATCH] More docs.
---
Docs/conf.json | 3 +-
Docs/out/Animation.js.html | 2 +-
Docs/out/AnimationManager.js.html | 2 +-
Docs/out/Camera.js.html | 2 +-
Docs/out/Frame.js.html | 2 +-
Docs/out/FrameData.js.html | 2 +-
Docs/out/Game.js.html | 2 +-
Docs/out/Group.js.html | 164 ++++---
Docs/out/Parser.js.html | 2 +-
Docs/out/Phaser.Animation.Frame.html | 2 +-
Docs/out/Phaser.Animation.FrameData.html | 2 +-
Docs/out/Phaser.Animation.Parser.html | 2 +-
Docs/out/Phaser.Animation.html | 2 +-
Docs/out/Phaser.AnimationManager.html | 2 +-
Docs/out/Phaser.Camera.html | 2 +-
Docs/out/Phaser.Game.html | 2 +-
Docs/out/Phaser.Group.html | 597 ++++++++++++++++-------
Docs/out/Phaser.js.html | 2 +-
Docs/out/classes.list.html | 2 +-
Docs/out/index.html | 177 ++-----
Docs/out/module-Phaser.html | 2 +-
Docs/out/modules.list.html | 2 +-
Docs/out/scripts/prettify/lang-css.js | 23 +-
Docs/out/scripts/prettify/prettify.js | 524 ++------------------
README.md | 2 +
examples/collision/sprite tiles.php | 84 ++++
src/core/LinkedList.js | 143 ++----
src/core/Plugin.js | 37 +-
src/core/PluginManager.js | 37 +-
src/core/Signal.js | 67 ++-
src/core/SignalBinding.js | 18 +-
src/utils/Debug.js | 81 ++-
32 files changed, 883 insertions(+), 1110 deletions(-)
create mode 100644 examples/collision/sprite tiles.php
diff --git a/Docs/conf.json b/Docs/conf.json
index 323aac3a..b955f215 100644
--- a/Docs/conf.json
+++ b/Docs/conf.json
@@ -3,8 +3,7 @@
"allowUnknownTags": true
},
"source": {
- "Xinclude": [ "../src/Phaser.js", "../src/animation/", "../src/core/Camera.js", "../src/core/Game.js", "../src/core/Group.js", "../src/core/LinkedList.js", "../src/core/Plugin.js", "../src/core/PluginManager.js" ],
- "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/Camera.js", "../src/core/Game.js", "../src/core/Group.js" ],
+ "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/Camera.js", "../src/core/Game.js", "../src/core/Group.js", "../src/core/LinkedList.js", "../src/core/Plugin.js", "../src/core/PluginManager.js", "../src/core/Signal.js", "../src/core/SignalBinding.js" ],
"exclude": [],
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
diff --git a/Docs/out/Animation.js.html b/Docs/out/Animation.js.html
index 8d6ad6a1..d1a4a2a6 100644
--- a/Docs/out/Animation.js.html
+++ b/Docs/out/Animation.js.html
@@ -538,7 +538,7 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/AnimationManager.js.html b/Docs/out/AnimationManager.js.html
index 4ab46b86..986ad3a5 100644
--- a/Docs/out/AnimationManager.js.html
+++ b/Docs/out/AnimationManager.js.html
@@ -486,7 +486,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Camera.js.html b/Docs/out/Camera.js.html
index 5623cac1..4a05f29a 100644
--- a/Docs/out/Camera.js.html
+++ b/Docs/out/Camera.js.html
@@ -468,7 +468,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Frame.js.html b/Docs/out/Frame.js.html
index fa8e97ac..ddd088ed 100644
--- a/Docs/out/Frame.js.html
+++ b/Docs/out/Frame.js.html
@@ -276,7 +276,7 @@ Phaser.Animation.Frame.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/FrameData.js.html b/Docs/out/FrameData.js.html
index 09272e68..cb183bc8 100644
--- a/Docs/out/FrameData.js.html
+++ b/Docs/out/FrameData.js.html
@@ -349,7 +349,7 @@ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Game.js.html b/Docs/out/Game.js.html
index fba79258..f253b61b 100644
--- a/Docs/out/Game.js.html
+++ b/Docs/out/Game.js.html
@@ -591,7 +591,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Group.js.html b/Docs/out/Group.js.html
index b089fae0..70a2b016 100644
--- a/Docs/out/Group.js.html
+++ b/Docs/out/Group.js.html
@@ -107,9 +107,9 @@
* @classdesc A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
-* @param {Description} parent - Description.
-* @param {string} name - The unique name for this animation, used in playback commands.
-* @param {boolean} useStage - Description.
+* @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
+* @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging.
+* @param {boolean} [useStage=false] - Only the root World Group should use this value.
*/
Phaser.Group = function (game, parent, name, useStage) {
@@ -126,7 +126,7 @@ Phaser.Group = function (game, parent, name, useStage) {
this.game = game;
/**
- * @property {Phaser.Game} name - Description.
+ * @property {string} name - A name for this Group. Not used internally but useful for debugging.
*/
this.name = name || 'group';
@@ -157,33 +157,31 @@ Phaser.Group = function (game, parent, name, useStage) {
}
/**
- * @property {Description} type - Description.
+ * @property {number} type - Internal Phaser Type value.
+ * @protected
*/
this.type = Phaser.GROUP;
/**
- * @property {boolean} exists - Description.
+ * @property {boolean} exists - If exists is true the the Group is updated, otherwise it is skipped.
* @default
*/
this.exists = true;
-
- /**
- * @property {string} _sortIndex - Helper for sort.
- * @private
- * @default
- */
- this._sortIndex = 'y';
};
Phaser.Group.prototype = {
/**
- * Description.
+ * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+ * The child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control
+ * that then see the addAt method.
*
+ * @see Phaser.Group#create
+ * @see Phaser.Group#addAt
* @method Phaser.Group#add
- * @param {Description} child - Description.
- * @return {Description} Description.
+ * @param {*} child - An instance of Phaser.Sprite, Phaser.Button or any other display object..
+ * @return {*} The child that was added to the Group.
*/
add: function (child) {
@@ -204,12 +202,13 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+ * The child is added to the Group at the location specified by the index value, this allows you to control child ordering.
*
* @method Phaser.Group#addAt
- * @param {Description} child - Description.
- * @param {Description} index - Description.
- * @return {Description} Description.
+ * @param {*} child - An instance of Phaser.Sprite, Phaser.Button or any other display object..
+ * @param {number} index - The index within the Group to insert the child to.
+ * @return {*} The child that was added to the Group.
*/
addAt: function (child, index) {
@@ -230,12 +229,12 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Returns the child found at the given index within this Group.
*
* @method Phaser.Group#getAt
* @memberof Phaser.Group
- * @param {Description} index - Description.
- * @return {Description} Description.
+ * @param {number} index - The index to return the child from.
+ * @return {*} The child that was found at the given index.
*/
getAt: function (index) {
@@ -244,15 +243,16 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Automatically creates a new Phaser.Sprite object and adds it to the top of this Group.
+ * Useful if you don't need to create the Sprite instances before-hand.
*
* @method Phaser.Group#create
- * @param {number} x - Description.
- * @param {number} y - Description.
- * @param {string} key - Description.
- * @param {string} [frame] - Description.
- * @param {boolean} [exists] - Description.
- * @return {Description} Description.
+ * @param {number} x - The x coordinate to display the newly created Sprite at. The value is in relation to the Group.x point.
+ * @param {number} y - The y coordinate to display the newly created Sprite at. The value is in relation to the Group.y point.
+ * @param {string} key - The Game.cache key of the image that this Sprite will use.
+ * @param {number|string} [frame] - If the Sprite image contains multiple frames you can specify which one to use here.
+ * @param {boolean} [exists] - The default exists state of the Sprite.
+ * @return {Phaser.Sprite} The child that was created.
*/
create: function (x, y, key, frame, exists) {
@@ -275,12 +275,12 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Swaps the position of two children in this Group.
*
* @method Phaser.Group#swap
- * @param {Description} child1 - Description.
- * @param {Description} child2 - Description.
- * @return {boolean} Description.
+ * @param {*} child1 - The first child to swap.
+ * @param {*} child2 - The second child to swap.
+ * @return {boolean} True if the swap was successful, otherwise false.
*/
swap: function (child1, child2) {
@@ -403,11 +403,11 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Brings the given child to the top of this Group so it renders above all other children.
*
* @method Phaser.Group#bringToTop
- * @param {Description} child - Description.
- * @return {Description} Description.
+ * @param {*} child - The child to bring to the top of this Group.
+ * @return {*} The child that was moved.
*/
bringToTop: function (child) {
@@ -422,11 +422,11 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Get the index position of the given child in this Group.
*
* @method Phaser.Group#getIndex
- * @param {Description} child - Description.
- * @return {Description} Description.
+ * @param {*} child - The child to get the index for.
+ * @return {number} The index of the child or -1 if it's not a member of this Group.
*/
getIndex: function (child) {
@@ -435,11 +435,11 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group.
*
* @method Phaser.Group#replace
- * @param {Description} oldChild - Description.
- * @param {Description} newChild - Description.
+ * @param {*} oldChild - The child in this Group that will be replaced.
+ * @param {*} newChild - The child to be inserted into this group.
*/
replace: function (oldChild, newChild) {
@@ -466,14 +466,13 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Sets the given property to the given value on the child. The operation controls the assignment of the value.
*
* @method Phaser.Group#setProperty
- * @param {Description} child - Description.
- * @param {array} key - An array of values that will be set.
- * @param {Description} value - Description.
- * @param {Description} operation - Description.
- * @return {number} An integer value: -1 (Obj1 before Obj2), 0 (same), or 1 (Obj1 after Obj2). (TODO)
+ * @param {*} child - The child to set the property value on.
+ * @param {array} key - An array of strings that make up the property that will be set.
+ * @param {*} value - The value that will be set.
+ * @param {number} [operation=0] - Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
*/
setProperty: function (child, key, value, operation) {
@@ -529,14 +528,15 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * This function allows you to quickly set the same property across all children of this Group to a new value.
+ * The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
*
* @method Phaser.Group#setAll
- * @param {Description} key - Description.
- * @param {Description} value - Description.
- * @param {Description} checkAlive - Description.
- * @param {Description} checkVisible - Description.
- * @param {Description} operation - Description.
+ * @param {string} key - The property, as a string, to be set. For example: 'body.velocity.x'
+ * @param {*} value - The value that will be set.
+ * @param {boolean} [checkAlive=false] - If set then only children with alive=true will be updated.
+ * @param {boolean} [checkVisible=false] - If set then only children with visible=true will be updated.
+ * @param {number} [operation=0] - Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
*/
setAll: function (key, value, checkAlive, checkVisible, operation) {
@@ -693,13 +693,14 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run.
* After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
+ * For example: Group.forEach(awardBonusGold, this, true, 100, 500)
*
* @method Phaser.Group#forEach
- * @param {Description} callback - Description.
- * @param {Description} callbackContext - Description.
- * @param {boolean} checkExists - Description.
+ * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter.
+ * @param {Object} callbackContext - The context in which the function should be called (usually 'this').
+ * @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed.
*/
forEach: function (callback, callbackContext, checkExists) {
@@ -732,11 +733,13 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run.
+ * You can add as many parameters as you like, which will all be passed to the callback along with the child.
+ * For example: Group.forEachAlive(causeDamage, this, 500)
*
* @method Phaser.Group#forEachAlive
- * @param {Description} callback - Description.
- * @param {Description} callbackContext - Description.
+ * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter.
+ * @param {Object} callbackContext - The context in which the function should be called (usually 'this').
*/
forEachAlive: function (callback, callbackContext) {
@@ -764,11 +767,13 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run.
+ * You can add as many parameters as you like, which will all be passed to the callback along with the child.
+ * For example: Group.forEachDead(bringToLife, this)
*
* @method Phaser.Group#forEachDead
- * @param {Description} callback - Description.
- * @param {Description} callbackContext - Description.
+ * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter.
+ * @param {Object} callbackContext - The context in which the function should be called (usually 'this').
*/
forEachDead: function (callback, callbackContext) {
@@ -795,10 +800,10 @@ Phaser.Group.prototype = {
},
/**
- * Call this function to retrieve the first object with exists == (the given state) in the group.
+ * Call this function to retrieve the first object with exists == (the given state) in the Group.
*
* @method Phaser.Group#getFirstExists
- * @param {Description} state - Description.
+ * @param {boolean} state - True or false.
* @return {Any} The first child, or null if none found.
*/
getFirstExists: function (state) {
@@ -830,7 +835,7 @@ Phaser.Group.prototype = {
/**
* Call this function to retrieve the first object with alive == true in the group.
- * This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
+ * This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
*
* @method Phaser.Group#getFirstAlive
* @return {Any} The first alive child, or null if none found.
@@ -859,7 +864,7 @@ Phaser.Group.prototype = {
/**
* Call this function to retrieve the first object with alive == false in the group.
- * This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
+ * This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
*
* @method Phaser.Group#getFirstDead
* @return {Any} The first dead child, or null if none found.
@@ -969,10 +974,10 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Removes the given child from this Group and sets its group property to null.
*
* @method Phaser.Group#remove
- * @param {Description} child - Description.
+ * @param {Any} child - The child to remove.
*/
remove: function (child) {
@@ -983,7 +988,8 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Removes all children from this Group, setting all group properties to null.
+ * The Group container remains on the display list.
*
* @method Phaser.Group#removeAll
*/
@@ -1007,11 +1013,11 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Removes all children from this Group whos index falls beteen the given startIndex and endIndex values.
*
* @method Phaser.Group#removeBetween
- * @param {Description} startIndex - Description.
- * @param {Description} endIndex - Description.
+ * @param {number} startIndex - The index to start removing children from.
+ * @param {number} endIndex - The index to stop removing children from. Must be higher than startIndex and less than the length of the Group.
*/
removeBetween: function (startIndex, endIndex) {
@@ -1035,7 +1041,7 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Destroys this Group. Removes all children, then removes the container from the display list and nulls references.
*
* @method Phaser.Group#destroy
*/
@@ -1054,9 +1060,10 @@ Phaser.Group.prototype = {
},
/**
- * Description.
+ * Dumps out a list of Group children and their index positions to the browser console. Useful for group debugging.
*
* @method Phaser.Group#dump
+ * @param {boolean} [full=false] - If full the dump will include the entire display list, start from the Stage. Otherwise it will only include this container.
*/
dump: function (full) {
@@ -1144,7 +1151,6 @@ Phaser.Group.prototype = {
};
-
/**
* @name Phaser.Group#length
* @property {number} length - The number of children in this Group.
@@ -1265,7 +1271,7 @@ Object.defineProperty(Phaser.Group.prototype, "visible", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Parser.js.html b/Docs/out/Parser.js.html
index d0eb6bc5..0413b43e 100644
--- a/Docs/out/Parser.js.html
+++ b/Docs/out/Parser.js.html
@@ -434,7 +434,7 @@ Phaser.Animation.Parser = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Frame.html b/Docs/out/Phaser.Animation.Frame.html
index 8ba6007a..ab4526f8 100644
--- a/Docs/out/Phaser.Animation.Frame.html
+++ b/Docs/out/Phaser.Animation.Frame.html
@@ -2628,7 +2628,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.FrameData.html b/Docs/out/Phaser.Animation.FrameData.html
index e9385f1f..650430a1 100644
--- a/Docs/out/Phaser.Animation.FrameData.html
+++ b/Docs/out/Phaser.Animation.FrameData.html
@@ -1575,7 +1575,7 @@ The frames are returned in the output array, or if none is provided in a new Arr
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Parser.html b/Docs/out/Phaser.Animation.Parser.html
index 2f09abd8..cfe17a43 100644
--- a/Docs/out/Phaser.Animation.Parser.html
+++ b/Docs/out/Phaser.Animation.Parser.html
@@ -1082,7 +1082,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.html b/Docs/out/Phaser.Animation.html
index 806e9ca4..5754fa3b 100644
--- a/Docs/out/Phaser.Animation.html
+++ b/Docs/out/Phaser.Animation.html
@@ -2459,7 +2459,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.AnimationManager.html b/Docs/out/Phaser.AnimationManager.html
index 5adf1b89..abbd306d 100644
--- a/Docs/out/Phaser.AnimationManager.html
+++ b/Docs/out/Phaser.AnimationManager.html
@@ -2283,7 +2283,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Camera.html b/Docs/out/Phaser.Camera.html
index 5ac3591d..a6e429bd 100644
--- a/Docs/out/Phaser.Camera.html
+++ b/Docs/out/Phaser.Camera.html
@@ -2710,7 +2710,7 @@ without having to use game.camera.x and game.camera.y.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Game.html b/Docs/out/Phaser.Game.html
index 4d7b47c3..184e7781 100644
--- a/Docs/out/Phaser.Game.html
+++ b/Docs/out/Phaser.Game.html
@@ -4147,7 +4147,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Group.html b/Docs/out/Phaser.Group.html
index 001b51b7..dd422aea 100644
--- a/Docs/out/Phaser.Group.html
+++ b/Docs/out/Phaser.Group.html
@@ -110,7 +110,7 @@
-
new Group(game, parent, name, useStage)
+
new Group(game, parent, name, useStage)
@@ -140,8 +140,12 @@
Type
+
Argument
+
+
Default
+
Description
@@ -165,7 +169,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
A reference to the currently running game.
@@ -181,17 +197,29 @@
-Description
+*
+
+
+
+
+
+
-
Description.
+
+
+
+
+
+
+
The parent Group or DisplayObjectContainer that will hold this group, if any.
@@ -211,10 +239,26 @@
+
+
+ <optional>
+
+
+
+
+
-
The unique name for this animation, used in playback commands.
+
+
+
+ group
+
+
+
+
+
A name for this Group. Not used internally but useful for debugging.
@@ -234,10 +278,26 @@
+
+
+ <optional>
+
+
+
+
+
-
Description.
+
+
+
+ false
+
+
+
+
+
Only the root World Group should use this value.
@@ -402,7 +462,7 @@ This will have no impact on the rotation value of its children, but it will upda
@@ -1362,7 +1422,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-
add(child) → {Description}
+
add(child) → {*}
@@ -1370,7 +1430,9 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-
Description.
+
Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+The child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control
+that then see the addAt method.
@@ -1410,7 +1472,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-Description
+*
@@ -1420,7 +1482,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-
Description.
+
An instance of Phaser.Sprite, Phaser.Button or any other display object..
@@ -1452,13 +1514,22 @@ This will have no impact on the x/y coordinates of its children, but it will upd
@@ -1477,7 +1548,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-
Description.
+
The child that was added to the Group.
@@ -1488,7 +1559,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
-Description
+*
@@ -1691,7 +1762,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-
addAt(child, index) → {Description}
+
addAt(child, index) → {*}
@@ -1699,7 +1770,8 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-
Description.
+
Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+The child is added to the Group at the location specified by the index value, this allows you to control child ordering.
@@ -1739,7 +1811,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-Description
+*
@@ -1749,7 +1821,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-
Description.
+
An instance of Phaser.Sprite, Phaser.Button or any other display object..
@@ -1762,7 +1834,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-Description
+number
@@ -1772,7 +1844,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
-
Description.
+
The index within the Group to insert the child to.
@@ -1804,7 +1876,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.
@@ -2535,7 +2607,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
create(x, y, key, frame, exists) → {Description}
+
create(x, y, key, frame, exists) → {Phaser.Sprite}
@@ -2543,7 +2615,8 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
Automatically creates a new Phaser.Sprite object and adds it to the top of this Group.
+Useful if you don't need to create the Sprite instances before-hand.
@@ -2603,7 +2676,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
The x coordinate to display the newly created Sprite at. The value is in relation to the Group.x point.
@@ -2634,7 +2707,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
The y coordinate to display the newly created Sprite at. The value is in relation to the Group.y point.
@@ -2665,7 +2738,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
The Game.cache key of the image that this Sprite will use.
@@ -2678,6 +2751,9 @@ After the existsValue parameter you can add as many parameters as you like, whic
+number
+|
+
string
@@ -2698,7 +2774,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
If the Sprite image contains multiple frames you can specify which one to use here.
@@ -2731,7 +2807,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
-
Description.
+
The default exists state of the Sprite.
@@ -2763,7 +2839,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
@@ -3148,8 +3293,9 @@ Group.divideAll('x', 2) will half the child.x value.
-
Description.
-After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
+
Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run.
+After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEach(awardBonusGold, this, true, 100, 500)
@@ -3189,7 +3335,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+function
@@ -3199,7 +3345,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
@@ -3212,7 +3358,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+Object
@@ -3222,7 +3368,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The context in which the function should be called (usually 'this').
@@ -3245,7 +3391,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
If set only children with exists=true will be passed to the callback, otherwise all children will be passed.
@@ -3313,7 +3459,9 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run.
+You can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEachAlive(causeDamage, this, 500)
@@ -3353,7 +3501,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+function
@@ -3363,7 +3511,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
@@ -3376,7 +3524,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+Object
@@ -3386,7 +3534,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The context in which the function should be called (usually 'this').
@@ -3418,7 +3566,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
@@ -3454,7 +3602,9 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run.
+You can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEachDead(bringToLife, this)
@@ -3494,7 +3644,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+function
@@ -3504,7 +3654,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
@@ -3517,7 +3667,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+Object
@@ -3527,7 +3677,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The context in which the function should be called (usually 'this').
@@ -3559,7 +3709,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
@@ -3702,7 +3852,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-
Description.
+
The child that was found at the given index.
@@ -3713,7 +3863,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
-Description
+*
@@ -3737,7 +3887,7 @@ After the checkExists parameter you can add as many parameters as you like, whic
Call this function to retrieve the first object with alive == true in the group.
-This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
+This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
@@ -3770,7 +3920,7 @@ This is handy for checking if everything's wiped out, or choosing a squad leader
@@ -3830,7 +3980,7 @@ This is handy for checking if everything's wiped out, or choosing a squad leader
Call this function to retrieve the first object with alive == false in the group.
-This is handy for checking if everything's wiped out, or choosing a squad leader, etc.
+This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
@@ -3863,7 +4013,7 @@ This is handy for checking if everything's wiped out, or choosing a squad leader
@@ -5025,7 +5176,8 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-
Description.
+
This function allows you to quickly set the same property across all children of this Group to a new value.
+The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
@@ -5047,8 +5199,12 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
Type
+
Argument
+
+
Default
+
Description
@@ -5065,17 +5221,29 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+string
+
+
+
+
+
+
-
Description.
+
+
+
+
+
+
+
The property, as a string, to be set. For example: 'body.velocity.x'
@@ -5088,17 +5256,29 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+*
+
+
+
+
+
+
-
Description.
+
+
+
+
+
+
+
The value that will be set.
@@ -5111,17 +5291,33 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+boolean
+
+
+ <optional>
+
+
+
+
+
-
Description.
+
+
+
+ false
+
+
+
+
+
If set then only children with alive=true will be updated.
@@ -5134,17 +5330,33 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+boolean
+
+
+ <optional>
+
+
+
+
+
-
Description.
+
+
+
+ false
+
+
+
+
+
If set then only children with visible=true will be updated.
@@ -5157,17 +5369,33 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+number
+
+
+ <optional>
+
+
+
+
+
-
Description.
+
+
+
+ 0
+
+
+
+
+
Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
@@ -5199,7 +5427,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
@@ -5235,7 +5463,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-
Description.
+
Sets the given property to the given value on the child. The operation controls the assignment of the value.
@@ -5257,8 +5485,12 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
Type
+
Argument
+
+
Default
+
Description
@@ -5275,17 +5507,29 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+*
+
+
+
+
+
+
-
Description.
+
+
+
+
+
+
+
The child to set the property value on.
@@ -5305,10 +5549,22 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
+
+
+
+
+
+
-
An array of values that will be set.
+
+
+
+
+
+
+
An array of strings that make up the property that will be set.
@@ -5321,17 +5577,29 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+*
+
+
+
+
+
+
-
Description.
+
+
+
+
+
+
+
The value that will be set.
@@ -5344,17 +5612,33 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-Description
+number
+
+
+ <optional>
+
+
+
+
+
-
Description.
+
+
+
+ 0
+
+
+
+
+
Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
@@ -5407,29 +5691,6 @@ Group.multiplyAll('x', 2) will x2 the child.x value.
-
Returns:
-
-
-
-
An integer value: -1 (Obj1 before Obj2), 0 (same), or 1 (Obj1 after Obj2). (TODO)
-
-
-
-
-
-
- Type
-
-
-
-number
-
-
-
-
-
-
-
@@ -5633,7 +5894,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-
Description.
+
Swaps the position of two children in this Group.
@@ -5673,7 +5934,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-Description
+*
@@ -5683,7 +5944,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-
Description.
+
The first child to swap.
@@ -5696,7 +5957,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-Description
+*
@@ -5706,7 +5967,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-
Description.
+
The second child to swap.
@@ -5763,7 +6024,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
-
Description.
+
True if the swap was successful, otherwise false.
@@ -5812,7 +6073,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.js.html b/Docs/out/Phaser.js.html
index 71af44be..dc6f169a 100644
--- a/Docs/out/Phaser.js.html
+++ b/Docs/out/Phaser.js.html
@@ -157,7 +157,7 @@ PIXI.InteractionManager = function (dummy) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/classes.list.html b/Docs/out/classes.list.html
index e9b6fe4a..56191375 100644
--- a/Docs/out/classes.list.html
+++ b/Docs/out/classes.list.html
@@ -207,7 +207,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/index.html b/Docs/out/index.html
index b4583c83..20e12546 100644
--- a/Docs/out/index.html
+++ b/Docs/out/index.html
@@ -1,100 +1,31 @@
-
-
- Phaser Index
-
-
-
-
-
-
-
+
+ JSDoc: Index
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Docs/out/module-Phaser.html b/Docs/out/module-Phaser.html
index 830437dc..513f05e0 100644
--- a/Docs/out/module-Phaser.html
+++ b/Docs/out/module-Phaser.html
@@ -184,7 +184,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/modules.list.html b/Docs/out/modules.list.html
index b91f6c2d..8b76d781 100644
--- a/Docs/out/modules.list.html
+++ b/Docs/out/modules.list.html
@@ -207,7 +207,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/scripts/prettify/lang-css.js b/Docs/out/scripts/prettify/lang-css.js
index b1de526a..041e1f59 100644
--- a/Docs/out/scripts/prettify/lang-css.js
+++ b/Docs/out/scripts/prettify/lang-css.js
@@ -1,21 +1,2 @@
-PR.registerLangHandler(PR.createSimpleLexer([
- ["pln", /^[\t\n\f\r ]+/, null, " \t\r\n"]
-], [
- ["str", /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null],
- ["str", /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null],
- ["lang-css-str", /^url\(([^"')]*)\)/i],
- ["kwd", /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, null],
- ["lang-css-kw", /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],
- ["com", /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],
- ["com", /^(?:<\!--|--\>)/],
- ["lit", /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
- ["lit", /^#[\da-f]{3,6}/i],
- ["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],
- ["pun", /^[^\s\w"']+/]
-]), ["css"]);
-PR.registerLangHandler(PR.createSimpleLexer([], [
- ["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]
-]), ["css-kw"]);
-PR.registerLangHandler(PR.createSimpleLexer([], [
- ["str", /^[^"')]+/]
-]), ["css-str"]);
\ No newline at end of file
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
+/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/Docs/out/scripts/prettify/prettify.js b/Docs/out/scripts/prettify/prettify.js
index 37fe3728..eef5ad7e 100644
--- a/Docs/out/scripts/prettify/prettify.js
+++ b/Docs/out/scripts/prettify/prettify.js
@@ -1,496 +1,28 @@
-var q = null;
-window.PR_SHOULD_USE_CONTINUATION = !0;
-(function() {
- function L(a) {
- function m(a) {
- var f = a.charCodeAt(0);
- if (f !== 92) return f;
- var b = a.charAt(1);
- return (f = r[b]) ? f : "0" <= b && b <= "7" ? parseInt(a.substring(1), 8) : b === "u" || b === "x" ? parseInt(a.substring(2), 16) : a.charCodeAt(1)
- }
-
- function e(a) {
- if (a < 32) return (a < 16 ? "\\x0" : "\\x") + a.toString(16);
- a = String.fromCharCode(a);
- if (a === "\\" || a === "-" || a === "[" || a === "]") a = "\\" + a;
- return a
- }
-
- function h(a) {
- for (var f = a.substring(1, a.length - 1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g), a = [], b = [], o = f[0] === "^", c = o ? 1 : 0, i = f.length; c < i; ++c) {
- var j = f[c];
- if (/\\[bdsw]/i.test(j)) a.push(j);
- else {
- var j = m(j),
- d;
- c + 2 < i && "-" === f[c + 1] ? (d = m(f[c + 2]), c += 2) : d = j;
- b.push([j, d]);
- d < 65 || j > 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33]))
- }
- }
- b.sort(function(a, f) {
- return a[0] - f[0] || f[1] - a[1]
- });
- f = [];
- j = [NaN, NaN];
- for (c = 0; c < b.length; ++c) i = b[c], i[0] <= j[1] + 1 ? j[1] = Math.max(j[1], i[1]) : f.push(j = i);
- b = ["["];
- o && b.push("^");
- b.push.apply(b, a);
- for (c = 0; c < f.length; ++c) i = f[c], b.push(e(i[0])), i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1])));
- b.push("]");
- return b.join("")
- }
-
- function y(a) {
- for (var f = a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g), b = f.length, d = [], c = 0, i = 0; c < b; ++c) {
- var j = f[c];
- j === "(" ? ++i : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (d[j] = -1)
- }
- for (c = 1; c < d.length; ++c) - 1 === d[c] && (d[c] = ++t);
- for (i = c = 0; c < b; ++c) j = f[c], j === "(" ? (++i, d[i] === void 0 && (f[c] = "(?:")) : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (f[c] = "\\" + d[i]);
- for (i = c = 0; c < b; ++c)"^" === f[c] && "^" !== f[c + 1] && (f[c] = "");
- if (a.ignoreCase && s) for (c = 0; c < b; ++c) j = f[c], a = j.charAt(0), j.length >= 2 && a === "[" ? f[c] = h(j) : a !== "\\" && (f[c] = j.replace(/[A-Za-z]/g, function(a) {
- a = a.charCodeAt(0);
- return "[" + String.fromCharCode(a & -33, a | 32) + "]"
- }));
- return f.join("")
- }
- for (var t = 0, s = !1, l = !1, p = 0, d = a.length; p < d; ++p) {
- var g = a[p];
- if (g.ignoreCase) l = !0;
- else if (/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, ""))) {
- s = !0;
- l = !1;
- break
- }
- }
- for (var r = {
- b: 8,
- t: 9,
- n: 10,
- v: 11,
- f: 12,
- r: 13
- }, n = [], p = 0, d = a.length; p < d; ++p) {
- g = a[p];
- if (g.global || g.multiline) throw Error("" + g);
- n.push("(?:" + y(g) + ")")
- }
- return RegExp(n.join("|"), l ? "gi" : "g")
- }
-
- function M(a) {
- function m(a) {
- switch (a.nodeType) {
- case 1:
- if (e.test(a.className)) break;
- for (var g = a.firstChild; g; g = g.nextSibling) m(g);
- g = a.nodeName;
- if ("BR" === g || "LI" === g) h[s] = "\n", t[s << 1] = y++, t[s++ << 1 | 1] = a;
- break;
- case 3:
- case 4:
- g = a.nodeValue, g.length && (g = p ? g.replace(/\r\n?/g, "\n") : g.replace(/[\t\n\r ]+/g, " "), h[s] = g, t[s << 1] = y, y += g.length, t[s++ << 1 | 1] = a)
- }
- }
- var e = /(?:^|\s)nocode(?:\s|$)/,
- h = [],
- y = 0,
- t = [],
- s = 0,
- l;
- a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
- var p = l && "pre" === l.substring(0, 3);
- m(a);
- return {
- a: h.join("").replace(/\n$/, ""),
- c: t
- }
- }
-
- function B(a, m, e, h) {
- m && (a = {
- a: m,
- d: a
- }, e(a), h.push.apply(h, a.e))
- }
-
- function x(a, m) {
- function e(a) {
- for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) {
- var f = g[n],
- b = r[f],
- o = void 0,
- c;
- if (typeof b === "string") c = !1;
- else {
- var i = h[f.charAt(0)];
- if (i) o = f.match(i[1]), b = i[0];
- else {
- for (c = 0; c < t; ++c) if (i = m[c], o = f.match(i[1])) {
- b = i[0];
- break
- }
- o || (b = "pln")
- }
- if ((c = b.length >= 5 && "lang-" === b.substring(0, 5)) && !(o && typeof o[1] === "string")) c = !1, b = "src";
- c || (r[f] = b)
- }
- i = d;
- d += f.length;
- if (c) {
- c = o[1];
- var j = f.indexOf(c),
- k = j + c.length;
- o[2] && (k = f.length - o[2].length, j = k - c.length);
- b = b.substring(5);
- B(l + i, f.substring(0, j), e, p);
- B(l + i + j, c, C(b, c), p);
- B(l + i + k, f.substring(k), e, p)
- } else p.push(l + i, b)
- }
- a.e = p
- }
- var h = {},
- y;
- (function() {
- for (var e = a.concat(m), l = [], p = {}, d = 0, g = e.length; d < g; ++d) {
- var r = e[d],
- n = r[3];
- if (n) for (var k = n.length; --k >= 0;) h[n.charAt(k)] = r;
- r = r[1];
- n = "" + r;
- p.hasOwnProperty(n) || (l.push(r), p[n] = q)
- }
- l.push(/[\S\s]/);
- y = L(l)
- })();
- var t = m.length;
- return e
- }
-
- function u(a) {
- var m = [],
- e = [];
- a.tripleQuotedStrings ? m.push(["str", /^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, q, "'\""]) : a.multiLineStrings ? m.push(["str", /^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, q, "'\"`"]) : m.push(["str", /^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/, q, "\"'"]);
- a.verbatimStrings && e.push(["str", /^@"(?:[^"]|"")*(?:"|$)/, q]);
- var h = a.hashComments;
- h && (a.cStyleComments ? (h > 1 ? m.push(["com", /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, q, "#"]) : m.push(["com", /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/, q, "#"]), e.push(["str", /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, q])) : m.push(["com", /^#[^\n\r]*/, q, "#"]));
- a.cStyleComments && (e.push(["com", /^\/\/[^\n\r]*/, q]), e.push(["com", /^\/\*[\S\s]*?(?:\*\/|$)/, q]));
- a.regexLiterals && e.push(["lang-regex", /^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);
- (h = a.types) && e.push(["typ", h]);
- a = ("" + a.keywords).replace(/^ | $/g, "");
- a.length && e.push(["kwd", RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), q]);
- m.push(["pln", /^\s+/, q, " \r\n\t\xa0"]);
- e.push(["lit", /^@[$_a-z][\w$@]*/i, q], ["typ", /^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/, q], ["pln", /^[$_a-z][\w$@]*/i, q], ["lit", /^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, q, "0123456789"], ["pln", /^\\[\S\s]?/, q], ["pun", /^.[^\s\w"-$'./@\\`]*/, q]);
- return x(m, e)
- }
-
- function D(a, m) {
- function e(a) {
- switch (a.nodeType) {
- case 1:
- if (k.test(a.className)) break;
- if ("BR" === a.nodeName) h(a), a.parentNode && a.parentNode.removeChild(a);
- else for (a = a.firstChild; a; a = a.nextSibling) e(a);
- break;
- case 3:
- case 4:
- if (p) {
- var b = a.nodeValue,
- d = b.match(t);
- if (d) {
- var c = b.substring(0, d.index);
- a.nodeValue = c;
- (b = b.substring(d.index + d[0].length)) && a.parentNode.insertBefore(s.createTextNode(b), a.nextSibling);
- h(a);
- c || a.parentNode.removeChild(a)
- }
- }
- }
- }
-
- function h(a) {
- function b(a, d) {
- var e = d ? a.cloneNode(!1) : a,
- f = a.parentNode;
- if (f) {
- var f = b(f, 1),
- g = a.nextSibling;
- f.appendChild(e);
- for (var h = g; h; h = g) g = h.nextSibling, f.appendChild(h)
- }
- return e
- }
- for (; !a.nextSibling;) if (a = a.parentNode, !a) return;
- for (var a = b(a.nextSibling, 0), e;
- (e = a.parentNode) && e.nodeType === 1;) a = e;
- d.push(a)
- }
- var k = /(?:^|\s)nocode(?:\s|$)/,
- t = /\r\n?|\n/,
- s = a.ownerDocument,
- l;
- a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
- var p = l && "pre" === l.substring(0, 3);
- for (l = s.createElement("LI"); a.firstChild;) l.appendChild(a.firstChild);
- for (var d = [l], g = 0; g < d.length; ++g) e(d[g]);
- m === (m | 0) && d[0].setAttribute("value", m);
- var r = s.createElement("OL");
- r.className = "linenums";
- for (var n = Math.max(0, m - 1 | 0) || 0, g = 0, z = d.length; g < z; ++g) l = d[g], l.className = "L" + (g + n) % 10, l.firstChild || l.appendChild(s.createTextNode("\xa0")), r.appendChild(l);
- a.appendChild(r)
- }
-
- function k(a, m) {
- for (var e = m.length; --e >= 0;) {
- var h = m[e];
- A.hasOwnProperty(h) ? window.console && console.warn("cannot override language handler %s", h) : A[h] = a
- }
- }
-
- function C(a, m) {
- if (!a || !A.hasOwnProperty(a)) a = /^\s*= o && (h += 2);
- e >= c && (a += 2)
- }
- } catch (w) {
- "console" in window && console.log(w && w.stack ? w.stack : w)
- }
- }
- var v = ["break,continue,do,else,for,if,return,while"],
- w = [
- [v, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],
- F = [w, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],
- G = [w, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
- H = [G, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],
- w = [w, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],
- I = [v, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
- J = [v, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],
- v = [v, "case,done,elif,esac,eval,fi,function,in,local,set,then,until"],
- K = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,
- N = /\S/,
- O = u({
- keywords: [F, H, w, "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END" + I, J, v],
- hashComments: !0,
- cStyleComments: !0,
- multiLineStrings: !0,
- regexLiterals: !0
- }),
- A = {};
- k(O, ["default-code"]);
- k(x([], [
- ["pln", /^[^]+/],
- ["dec", /^]*(?:>|$)/],
- ["com", /^<\!--[\S\s]*?(?:--\>|$)/],
- ["lang-", /^<\?([\S\s]+?)(?:\?>|$)/],
- ["lang-", /^<%([\S\s]+?)(?:%>|$)/],
- ["pun", /^(?:<[%?]|[%?]>)/],
- ["lang-", /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],
- ["lang-js", /^
+
+
\ No newline at end of file
diff --git a/src/core/LinkedList.js b/src/core/LinkedList.js
index d58710c4..4e3abeb0 100644
--- a/src/core/LinkedList.js
+++ b/src/core/LinkedList.js
@@ -2,11 +2,10 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.LinkedList
*/
/**
-* A linked list data structure.
+* A basic linked list data structure.
*
* @class Phaser.LinkedList
* @constructor
@@ -48,12 +47,11 @@ Phaser.LinkedList = function () {
Phaser.LinkedList.prototype = {
/**
- * Add element to a linked list.
+ * Adds a new element to this linked list.
*
- * @method add
- * @memberof Phaser.LinkedList
- * @param {object} child - Description.
- * @return {object} Description.
+ * @method Phaser.LinkedList#add
+ * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through.
+ * @return {object} The child that was added.
*/
add: function (child) {
@@ -65,7 +63,7 @@ Phaser.LinkedList.prototype = {
this.next = child;
child.prev = this;
this.total++;
- return;
+ return child;
}
// Get gets appended to the end of the list, regardless of anything, and it won't have any children of its own (non-nested list)
@@ -82,31 +80,53 @@ Phaser.LinkedList.prototype = {
},
/**
- * Remove element from a linked list.
+ * Removes the given element from this linked list if it exists.
*
- * @method remove
- * @memberof Phaser.LinkedList
- * @param {object} child - Description.
+ * @method Phaser.LinkedList#remove
+ * @param {object} child - The child to be removed from the list.
*/
remove: function (child) {
- if( child == this.first ) this.first = this.first.next; // It was 'first', make 'first' point to first.next
- else if ( child == this.last ) this.last = this.last.prev; // It was 'last', make 'last' point to last.prev
- if( child.prev ) child.prev.next = child.next; // make child.prev.next point to childs.next instead of child
- if( child.next ) child.next.prev = child.prev; // make child.next.prev point to child.prev instead of child
+ if (child == this.first)
+ {
+ // It was 'first', make 'first' point to first.next
+ this.first = this.first.next;
+ }
+ else if (child == this.last)
+ {
+ // It was 'last', make 'last' point to last.prev
+ this.last = this.last.prev;
+ }
+
+ if (child.prev)
+ {
+ // make child.prev.next point to childs.next instead of child
+ child.prev.next = child.next;
+ }
+
+ if (child.next)
+ {
+ // make child.next.prev point to child.prev instead of child
+ child.next.prev = child.prev;
+ }
+
child.next = child.prev = null;
- if( this.first == null ) this.last = null;
+ if (this.first == null )
+ {
+ this.last = null;
+ }
this.total--;
+
},
/**
- * Description.
+ * Calls a function on all members of this list, using the member as the context for the callback.
+ * The function must exist on the member.
*
- * @method callAll
- * @memberof Phaser.LinkedList
- * @param {object} callback - Description.
+ * @method Phaser.LinkedList#callAll
+ * @param {function} callback - The function to call.
*/
callAll: function (callback) {
@@ -129,85 +149,6 @@ Phaser.LinkedList.prototype = {
}
while(entity != this.last.next)
- },
-
- /**
- * Description.
- *
- * @method dump
- * @memberof Phaser.LinkedList
- */
- dump: function () {
-
- var spacing = 20;
-
- var output = "\n" + Phaser.Utils.pad('Node', spacing) + "|" + Phaser.Utils.pad('Next', spacing) + "|" + Phaser.Utils.pad('Previous', spacing) + "|" + Phaser.Utils.pad('First', spacing) + "|" + Phaser.Utils.pad('Last', spacing);
- console.log(output);
-
- var output = Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing);
- console.log(output);
-
- var entity = this;
-
- var testObject = entity.last.next;
- entity = entity.first;
-
- do
- {
- var name = entity.sprite.name || '*';
- var nameNext = '-';
- var namePrev = '-';
- var nameFirst = '-';
- var nameLast = '-';
-
- if (entity.next)
- {
- nameNext = entity.next.sprite.name;
- }
-
- if (entity.prev)
- {
- namePrev = entity.prev.sprite.name;
- }
-
- if (entity.first)
- {
- nameFirst = entity.first.sprite.name;
- }
-
- if (entity.last)
- {
- nameLast = entity.last.sprite.name;
- }
-
- if (typeof nameNext === 'undefined')
- {
- nameNext = '-';
- }
-
- if (typeof namePrev === 'undefined')
- {
- namePrev = '-';
- }
-
- if (typeof nameFirst === 'undefined')
- {
- nameFirst = '-';
- }
-
- if (typeof nameLast === 'undefined')
- {
- nameLast = '-';
- }
-
- var output = Phaser.Utils.pad(name, spacing) + "|" + Phaser.Utils.pad(nameNext, spacing) + "|" + Phaser.Utils.pad(namePrev, spacing) + "|" + Phaser.Utils.pad(nameFirst, spacing) + "|" + Phaser.Utils.pad(nameLast, spacing);
- console.log(output);
-
- entity = entity.next;
-
- }
- while(entity != testObject)
-
- }
+ }
};
\ No newline at end of file
diff --git a/src/core/Plugin.js b/src/core/Plugin.js
index 40274639..14cfc3d8 100644
--- a/src/core/Plugin.js
+++ b/src/core/Plugin.js
@@ -2,10 +2,8 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Plugin
*/
-
/**
* This is a base Plugin template to use for any Phaser plugin development.
*
@@ -13,52 +11,54 @@
* @classdesc Phaser - Plugin
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
-* @param {Description} parent - Description.
+* @param {Any} parent - The object that owns this plugin, usually Phaser.PluginManager.
*/
Phaser.Plugin = function (game, parent) {
+ if (typeof parent === 'undefined') { parent = null; }
+
/**
* @property {Phaser.Game} game - A reference to the currently running game.
*/
this.game = game;
/**
- * @property {Description} parent - Description.
+ * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.
*/
this.parent = parent;
/**
- * @property {boolean} active - Description.
+ * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.
* @default
*/
this.active = false;
/**
- * @property {boolean} visible - Description.
+ * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.
* @default
*/
this.visible = false;
/**
- * @property {boolean} hasPreUpdate - Description.
+ * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method.
* @default
*/
this.hasPreUpdate = false;
/**
- * @property {boolean} hasUpdate - Description.
+ * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method.
* @default
*/
this.hasUpdate = false;
/**
- * @property {boolean} hasRender - Description.
+ * @property {boolean} hasRender - A flag to indicate if this plugin has a render method.
* @default
*/
this.hasRender = false;
/**
- * @property {boolean} hasPostRender - Description.
+ * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method.
* @default
*/
this.hasPostRender = false;
@@ -68,10 +68,9 @@ Phaser.Plugin = function (game, parent) {
Phaser.Plugin.prototype = {
/**
- * Pre-update is called at the start of the update cycle, before any other updates have taken place (including Physics).
+ * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
* It is only called if active is set to true.
- * @method preUpdate
- * @memberof Phaser.Plugin
+ * @method Phaser.Plugin#preUpdate
*/
preUpdate: function () {
},
@@ -79,8 +78,7 @@ Phaser.Plugin.prototype = {
/**
* Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
* It is only called if active is set to true.
- * @method update
- * @memberof Phaser.Plugin
+ * @method Phaser.Plugin#update
*/
update: function () {
},
@@ -88,8 +86,7 @@ Phaser.Plugin.prototype = {
/**
* Render is called right after the Game Renderer completes, but before the State.render.
* It is only called if visible is set to true.
- * @method render
- * @memberof Phaser.Plugin
+ * @method Phaser.Plugin#render
*/
render: function () {
},
@@ -97,16 +94,14 @@ Phaser.Plugin.prototype = {
/**
* Post-render is called after the Game Renderer and State.render have run.
* It is only called if visible is set to true.
- * @method postRender
- * @memberof Phaser.Plugin
+ * @method Phaser.Plugin#postRender
*/
postRender: function () {
},
/**
* Clear down this Plugin and null out references
- * @method destroy
- * @memberof Phaser.Plugin
+ * @method Phaser.Plugin#destroy
*/
destroy: function () {
diff --git a/src/core/PluginManager.js b/src/core/PluginManager.js
index 048f5ecc..083489fd 100644
--- a/src/core/PluginManager.js
+++ b/src/core/PluginManager.js
@@ -46,8 +46,7 @@ Phaser.PluginManager.prototype = {
/**
* Add a new Plugin to the PluginManager.
* The plugin's game and parent reference are set to this game and pluginmanager parent.
- * @method add
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#add
* @param {Phaser.Plugin} plugin - Description.
* @return {Phaser.Plugin} Description.
*/
@@ -115,9 +114,8 @@ Phaser.PluginManager.prototype = {
/**
* Remove a Plugin from the PluginManager.
- * @method remove
- * @memberof Phaser.PluginManager
- * @param {Phaser.Plugin} plugin - Description.
+ * @method Phaser.PluginManager#remove
+ * @param {Phaser.Plugin} plugin - The plugin to be removed.
*/
remove: function (plugin) {
@@ -127,10 +125,10 @@ Phaser.PluginManager.prototype = {
},
/**
- * Description.
+ * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
+ * It only calls plugins who have active=true.
*
- * @method preUpdate
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#preUpdate
*/
preUpdate: function () {
@@ -150,10 +148,10 @@ Phaser.PluginManager.prototype = {
},
/**
- * Description.
+ * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
+ * It only calls plugins who have active=true.
*
- * @method update
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#update
*/
update: function () {
@@ -173,10 +171,10 @@ Phaser.PluginManager.prototype = {
},
/**
- * Description.
+ * Render is called right after the Game Renderer completes, but before the State.render.
+ * It only calls plugins who have visible=true.
*
- * @method render
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#render
*/
render: function () {
@@ -196,10 +194,10 @@ Phaser.PluginManager.prototype = {
},
/**
- * Description.
+ * Post-render is called after the Game Renderer and State.render have run.
+ * It only calls plugins who have visible=true.
*
- * @method postRender
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#postRender
*/
postRender: function () {
@@ -219,10 +217,9 @@ Phaser.PluginManager.prototype = {
},
/**
- * Description.
+ * Clear down this PluginManager and null out references
*
- * @method destroy
- * @memberof Phaser.PluginManager
+ * @method Phaser.PluginManager#destroy
*/
destroy: function () {
diff --git a/src/core/Signal.js b/src/core/Signal.js
index 23a71ada..08aa10f6 100644
--- a/src/core/Signal.js
+++ b/src/core/Signal.js
@@ -2,7 +2,6 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Signal
*/
/**
@@ -48,7 +47,6 @@ Phaser.Signal.prototype = {
memorize: false,
/**
- * Description.
* @property {boolean} _shouldPropagate
* @private
*/
@@ -63,11 +61,10 @@ Phaser.Signal.prototype = {
active: true,
/**
- * Description.
- *
- * @method validateListener
+ * @method Phaser.Signal#validateListener
* @param {function} listener - Signal handler function.
* @param {Description} fnName - Description.
+ * @private
*/
validateListener: function (listener, fnName) {
if (typeof listener !== 'function') {
@@ -76,9 +73,7 @@ Phaser.Signal.prototype = {
},
/**
- * Description.
- *
- * @method _registerListener
+ * @method Phaser.Signal#_registerListener
* @param {function} listener - Signal handler function.
* @param {boolean} isOnce - Description.
* @param {object} [listenerContext] - Description.
@@ -109,9 +104,7 @@ Phaser.Signal.prototype = {
},
/**
- * Description.
- *
- * @method _addBinding
+ * @method Phaser.Signal#_addBinding
* @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener.
* @private
*/
@@ -123,9 +116,7 @@ Phaser.Signal.prototype = {
},
/**
- * Description.
- *
- * @method _indexOfListener
+ * @method Phaser.Signal#_indexOfListener
* @param {function} listener - Signal handler function.
* @return {number} Description.
* @private
@@ -145,7 +136,7 @@ Phaser.Signal.prototype = {
/**
* Check if listener was attached to Signal.
*
- * @method has
+ * @method Phaser.Signal#has
* @param {Function} listener - Signal handler function.
* @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
* @return {boolean} If Signal has the specified listener.
@@ -157,7 +148,7 @@ Phaser.Signal.prototype = {
/**
* Add a listener to the signal.
*
- * @method add
+ * @method Phaser.Signal#add
* @param {function} listener - Signal handler function.
* @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
* @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).
@@ -170,6 +161,8 @@ Phaser.Signal.prototype = {
/**
* Add listener to the signal that should be removed after first execution (will be executed only once).
+ *
+ * @method Phaser.Signal#addOnce
* @param {function} listener Signal handler function.
* @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
* @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)
@@ -182,23 +175,32 @@ Phaser.Signal.prototype = {
/**
* Remove a single listener from the dispatch queue.
+ *
+ * @method Phaser.Signal#remove
* @param {function} listener Handler function that should be removed.
* @param {object} [context] Execution context (since you can add the same handler multiple times if executing in a different context).
* @return {function} Listener handler function.
*/
remove: function (listener, context) {
+
this.validateListener(listener, 'remove');
var i = this._indexOfListener(listener, context);
- if (i !== -1) {
+
+ if (i !== -1)
+ {
this._bindings[i]._destroy(); //no reason to a Phaser.SignalBinding exist if it isn't attached to a signal
this._bindings.splice(i, 1);
}
+
return listener;
+
},
/**
* Remove all listeners from the Signal.
+ *
+ * @method Phaser.Signal#removeAll
*/
removeAll: function () {
var n = this._bindings.length;
@@ -209,6 +211,9 @@ Phaser.Signal.prototype = {
},
/**
+ * Gets the total number of listeneres attached to ths Signal.
+ *
+ * @method Phaser.Signal#getNumListeners
* @return {number} Number of listeners attached to the Signal.
*/
getNumListeners: function () {
@@ -219,6 +224,8 @@ Phaser.Signal.prototype = {
* Stop propagation of the event, blocking the dispatch to next listeners on the queue.
*
IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
* @see Signal.prototype.disable
+ *
+ * @method Phaser.Signal#halt
*/
halt: function () {
this._shouldPropagate = false;
@@ -226,7 +233,9 @@ Phaser.Signal.prototype = {
/**
* Dispatch/Broadcast Signal to all listeners added to the queue.
- * @param {Description} [params] - Parameters that should be passed to each handler.
+ *
+ * @method Phaser.Signal#dispatch
+ * @param {any} [params] - Parameters that should be passed to each handler.
*/
dispatch: function (params) {
if (! this.active) {
@@ -255,17 +264,21 @@ Phaser.Signal.prototype = {
},
/**
- * Forget memorized arguments.
- * @see Signal.memorize
- */
+ * Forget memorized arguments.
+ * @see Signal.memorize
+ *
+ * @method Phaser.Signal#forget
+ */
forget: function(){
this._prevParams = null;
},
/**
- * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
- *
IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
- */
+ * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
+ *
IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.
- * @method execute
+ * @method Phaser.SignalBinding#execute
* @param {array} [paramsArr] - Array of parameters that should be passed to the listener.
* @return {Description} Value returned by the listener.
*/
@@ -103,7 +101,7 @@ Phaser.SignalBinding.prototype = {
/**
* Detach binding from signal.
*
alias to: @see mySignal.remove(myBinding.getListener());
- * @method detach
+ * @method Phaser.SignalBinding#detach
* @return {function|null} Handler function bound to the signal or `null` if binding was previously detached.
*/
detach: function () {
@@ -111,7 +109,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method isBound
+ * @method Phaser.SignalBinding#isBound
* @return {boolean} True if binding is still bound to the signal and has a listener.
*/
isBound: function () {
@@ -119,7 +117,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method isOnce
+ * @method Phaser.SignalBinding#isOnce
* @return {boolean} If SignalBinding will only be executed once.
*/
isOnce: function () {
@@ -127,7 +125,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method getListener
+ * @method Phaser.SignalBinding#getListener
* @return {Function} Handler function bound to the signal.
*/
getListener: function () {
@@ -135,7 +133,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method getSignal
+ * @method Phaser.SignalBinding#getSignal
* @return {Signal} Signal that listener is currently bound to.
*/
getSignal: function () {
@@ -143,7 +141,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method _destroy
+ * @method Phaser.SignalBinding#_destroy
* Delete instance properties
* @private
*/
@@ -154,7 +152,7 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @method toString
+ * @method Phaser.SignalBinding#toString
* @return {string} String representation of the object.
*/
toString: function () {
diff --git a/src/utils/Debug.js b/src/utils/Debug.js
index 8e73a009..2b9ae089 100644
--- a/src/utils/Debug.js
+++ b/src/utils/Debug.js
@@ -568,7 +568,7 @@ Phaser.Utils.Debug.prototype = {
* @param {Phaser.Sprite} sprite - Description.
* @param {string} [color] - Color of the debug info to be rendered (format is css color string).
*/
- renderSpriteBounds: function (sprite, color) {
+ renderSpriteBody: function (sprite, color) {
if (this.context == null)
{
@@ -731,6 +731,85 @@ Phaser.Utils.Debug.prototype = {
this.context.fillText(text, x, y);
this.stop();
+ },
+
+ /**
+ * Description.
+ *
+ * @method Phaser.LinkedList#dump
+ */
+ dumpLinkedList: function (list) {
+
+ var spacing = 20;
+
+ var output = "\n" + Phaser.Utils.pad('Node', spacing) + "|" + Phaser.Utils.pad('Next', spacing) + "|" + Phaser.Utils.pad('Previous', spacing) + "|" + Phaser.Utils.pad('First', spacing) + "|" + Phaser.Utils.pad('Last', spacing);
+ console.log(output);
+
+ var output = Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing);
+ console.log(output);
+
+ var entity = list;
+
+ var testObject = entity.last.next;
+ entity = entity.first;
+
+ do
+ {
+ var name = entity.sprite.name || '*';
+ var nameNext = '-';
+ var namePrev = '-';
+ var nameFirst = '-';
+ var nameLast = '-';
+
+ if (entity.next)
+ {
+ nameNext = entity.next.sprite.name;
+ }
+
+ if (entity.prev)
+ {
+ namePrev = entity.prev.sprite.name;
+ }
+
+ if (entity.first)
+ {
+ nameFirst = entity.first.sprite.name;
+ }
+
+ if (entity.last)
+ {
+ nameLast = entity.last.sprite.name;
+ }
+
+ if (typeof nameNext === 'undefined')
+ {
+ nameNext = '-';
+ }
+
+ if (typeof namePrev === 'undefined')
+ {
+ namePrev = '-';
+ }
+
+ if (typeof nameFirst === 'undefined')
+ {
+ nameFirst = '-';
+ }
+
+ if (typeof nameLast === 'undefined')
+ {
+ nameLast = '-';
+ }
+
+ var output = Phaser.Utils.pad(name, spacing) + "|" + Phaser.Utils.pad(nameNext, spacing) + "|" + Phaser.Utils.pad(namePrev, spacing) + "|" + Phaser.Utils.pad(nameFirst, spacing) + "|" + Phaser.Utils.pad(nameLast, spacing);
+ console.log(output);
+
+ entity = entity.next;
+
+ }
+ while(entity != testObject)
+
}
+
};