Skip to main content
Version: Phaser v3.88.2

Phaser.Physics.Matter.PhysicsJSONParser

Scope: static

Source: src/physics/matter-js/PhysicsJSONParser.js#L10
Since: 3.22.0

Static functions

parseBody

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

Description:

Parses a body element from the given JSON data.

Parameters:

nametypeoptionaldescription
xnumberNoThe horizontal world location of the body.
ynumberNoThe vertical world location of the body.
configobjectNoThe body configuration data.
optionsPhaser.Types.Physics.Matter.MatterBodyConfigYesAn optional Body configuration object that is used to set initial Body properties on creation.

Returns: MatterJS.BodyType - A Matter JS Body.

Source: src/physics/matter-js/PhysicsJSONParser.js#L53
Since: 3.22.0