Phaser API Documentation

  Version: 
circle(x, y, radius, [options], [maxSides])

Description:

Creates a new rigid circular Body and adds it to the World.

Parameters:

name type arguments description
x number

The X coordinate of the center of the Body.

y number

The Y coordinate of the center of the Body.

radius number

The radius of the circle.

options Phaser.Types.Physics.Matter.MatterBodyConfig <optional>

An optional Body configuration object that is used to set initial Body properties on creation.

maxSides number <optional>

The maximum amount of sides to use for the polygon which will approximate this circle.

Returns:
Description:

A Matter JS Body.

Type:
  • MatterJS.BodyType
Since: 3.0.0