Phaser.Physics.Matter.PhysicsEditorParser

Scope: static

Source: src/physics/matter-js/PhysicsEditorParser.js#L15
Since: 3.10.0

Methods:

Public Members

parseBody

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

Description:

Parses a body element exported by PhysicsEditor.

Parameters:

nametypeoptionaldescription
xnumberNoThe horizontal world location of the body.
ynumberNoThe vertical world location of the body.
configobjectNoThe body configuration and fixture (child body) definitions, as exported by PhysicsEditor.
optionsPhaser.Types.Physics.Matter.MatterBodyConfigYesAn optional Body configuration object that is used to set initial Body properties on creation.

Returns: MatterJS.BodyType - A compound Matter JS Body.

Source: src/physics/matter-js/PhysicsEditorParser.js#L24
Since: 3.10.0


parseFixture

<static> parseFixture(fixtureConfig)

Description:

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

Parameters:

nametypeoptionaldescription
fixtureConfigobjectNoThe fixture object to parse.

Returns: Array.<MatterJS.BodyType> - - An array of Matter JS Bodies.

Source: src/physics/matter-js/PhysicsEditorParser.js#L70
Since: 3.10.0


parseVertices

<static> parseVertices(vertexSets, [options])

Description:

Parses the "vertices" lists exported by PhysicsEditor.

Parameters:

nametypeoptionaldescription
vertexSetsarrayNoThe vertex lists to parse.
optionsPhaser.Types.Physics.Matter.MatterBodyConfigYesAn optional Body configuration object that is used to set initial Body properties on creation.

Returns: Array.<MatterJS.BodyType> - - An array of Matter JS Bodies.

Source: src/physics/matter-js/PhysicsEditorParser.js#L104
Since: 3.10.0


Private Members

Updated on