Provides methods used for setting the enable properties of an Arcade Physics Body.
- Since: 3.0.0
- Source: src/physics/arcade/components/Enable.js (Line 7)
Methods
-
disableBody( [disableGameObject] [, hideGameObject])
-
Stops and disables this Game Object's Body.
Parameters:
Name Type Argument Default Description disableGameObjectboolean <optional>
false Also deactivate this Game Object.
hideGameObjectboolean <optional>
false Also hide this Game Object.
- Since: 3.0.0
- Source: src/physics/arcade/components/Enable.js (Line 58)
- See:
-
- Phaser.Physics.Arcade.Body#enable
- Phaser.Physics.Arcade.StaticBody#enable
- Phaser.GameObjects.GameObject#active
- Phaser.GameObjects.GameObject#visible
Returns:
This Game Object.
-
enableBody(reset, x, y, enableGameObject, showGameObject)
-
Enables this Game Object's Body.
Parameters:
Name Type Description resetboolean Also reset the Body and place it at (x, y).
xnumber The horizontal position to place the Game Object and Body.
ynumber The horizontal position to place the Game Object and Body.
enableGameObjectboolean Also activate this Game Object.
showGameObjectboolean Also show this Game Object.
- Since: 3.0.0
- Source: src/physics/arcade/components/Enable.js (Line 15)
- See:
Returns:
This Game Object.
-
refreshBody()
-
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.
- Since: 3.1.0
- Source: src/physics/arcade/components/Enable.js (Line 96)
- See:
Returns:
This Game Object.
