Phaser API Documentation

  Version: 
Filter
Namespace: Enable
Phaser.Physics.Arcade.Components.Enable

Methods

enableBody([reset], [x], [y], [enableGameObject], [showGameObject])
Focus
Focus

Description:

Enables this Game Object's Body. If you reset the Body you must also pass x and y.

Parameters:

name type arguments description
reset boolean <optional>

Also reset the Body and place the Game Object at (x, y).

x number <optional>

The horizontal position to place the Game Object, if reset is true.

y number <optional>

The horizontal position to place the Game Object, if reset is true.

enableGameObject boolean <optional>

Also set this Game Object's active to true.

showGameObject boolean <optional>

Also set this Game Object's visible to true.

Returns:
Description:

This Game Object.

Since: 3.0.0
Focus
Focus
disableBody([disableGameObject], [hideGameObject])
Focus
Focus

Description:

Stops and disables this Game Object's Body.

Parameters:

name type arguments Default description
disableGameObject boolean <optional> false

Also set this Game Object's active to false.

hideGameObject boolean <optional> false

Also set this Game Object's visible to false.

Returns:
Description:

This Game Object.

Since: 3.0.0
Focus
Focus
refreshBody()
Focus
Focus

Description:

Syncs the Body's position and size with its parent Game Object. You don't need to call this for Dynamic Bodies, as it happens automatically. But for Static bodies it's a useful way of modifying the position of a Static Body in the Physics World, based on its Game Object.

Returns:
Description:

This Game Object.

Since: 3.1.0
Focus
Focus