Namespace: Transform

Phaser.Physics.Matter.Components. Transform

Provides methods used for getting and setting the position, scale and rotation of a Game Object.

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

Members


angle :number

Use angle to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 146)

rotation :number

Use rotation to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 167)

scaleX :number

The horizontal scale of this Game Object.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 71)

scaleY :number

The vertical scale of this Game Object.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 109)

x :number

The x position of this Game Object.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 25)

y :number

The y position of this Game Object.

Type:
  • number
Since: 3.0.0
Source: src/physics/matter-js/components/Transform.js (Line 48)

Methods


setAngle( [degrees])

[description]

Parameters:
Name Type Argument Default Description
degrees number <optional>
0

[description]

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

This Game Object.

Type
Phaser.Physics.Matter.Components.Transform

setFixedRotation()

[description]

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

This Game Object.

Type
Phaser.Physics.Matter.Components.Transform

setPosition( [x] [, y])

Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0.

Parameters:
Name Type Argument Default Description
x number <optional>
0

The horizontal position of the body.

y number <optional>
x

The vertical position of the body.

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

This Game Object.

Type
Phaser.Physics.Matter.Components.Transform

setRotation( [radians])

[description]

Parameters:
Name Type Argument Default Description
radians number <optional>
0

[description]

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

This Game Object.

Type
Phaser.Physics.Matter.Components.Transform

setScale( [x] [, y] [, point])

Sets the scale of this Game Object.

Parameters:
Name Type Argument Default Description
x number <optional>
1

The horizontal scale of this Game Object.

y number <optional>
x

The vertical scale of this Game Object. If not set it will use the x value.

point Phaser.Math.Vector2 <optional>

The point (Vector2) from which scaling will occur.

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

This Game Object.

Type
Phaser.Physics.Matter.Components.Transform