Namespace: Matter

Phaser.Types.Physics. Matter

Type Definitions


MatterBodyTileOptions

Type:
  • object
Properties:
Name Type Argument Default Description
isStatic boolean <optional>
true

Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved.

addToWorld boolean <optional>
true

Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world.

Since: 3.0.0
Source: src/physics/matter-js/typedefs/MatterBodyTileOptions.js (Line 1)

MatterTileOptions

Type:
  • object
Properties:
Name Type Argument Default Description
body MatterJS.Body <optional>
null

An existing Matter body to be used instead of creating a new one.

isStatic boolean <optional>
true

Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved.

addToWorld boolean <optional>
true

Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world.

Since: 3.0.0
Source: src/physics/matter-js/typedefs/MatterTileOptions.js (Line 1)

MatterWorldConfig

Type:
  • object
Properties:
Name Type Argument Default Description
gravity Phaser.Types.Math.Vector2Like <optional>

Sets Phaser.Physics.Matter.World#gravity.

setBounds object | boolean <optional>

Should the world have bounds enabled by default?

Properties
Name Type Argument Default Description
x number <optional>
0

The x coordinate of the world bounds.

y number <optional>
0

The y coordinate of the world bounds.

width number <optional>

The width of the world bounds.

height number <optional>

The height of the world bounds.

thickness number <optional>
64

The thickness of the walls of the world bounds.

left boolean <optional>
true

Should the left-side world bounds wall be created?

right boolean <optional>
true

Should the right-side world bounds wall be created?

top boolean <optional>
true

Should the top world bounds wall be created?

bottom boolean <optional>
true

Should the bottom world bounds wall be created?

positionIterations number <optional>
6

The number of position iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance.

velocityIterations number <optional>
4

The number of velocity iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance.

constraintIterations number <optional>
2

The number of constraint iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance.

enableSleeping boolean <optional>
false

A flag that specifies whether the engine should allow sleeping via the Matter.Sleeping module. Sleeping can improve stability and performance, but often at the expense of accuracy.

timing.timestamp number <optional>
0

A Number that specifies the current simulation-time in milliseconds starting from 0. It is incremented on every Engine.update by the given delta argument.

timing.timeScale number <optional>
1

A Number that specifies the global scaling factor of time for all bodies. A value of 0 freezes the simulation. A value of 0.1 gives a slow-motion effect. A value of 1.2 gives a speed-up effect.

enabled boolean <optional>
true

Toggles if the world is enabled or not.

correction number <optional>
1

An optional Number that specifies the time correction factor to apply to the update.

getDelta function <optional>

This function is called every time the core game loop steps, which is bound to the Request Animation Frame frequency unless otherwise modified.

autoUpdate boolean <optional>
true

Automatically call Engine.update every time the game steps.

debug boolean <optional>
false

Sets if Matter will render to the debug Graphic overlay. Do not enable this in production.

debugShowBody boolean <optional>
true

Should dynamic bodies be drawn to the debug graphic?

debugShowStaticBody boolean <optional>
true

Should static bodies be drawn to the debug graphic?

debugShowVelocity boolean <optional>
true

Should the velocity vector be drawn to the debug graphic?

debugBodyColor number <optional>
0xff00ff

The color that dynamic body debug outlines are drawn in.

debugBodyFillColor number <optional>
0xe3a7e3

The color that dynamic body debug fills are drawn in.

debugStaticBodyColor number <optional>
0x0000ff

The color that static body debug outlines are drawn in.

debugVelocityColor number <optional>
0x00ff00

The color that the debug velocity vector lines are drawn in.

debugShowJoint boolean <optional>
true

Render joints to the debug graphic.

debugJointColor number <optional>
0x000000

The color that the debug joints are drawn in.

debugWireframes boolean <optional>
true

Render the debug output as wireframes.

debugShowInternalEdges boolean <optional>
false

Render internal edges to the debug.

debugShowConvexHulls boolean <optional>
false

Render convex hulls to the debug.

debugConvexHullColor number <optional>
0xaaaaaa

The color that the debug convex hulls are drawn in, if enabled.

debugShowSleeping boolean <optional>
false

Render sleeping bodies the debug.

Since: 3.0.0
Source: src/physics/matter-js/typedefs/MatterWorldConfig.js (Line 1)