Skip to main content
Version: Phaser v4.1.0

Phaser.Physics.Arcade.Components.Debug

Scope: static

Source: src/physics/arcade/components/Debug.js#L7
Since: 3.0.0

Static functions​

setDebug​

<instance> setDebug(showBody, showVelocity, bodyColor)​

Description:

Sets the debug values of this body.

Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. Note that there is a performance cost in drawing debug displays. It should never be used in production.

Parameters:

nametypeoptionaldescription
showBodybooleanNoSet to true to have this body render its outline to the debug display.
showVelocitybooleanNoSet to true to have this body render a velocity marker to the debug display.
bodyColornumberNoThe color of the body outline when rendered to the debug display.

Returns: Phaser.Physics.Arcade.Components.Debug - This Game Object.

Source: src/physics/arcade/components/Debug.js#L20
Since: 3.0.0


setDebugBodyColor​

<instance> setDebugBodyColor(value)​

Description:

Sets the color of the body outline when it renders to the debug display.

Parameters:

nametypeoptionaldescription
valuenumberNoThe color of the body outline when rendered to the debug display.

Returns: Phaser.Physics.Arcade.Components.Debug - This Game Object.

Source: src/physics/arcade/components/Debug.js#L44
Since: 3.0.0


Static functions​

debugBodyColor​

debugBodyColor: number​

Description:

The color of the body outline when it renders to the debug display.

Source: src/physics/arcade/components/Debug.js#L103
Since: 3.0.0


debugShowBody​

debugShowBody: boolean​

Description:

Set to true to have this body render its outline to the debug display.

Source: src/physics/arcade/components/Debug.js#L61
Since: 3.0.0


debugShowVelocity​

debugShowVelocity: boolean​

Description:

Set to true to have this body render a velocity marker to the debug display.

Source: src/physics/arcade/components/Debug.js#L82
Since: 3.0.0