mirror of
https://github.com/photonstorm/phaser
synced 2024-11-17 10:18:42 +00:00
Merge pull request #4170 from maikthomas/issue/4168-staticbody-drawdebug-circle
[issue/4168] draw circular StaticBody as circle in drawDebug
This commit is contained in:
commit
824e224042
1 changed files with 12 additions and 1 deletions
|
@ -788,10 +788,21 @@ var StaticBody = new Class({
|
|||
{
|
||||
var pos = this.position;
|
||||
|
||||
var x = pos.x + this.halfWidth;
|
||||
var y = pos.y + this.halfHeight;
|
||||
|
||||
if (this.debugShowBody)
|
||||
{
|
||||
graphic.lineStyle(1, this.debugBodyColor, 1);
|
||||
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
|
||||
if (this.isCircle)
|
||||
{
|
||||
graphic.strokeCircle(x, y, this.width / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue