Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: PhysicsEditorParser
Phaser.Physics.Matter.PhysicsEditorParser

Methods

<static> parseBody(x, y, config, [options])
Focus
Focus

Description:

Parses a body element exported by PhysicsEditor.

Parameters:

name type arguments description
x number

The horizontal world location of the body.

y number

The vertical world location of the body.

config object

The body configuration and fixture (child body) definitions, as exported by PhysicsEditor.

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

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

Returns:
Description:

A compound Matter JS Body.

Type:
  • MatterJS.BodyType
Examples:
Since: 3.10.0
Focus
Focus
<static> parseFixture(fixtureConfig)
Focus
Focus

Description:

Parses an element of the "fixtures" list exported by PhysicsEditor

Parameters:

name type description
fixtureConfig object

The fixture object to parse.

Returns:
Description:
  • An array of Matter JS Bodies.
Type:
  • Array.
Examples:
Since: 3.10.0
Focus
Focus
<static> parseVertices(vertexSets, [options])
Focus
Focus

Description:

Parses the "vertices" lists exported by PhysicsEditor.

Parameters:

name type arguments description
vertexSets array

The vertex lists to parse.

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

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

Returns:
Description:
  • An array of Matter JS Bodies.
Type:
  • Array.
Examples:
Since: 3.10.0
Focus
Focus