Sets the current body from the collision group associated with the Tile. This is typically set up in Tiled's collision editor.
Note: Matter doesn't support all shapes from Tiled. Rectangles and polygons are directly supported. Ellipses are converted into circle bodies. Polylines are treated as if they are closed polygons. If a tile has multiple shapes, a multi-part body will be created. Concave shapes are supported if poly-decomp library is included. Decomposition is not guaranteed to work for complex shapes (e.g. holes), so it's often best to manually decompose a concave polygon into multiple convex polygons yourself.
name | type | arguments | description |
---|---|---|---|
options | Phaser.Types.Physics.Matter.MatterBodyTileOptions | <optional> |
Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. |
This TileBody object.