body(sprite, color, filled)
Render a Sprites Physics body if it has one set. The body is rendered as a filled or stroked rectangle.
This only works for Arcade Physics, Ninja Physics (AABB and Circle only) and Box2D Physics bodies.
To display a P2 Physics body you should enable debug mode on the body when creating it.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
sprite | Phaser.Sprite | The Sprite who's body will be rendered. | ||
color | string | <optional> | 'rgba(0,255,0,0.4)' | Color of the debug rectangle to be rendered. The format is a CSS color string such as '#ff0000' or 'rgba(255,0,0,0.5)'. |
filled | boolean | <optional> | true | Render the body as a filled rectangle (true) or a stroked rectangle (false) |
- Source code: utils/Debug.js (Line 747)
Please login to continue.