mirror of
https://github.com/photonstorm/phaser
synced 2024-09-20 22:41:54 +00:00
Fixed the body debug calls for Box2D.
This commit is contained in:
parent
c195998a1e
commit
e8ca670fba
1 changed files with 13 additions and 10 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue