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 disableGameObject
boolean <optional>
false Also deactivate this Game Object.
hideGameObject
boolean <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 reset
boolean Also reset the Body and place it at (x, y).
x
number The horizontal position to place the Game Object and Body.
y
number The horizontal position to place the Game Object and Body.
enableGameObject
boolean Also activate this Game Object.
showGameObject
boolean 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.