Scope: static
Source: src/physics/arcade/components/Gravity.js#L7
Since: 3.0.0
Methods:
Public Members
setGravity
<instance> setGravity(x, [y])
Description:
Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect.
If only one value is provided, this value will be used for both the X and Y axis.
Parameters:
name | type | optional | default | description |
---|---|---|---|---|
x | number | No | The gravitational force to be applied to the X-axis. | |
y | number | Yes | "x" | The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. |
Returns: Phaser.Physics.Arcade.Components.Gravity - This Game Object.
Source: src/physics/arcade/components/Gravity.js#L16
Since: 3.0.0
setGravityX
<instance> setGravityX(x)
Description:
Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect.
Parameters:
name | type | optional | description |
---|---|---|---|
x | number | No | The gravitational force to be applied to the X-axis. |
Returns: Phaser.Physics.Arcade.Components.Gravity - This Game Object.
Source: src/physics/arcade/components/Gravity.js#L36
Since: 3.0.0
setGravityY
<instance> setGravityY(y)
Description:
Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect.
Parameters:
name | type | optional | description |
---|---|---|---|
y | number | No | The gravitational force to be applied to the Y-axis. |
Returns: Phaser.Physics.Arcade.Components.Gravity - This Game Object.
Source: src/physics/arcade/components/Gravity.js#L53
Since: 3.0.0