Physics.P2.BodyDebug#BodyDebug

new BodyDebug(game, body, settings)

Draws a P2 Body to a Graphics instance for visual debugging.
Needless to say, for every body you enable debug drawing on, you are adding processor and graphical overhead.
So use sparingly and rarely (if ever) in production code.

Also be aware that the Debug body is only updated when the Sprite it is connected to changes position. If you
manipulate the sprite in any other way (such as moving it to another Group or bringToTop, etc) then you will
need to manually adjust its BodyDebug as well.

Parameters
Name Type Description
game Phaser.Game

Game reference to the currently running game.

body Phaser.Physics.P2.Body

The P2 Body to display debug data for.

settings object

Settings object.

Source code: physics/p2/BodyDebug.js (Line 24)
doc_phaser
2017-02-14 11:02:51
Comments
Leave a Comment

Please login to continue.