Namespace: PhysicsEditorParser

Phaser.Physics.Matter. PhysicsEditorParser

Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor).

Since: 3.10.0
Source: src/physics/matter-js/PhysicsEditorParser.js (Line 15)

Methods


<static> parseBody(x, y, w, h, config)

Parses a body element exported by PhysicsEditor.

Parameters:
Name Type Description
x number

x position.

y number

y position.

w number

width.

h number

height.

config object

body configuration and fixture (child body) definitions.

Since: 3.10.0
Source: src/physics/matter-js/PhysicsEditorParser.js (Line 24)
Returns:

A matter body, consisting of several parts (child bodies)

Type
object

<static> parseFixture(fixtureConfig)

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

Parameters:
Name Type Description
fixtureConfig object

the fixture object to parse

Since: 3.10.0
Source: src/physics/matter-js/PhysicsEditorParser.js (Line 69)
Returns:
  • A list of matter bodies
Type
Array.<object>

<static> parseVertices(vertexSets, options)

Parses the "vertices" lists exported by PhysicsEditor.

Parameters:
Name Type Description
vertexSets object

The vertex lists to parse.

options object

Matter body options.

Since: 3.10.0
Source: src/physics/matter-js/PhysicsEditorParser.js (Line 103)
Returns:
  • A list of matter bodies.
Type
Array.<object>