Phaser API Documentation

  Version: 
create(x, y, width, height, options)

Description:

Creates a rectangle Matter body and adds it to the world.

Parameters:

name type description
x number

The horizontal position of the body in the world.

y number

The vertical position of the body in the world.

width number

The width of the body.

height number

The height of the body.

options object

Optional Matter configuration object.

Returns:
Description:

The Matter.js body that was created.

Type:
  • MatterJS.BodyType
Since: 3.0.0