Physics.P2.BodyDebug

Class: Phaser.Physics.P2.BodyDebug

Constructor

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 登录查看完整内容