Skip to content

Commit 2859eb6

Browse files
committed
Added new Set Body Config
1 parent 28a7cca commit 2859eb6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @typedef {object} Phaser.Types.Physics.Matter.MatterSetBodyConfig
3+
* @since 3.22.0
4+
*
5+
* @property {string} [type='rectangle'] - The shape type. Either `rectangle`, `circle`, `trapezoid`, `polygon`, `fromVertices`, `fromVerts` or `fromPhysicsEditor`.
6+
* @property {number} [x] - The horizontal world position to place the body at.
7+
* @property {number} [y] - The vertical world position to place the body at.
8+
* @property {number} [width] - The width of the body.
9+
* @property {number} [height] - The height of the body.
10+
* @property {number} [radius] - The radius of the body. Used by `circle` and `polygon` shapes.
11+
* @property {number} [maxSides=25] - The max sizes of the body. Used by the `circle` shape.
12+
* @property {number} [slope=0.5] - Used by the `trapezoid` shape. The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter.
13+
* @property {number} [sides=5] - Used by the `polygon` shape. The number of sides the polygon will have.
14+
* @property {(string|array)} [verts] - Used by the `fromVerts` shape. The vertices data. Either a path string or an array of vertices.
15+
* @property {boolean} [flagInternal=false] - Used by the `fromVerts` shape. Flag internal edges (coincident part edges)
16+
* @property {number} [removeCollinear=0.01] - Used by the `fromVerts` shape. Whether Matter.js will discard collinear edges (to improve performance).
17+
* @property {number} [minimumArea=10] - Used by the `fromVerts` shape. During decomposition discard parts that have an area less than this.
18+
* @property {boolean} [addToWorld=true] - Should the new body be automatically added to the world?
19+
*/

0 commit comments

Comments
 (0)