Skip to content

Commit 58f4b07

Browse files
committed
Clarified relationship between Sprite and BodyDebug phaserjs#1795
1 parent b481402 commit 58f4b07

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/physics/p2/BodyDebug.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* Needless to say, for every body you enable debug drawing on, you are adding processor and graphical overhead.
1111
* So use sparingly and rarely (if ever) in production code.
1212
*
13+
* Also be aware that the Debug body is only updated when the Sprite it is connected to changes position. If you
14+
* manipulate the sprite in any other way (such as moving it to another Group or bringToTop, etc) then you will
15+
* need to manually adjust its BodyDebug as well.
16+
*
1317
* @class Phaser.Physics.P2.BodyDebug
1418
* @constructor
1519
* @extends Phaser.Group
@@ -111,7 +115,8 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {
111115
{
112116
this.drawCircle(sprite, offset[0] * this.ppu, offset[1] * this.ppu, angle, child.radius * this.ppu, color, lw);
113117
}
114-
else if (child instanceof p2.Capsule) {
118+
else if (child instanceof p2.Capsule)
119+
{
115120
this.drawCapsule(sprite, offset[0] * this.ppu, offset[1] * this.ppu, angle, child.length * this.ppu, child.radius * this.ppu, lineColor, color, lw);
116121
}
117122
else if (child instanceof p2.Plane)

0 commit comments

Comments
 (0)