Namespace: SetBody

Phaser.Physics.Matter.Components. SetBody

[description]

Since: 3.0.0
Source: src/physics/matter-js/components/SetBody.js (Line 13)

Methods


setBody(config, options)

[description]

Parameters:
Name Type Description
config object

[description]

options object

[description]

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

This Game Object.

Type
Phaser.GameObjects.GameObject

setCircle(radius, options)

[description]

Parameters:
Name Type Description
radius number

[description]

options object

[description]

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

This Game Object.

Type
Phaser.GameObjects.GameObject

setExistingBody(body [, addToWorld])

[description]

Parameters:
Name Type Argument Default Description
body MatterJS.Body

[description]

addToWorld boolean <optional>
true

[description]

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

This Game Object.

Type
Phaser.GameObjects.GameObject

setPolygon(radius, sides, options)

Set the body on the Game Object to a polygon shape.

Parameters:
Name Type Description
radius number

The radius of the polygon.

sides number

The amount of sides creating the polygon.

options object

A matterjs config object.

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

This Game Object.

Type
Phaser.GameObjects.GameObject

setRectangle(width, height, options)

Set the body on a Game Object to a rectangle.

Parameters:
Name Type Description
width number

Width of the rectangle.

height number

Height of the rectangle.

options object

[description]

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

This Game Object.

Type
Phaser.GameObjects.GameObject

setTrapezoid(width, height, slope, options)

Creates a new matterjs trapezoid body.

Parameters:
Name Type Description
width number

The width of the trapezoid.

height number

The height of the trapezoid.

slope number

The angle of slope for the trapezoid.

options object

A matterjs config object for the body.

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

This Game Object.

Type
Phaser.GameObjects.GameObject