Namespace: Velocity

Phaser.Physics.Matter.Components. Velocity

[description]

Since: 3.0.0
Source: src/physics/matter-js/components/Velocity.js (Line 9)

Methods


setAngularVelocity(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: src/physics/matter-js/components/Velocity.js (Line 17)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setVelocity(x [, y])

Sets both the horizontal and vertical velocity of the physics body.

Parameters:
Name Type Argument Default Description
x number

The horizontal velocity value.

y number <optional>
x

The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the x value.

Since: 3.0.0
Source: src/physics/matter-js/components/Velocity.js (Line 72)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setVelocityX(x)

Sets the horizontal velocity of the physics body.

Parameters:
Name Type Description
x number

The horizontal velocity value.

Since: 3.0.0
Source: src/physics/matter-js/components/Velocity.js (Line 34)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject

setVelocityY(y)

Sets vertical velocity of the physics body.

Parameters:
Name Type Description
y number

The vertical velocity value.

Since: 3.0.0
Source: src/physics/matter-js/components/Velocity.js (Line 53)
Returns:

This Game Object.

Type
Phaser.GameObjects.GameObject