More docs.

This commit is contained in:
Richard Davey
2013-10-02 11:22:48 +01:00
parent 82325ecc8a
commit 6ce6330f50
32 changed files with 883 additions and 1110 deletions
+80 -1
View File
@@ -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)
}
};