mirror of
https://github.com/wassname/phaser.git
synced 2026-07-24 13:10:53 +08:00
More docs.
This commit is contained in:
+1
-2
@@ -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": "(^|\\/|\\\\)_"
|
||||
|
||||
@@ -538,7 +538,7 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -486,7 +486,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -468,7 +468,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -276,7 +276,7 @@ Phaser.Animation.Frame.prototype = {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -349,7 +349,7 @@ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -591,7 +591,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
+85
-79
@@ -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", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -434,7 +434,7 @@ Phaser.Animation.Parser = {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2628,7 +2628,7 @@
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -1575,7 +1575,7 @@ The frames are returned in the output array, or if none is provided in a new Arr
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -1082,7 +1082,7 @@
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2459,7 +2459,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2283,7 +2283,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2710,7 +2710,7 @@ without having to use game.camera.x and game.camera.y.</p>
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -4147,7 +4147,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
+429
-168
File diff suppressed because it is too large
Load Diff
@@ -157,7 +157,7 @@ PIXI.InteractionManager = function (dummy) {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
+30
-147
@@ -1,100 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Phaser Index</title>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
|
||||
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Index</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="navbar navbar-fixed-top navbar-inverse">
|
||||
<div class="navbar-inner">
|
||||
<a class="brand" href="index.html">Phaser</a>
|
||||
<ul class="nav">
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b
|
||||
class="caret"></b></a>
|
||||
|
||||
<ul class="dropdown-menu ">
|
||||
|
||||
<li>
|
||||
<a href="module-Phaser.html">Phaser</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
|
||||
class="caret"></b></a>
|
||||
|
||||
<ul class="dropdown-menu ">
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Animation.html">Animation</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Animation.Frame.html">Frame</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Animation.FrameData.html">FrameData</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Animation.Parser.html">Parser</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.AnimationManager.html">AnimationManager</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Camera.html">Camera</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Game.html">Game</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Group.html">Group</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
|
||||
<div class="span8">
|
||||
|
||||
<div id="main">
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Index</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="page-title">Index</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3> </h3>
|
||||
|
||||
|
||||
|
||||
@@ -104,11 +35,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -118,63 +45,19 @@
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
<br clear="both">
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<footer>
|
||||
|
||||
|
||||
<span class="copyright">
|
||||
Phaser Copyright © 2012-2013 Photon Storm Ltd.
|
||||
</span>
|
||||
<br />
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="span3">
|
||||
<div id="toc"></div>
|
||||
</div>
|
||||
|
||||
<br clear="both">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script src="scripts/sunlight.js"></script>
|
||||
<script src="scripts/sunlight.javascript.js"></script>
|
||||
<script src="scripts/sunlight-plugin.doclinks.js"></script>
|
||||
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
|
||||
<script src="scripts/sunlight-plugin.menu.js"></script>
|
||||
<script src="scripts/jquery.min.js"></script>
|
||||
<script src="scripts/jquery.scrollTo.js"></script>
|
||||
<script src="scripts/jquery.localScroll.js"></script>
|
||||
<script src="scripts/bootstrap-dropdown.js"></script>
|
||||
<script src="scripts/toc.js"></script>
|
||||
|
||||
|
||||
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
|
||||
|
||||
<script>
|
||||
$( function () {
|
||||
$( "#toc" ).toc( {
|
||||
selectors : "h1,h2,h3,h4",
|
||||
showAndHide : false,
|
||||
scrollTo : 60
|
||||
} );
|
||||
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
|
||||
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
|
||||
|
||||
} );
|
||||
</script>
|
||||
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Wed Oct 02 2013 11:08:33 GMT+0100 (BST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -184,7 +184,7 @@
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
|
||||
on Wed Oct 02 2013 01:12:17 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -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"]);
|
||||
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"]);
|
||||
|
||||
@@ -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*</.test(m) ? "default-markup" : "default-code";
|
||||
return A[a]
|
||||
}
|
||||
|
||||
function E(a) {
|
||||
var m =
|
||||
a.g;
|
||||
try {
|
||||
var e = M(a.h),
|
||||
h = e.a;
|
||||
a.a = h;
|
||||
a.c = e.c;
|
||||
a.d = 0;
|
||||
C(m, h)(a);
|
||||
var k = /\bMSIE\b/.test(navigator.userAgent),
|
||||
m = /\n/g,
|
||||
t = a.a,
|
||||
s = t.length,
|
||||
e = 0,
|
||||
l = a.c,
|
||||
p = l.length,
|
||||
h = 0,
|
||||
d = a.e,
|
||||
g = d.length,
|
||||
a = 0;
|
||||
d[g] = s;
|
||||
var r, n;
|
||||
for (n = r = 0; n < g;) d[n] !== d[n + 2] ? (d[r++] = d[n++], d[r++] = d[n++]) : n += 2;
|
||||
g = r;
|
||||
for (n = r = 0; n < g;) {
|
||||
for (var z = d[n], f = d[n + 1], b = n + 2; b + 2 <= g && d[b + 1] === f;) b += 2;
|
||||
d[r++] = z;
|
||||
d[r++] = f;
|
||||
n = b
|
||||
}
|
||||
for (d.length = r; h < p;) {
|
||||
var o = l[h + 2] || s,
|
||||
c = d[a + 2] || s,
|
||||
b = Math.min(o, c),
|
||||
i = l[h + 1],
|
||||
j;
|
||||
if (i.nodeType !== 1 && (j = t.substring(e, b))) {
|
||||
k && (j = j.replace(m, "\r"));
|
||||
i.nodeValue =
|
||||
j;
|
||||
var u = i.ownerDocument,
|
||||
v = u.createElement("SPAN");
|
||||
v.className = d[a + 1];
|
||||
var x = i.parentNode;
|
||||
x.replaceChild(v, i);
|
||||
v.appendChild(i);
|
||||
e < o && (l[h + 1] = i = u.createTextNode(t.substring(b, o)), x.insertBefore(i, v.nextSibling))
|
||||
}
|
||||
e = b;
|
||||
e >= 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", /^<!\w[^>]*(?:>|$)/],
|
||||
["com", /^<\!--[\S\s]*?(?:--\>|$)/],
|
||||
["lang-", /^<\?([\S\s]+?)(?:\?>|$)/],
|
||||
["lang-", /^<%([\S\s]+?)(?:%>|$)/],
|
||||
["pun", /^(?:<[%?]|[%?]>)/],
|
||||
["lang-", /^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],
|
||||
["lang-js", /^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],
|
||||
["lang-css", /^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],
|
||||
["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i]
|
||||
]), ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]);
|
||||
k(x([
|
||||
["pln", /^\s+/, q, " \t\r\n"],
|
||||
["atv", /^(?:"[^"]*"?|'[^']*'?)/, q, "\"'"]
|
||||
], [
|
||||
["tag", /^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],
|
||||
["atn", /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
|
||||
["lang-uq.val", /^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],
|
||||
["pun", /^[/<->]+/],
|
||||
["lang-js", /^on\w+\s*=\s*"([^"]+)"/i],
|
||||
["lang-js", /^on\w+\s*=\s*'([^']+)'/i],
|
||||
["lang-js", /^on\w+\s*=\s*([^\s"'>]+)/i],
|
||||
["lang-css", /^style\s*=\s*"([^"]+)"/i],
|
||||
["lang-css", /^style\s*=\s*'([^']+)'/i],
|
||||
["lang-css", /^style\s*=\s*([^\s"'>]+)/i]
|
||||
]), ["in.tag"]);
|
||||
k(x([], [
|
||||
["atv", /^[\S\s]+/]
|
||||
]), ["uq.val"]);
|
||||
k(u({
|
||||
keywords: F,
|
||||
hashComments: !0,
|
||||
cStyleComments: !0,
|
||||
types: K
|
||||
}), ["c", "cc", "cpp", "cxx", "cyc", "m"]);
|
||||
k(u({
|
||||
keywords: "null,true,false"
|
||||
}), ["json"]);
|
||||
k(u({
|
||||
keywords: H,
|
||||
hashComments: !0,
|
||||
cStyleComments: !0,
|
||||
verbatimStrings: !0,
|
||||
types: K
|
||||
}), ["cs"]);
|
||||
k(u({
|
||||
keywords: G,
|
||||
cStyleComments: !0
|
||||
}), ["java"]);
|
||||
k(u({
|
||||
keywords: v,
|
||||
hashComments: !0,
|
||||
multiLineStrings: !0
|
||||
}), ["bsh", "csh", "sh"]);
|
||||
k(u({
|
||||
keywords: I,
|
||||
hashComments: !0,
|
||||
multiLineStrings: !0,
|
||||
tripleQuotedStrings: !0
|
||||
}), ["cv", "py"]);
|
||||
k(u({
|
||||
keywords: "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",
|
||||
hashComments: !0,
|
||||
multiLineStrings: !0,
|
||||
regexLiterals: !0
|
||||
}), ["perl", "pl", "pm"]);
|
||||
k(u({
|
||||
keywords: J,
|
||||
hashComments: !0,
|
||||
multiLineStrings: !0,
|
||||
regexLiterals: !0
|
||||
}), ["rb"]);
|
||||
k(u({
|
||||
keywords: w,
|
||||
cStyleComments: !0,
|
||||
regexLiterals: !0
|
||||
}), ["js"]);
|
||||
k(u({
|
||||
keywords: "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
||||
hashComments: 3,
|
||||
cStyleComments: !0,
|
||||
multilineStrings: !0,
|
||||
tripleQuotedStrings: !0,
|
||||
regexLiterals: !0
|
||||
}), ["coffee"]);
|
||||
k(x([], [
|
||||
["str", /^[\S\s]+/]
|
||||
]), ["regex"]);
|
||||
window.prettyPrintOne = function(a, m, e) {
|
||||
var h = document.createElement("PRE");
|
||||
h.innerHTML = a;
|
||||
e && D(h, e);
|
||||
E({
|
||||
g: m,
|
||||
i: e,
|
||||
h: h
|
||||
});
|
||||
return h.innerHTML
|
||||
};
|
||||
window.prettyPrint = function(a) {
|
||||
function m() {
|
||||
for (var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; p < h.length && l.now() < e; p++) {
|
||||
var n = h[p],
|
||||
k = n.className;
|
||||
if (k.indexOf("prettyprint") >= 0) {
|
||||
var k = k.match(g),
|
||||
f, b;
|
||||
if (b = !k) {
|
||||
b = n;
|
||||
for (var o = void 0, c = b.firstChild; c; c = c.nextSibling) var i = c.nodeType,
|
||||
o = i === 1 ? o ? b : c : i === 3 ? N.test(c.nodeValue) ? b : o : o;
|
||||
b = (f = o === b ? void 0 : o) && "CODE" === f.tagName
|
||||
}
|
||||
b && (k = f.className.match(g));
|
||||
k && (k = k[1]);
|
||||
b = !1;
|
||||
for (o = n.parentNode; o; o = o.parentNode) if ((o.tagName === "pre" || o.tagName === "code" || o.tagName === "xmp") && o.className && o.className.indexOf("prettyprint") >= 0) {
|
||||
b = !0;
|
||||
break
|
||||
}
|
||||
b || ((b = (b = n.className.match(/\blinenums\b(?::(\d+))?/)) ? b[1] && b[1].length ? +b[1] : !0 : !1) && D(n, b), d = {
|
||||
g: k,
|
||||
h: n,
|
||||
i: b
|
||||
}, E(d))
|
||||
}
|
||||
}
|
||||
p < h.length ? setTimeout(m, 250) : a && a()
|
||||
}
|
||||
for (var e = [document.getElementsByTagName("pre"), document.getElementsByTagName("code"), document.getElementsByTagName("xmp")], h = [], k = 0; k < e.length; ++k) for (var t = 0, s = e[k].length; t < s; ++t) h.push(e[k][t]);
|
||||
var e = q,
|
||||
l = Date;
|
||||
l.now || (l = {
|
||||
now: function() {
|
||||
return +new Date
|
||||
}
|
||||
});
|
||||
var p = 0,
|
||||
d, g = /\blang(?:uage)?-([\w.]+)(?!\S)/;
|
||||
m()
|
||||
};
|
||||
window.PR = {
|
||||
createSimpleLexer: x,
|
||||
registerLangHandler: k,
|
||||
sourceDecorator: u,
|
||||
PR_ATTRIB_NAME: "atn",
|
||||
PR_ATTRIB_VALUE: "atv",
|
||||
PR_COMMENT: "com",
|
||||
PR_DECLARATION: "dec",
|
||||
PR_KEYWORD: "kwd",
|
||||
PR_LITERAL: "lit",
|
||||
PR_NOCODE: "nocode",
|
||||
PR_PLAIN: "pln",
|
||||
PR_PUNCTUATION: "pun",
|
||||
PR_SOURCE: "src",
|
||||
PR_STRING: "str",
|
||||
PR_TAG: "tag",
|
||||
PR_TYPE: "typ"
|
||||
}
|
||||
})();
|
||||
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*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
||||
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
||||
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=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",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
||||
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
||||
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
||||
["cv","py"]);k(u({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
||||
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
||||
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
||||
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
||||
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
||||
|
||||
@@ -72,6 +72,8 @@ Version 1.0.7 (in progress in the dev branch)
|
||||
* Updated Group.forEach, forEachAlive and forEachDead so you can now pass as many parameters as you want, which will all be given to the callback after the child.
|
||||
* Updated build script so it can be run from the command-line and includes UMD wrappers (thanks iaincarsberg)
|
||||
* Fixed bug in LinkedList#remove that could cause first to point to a dead node (thanks onedayitwillmake)
|
||||
* Moved LinkedList.dump to Debug.dumpLinkedList(list)
|
||||
|
||||
|
||||
* TODO: addMarker hh:mm:ss:ms
|
||||
* TODO: Direction constants
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
$title = "Sprite Tiles";
|
||||
require('../head.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.spritesheet('tiles', 'assets/tiles/platformer_tiles.png', 16, 16);
|
||||
game.load.image('carrot', 'assets/sprites/carrot.png');
|
||||
|
||||
}
|
||||
|
||||
var tiles;
|
||||
var sprite;
|
||||
|
||||
function create() {
|
||||
|
||||
game.stage.backgroundColor = '#2d2d2d';
|
||||
|
||||
tiles = game.add.group();
|
||||
|
||||
for (var x = 0; x < 40; x++)
|
||||
{
|
||||
var tile = tiles.create(100 + (x * 16), 300, 'tiles', 4);
|
||||
tile.body.immovable = true;
|
||||
}
|
||||
|
||||
sprite = game.add.sprite(300, 150, 'carrot');
|
||||
sprite.name = 'mushroom';
|
||||
sprite.body.collideWorldBounds = true;
|
||||
sprite.body.velocity.x = 40;
|
||||
sprite.body.velocity.y = 120;
|
||||
sprite.body.bounce.setTo(1, 1);
|
||||
|
||||
game.input.onDown.add(carryOn, this);
|
||||
|
||||
}
|
||||
|
||||
function carryOn() {
|
||||
|
||||
game.paused = false;
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
// object1, object2, collideCallback, processCallback, callbackContext
|
||||
game.physics.collide(sprite, tiles, collisionHandler, null, this);
|
||||
|
||||
}
|
||||
|
||||
function collisionHandler (s, t) {
|
||||
|
||||
t.alpha = 0.5;
|
||||
|
||||
console.log('---------------------------------------------');
|
||||
console.log(t.body);
|
||||
|
||||
game.paused = true;
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
// game.debug.renderSpriteInfo(sprite1, 32, 32);
|
||||
// game.debug.renderSpriteCollision(sprite1, 32, 400);
|
||||
|
||||
game.debug.renderSpriteBody(sprite);
|
||||
// game.debug.renderSpriteBody(sprite2);
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
require('../foot.php');
|
||||
?>
|
||||
+42
-101
@@ -2,11 +2,10 @@
|
||||
* @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.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)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
+16
-21
@@ -2,10 +2,8 @@
|
||||
* @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.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 () {
|
||||
|
||||
|
||||
+17
-20
@@ -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 () {
|
||||
|
||||
|
||||
+41
-26
@@ -2,7 +2,6 @@
|
||||
* @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.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.
|
||||
* <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
|
||||
* @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).
|
||||
* <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
|
||||
*/
|
||||
* Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
|
||||
* <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
|
||||
*
|
||||
* @method Phaser.Signal#dispose
|
||||
*/
|
||||
dispose: function () {
|
||||
this.removeAll();
|
||||
delete this._bindings;
|
||||
@@ -273,8 +286,10 @@ Phaser.Signal.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {string} String representation of the object.
|
||||
*/
|
||||
*
|
||||
* @method Phaser.Signal#toString
|
||||
* @return {string} String representation of the object.
|
||||
*/
|
||||
toString: function () {
|
||||
return '[Phaser.Signal active:'+ this.active +' numListeners:'+ this.getNumListeners() +']';
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
* @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.SignalBinding
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Phaser.SignalBinding
|
||||
*
|
||||
@@ -77,7 +75,7 @@ Phaser.SignalBinding.prototype = {
|
||||
/**
|
||||
* Call listener passing arbitrary parameters.
|
||||
* <p>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.</p>
|
||||
* @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.
|
||||
* <p>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 () {
|
||||
|
||||
+80
-1
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user