Namespace: BodyScale

Phaser.Physics.Impact.Components. BodyScale

The Impact Body Scale component. Should be applied as a mixin.

Since: 3.0.0
Source: src/physics/impact/components/BodyScale.js (Line 7)

Methods


setBodyScale(scaleX [, scaleY])

Sets the scale of the physics body.

Parameters:
Name Type Argument Description
scaleX number

The horizontal scale of the body.

scaleY number <optional>

The vertical scale of the body. If not given, will use the horizontal scale value.

Since: 3.0.0
Source: src/physics/impact/components/BodyScale.js (Line 37)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.Components.BodyScale

setBodySize(width [, height])

Sets the size of the physics body.

Parameters:
Name Type Argument Default Description
width number

The width of the body in pixels.

height number <optional>
width

The height of the body in pixels.

Since: 3.0.0
Source: src/physics/impact/components/BodyScale.js (Line 16)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.Components.BodyScale