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: PhysicsJSONParser
Phaser.Physics.Matter.PhysicsJSONParser

Methods

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

Description:

Parses a body element from the given JSON data.

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 data.

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 Matter JS Body.

Type:
  • MatterJS.BodyType
Examples:
Since: 3.22.0
Focus
Focus