photonstorm/phaser — pull request #536 by georgiee (2014-03-10 13:36:06+00:00)
Title: Debug draw p2

Hi,
I integrated the core of the debug drawing from https://github.com/photonstorm/phaser/pull/503 in the current Phaser P2 Engine. It's should be easily adaptable to other engines. I introduced the class Phaser.Physics.P2.BodyDebug for this purpose.

``` javascript
//new third parameter to enable debugging
game.physics.enable(sprite, Phaser.Physics.P2, true)
```
All created debug groups(to draw on) are added to the world container. Maybe we can introduce a global debug container if this has some side effects. I do not want to create a group or graphics object as a child of the sprite. I think this could interfere with any queries related to the childs of the sprite ?

Regards