diff --git a/src/utils/Debug.js b/src/utils/Debug.js index 889f5cd0c..693d240e7 100644 --- a/src/utils/Debug.js +++ b/src/utils/Debug.js @@ -740,18 +740,22 @@ Phaser.Utils.Debug.prototype = { if (sprite.body) { + this.start(); + if (sprite.body.type === Phaser.Physics.ARCADE) { - this.start(); Phaser.Physics.Arcade.Body.render(this.context, sprite.body, color, filled); - this.stop(); } else if (sprite.body.type === Phaser.Physics.NINJA) { - this.start(); Phaser.Physics.Ninja.Body.render(this.context, sprite.body, color, filled); - this.stop(); } + else if (sprite.body.type === Phaser.Physics.BOX2D) + { + Phaser.Physics.Box2D.renderBody(this.context, sprite.body, color); + } + + this.stop(); } }, @@ -769,18 +773,18 @@ Phaser.Utils.Debug.prototype = { if (sprite.body) { + this.start(x, y, color, 210); + if (sprite.body.type === Phaser.Physics.ARCADE) { - this.start(x, y, color, 210); Phaser.Physics.Arcade.Body.renderBodyInfo(this, sprite.body); - this.stop(); } else if (sprite.body.type === Phaser.Physics.BOX2D) { - this.start(x, y, color, 210); this.game.physics.box2d.renderBodyInfo(this, sprite.body); - this.stop(); } + + this.stop(); } }, @@ -805,8 +809,7 @@ Phaser.Utils.Debug.prototype = { /** * Renders 'debug draw' data for the given Box2D body. - * This uses the standard debug drawing feature of Box2D, so colors will be decided by - * the Box2D engine. + * This uses the standard debug drawing feature of Box2D, so colors will be decided by the Box2D engine. * * @method Phaser.Utils.Debug#box2dBody * @param {Phaser.Sprite} sprite - The sprite whos body will be rendered.