Phaser.Physics.Arcade.Components.Friction

Scope: static

Source: src/physics/arcade/components/Friction.js#L7
Since: 3.0.0

Methods:

Public Members

setFriction

<instance> setFriction(x, [y])

Description:

Sets the friction of this game object's physics body. In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.

Parameters:

nametypeoptionaldefaultdescription
xnumberNoThe amount of horizontal friction to apply, [0, 1].
ynumberYes"x"The amount of vertical friction to apply, [0, 1].

Returns: Phaser.Physics.Arcade.Components.Friction - This Game Object.

Source: src/physics/arcade/components/Friction.js#L19
Since: 3.0.0


setFrictionX

<instance> setFrictionX(x)

Description:

Sets the horizontal friction of this game object's physics body. This can move a riding body horizontally when it collides with this one on the vertical axis.

Parameters:

nametypeoptionaldescription
xnumberNoThe amount of friction to apply, [0, 1].

Returns: Phaser.Physics.Arcade.Components.Friction - This Game Object.

Source: src/physics/arcade/components/Friction.js#L40
Since: 3.0.0


setFrictionY

<instance> setFrictionY(y)

Description:

Sets the vertical friction of this game object's physics body. This can move a riding body vertically when it collides with this one on the horizontal axis.

Parameters:

nametypeoptionaldescription
ynumberNoThe amount of friction to apply, [0, 1].

Returns: Phaser.Physics.Arcade.Components.Friction - This Game Object.

Source: src/physics/arcade/components/Friction.js#L60
Since: 3.0.0


Private Members

Updated on