Matter.js Bodies
Matter.js Composite
Matter.js Engine
Bounds of the layer
Whether or not the bounds are active
Matter.js engine instance
Unique ID of the layer
Last time the physics were updated in the layer
Objects in the layer
How the layer processes camrea position. [1, 1] by default. [0, 0] would mean the layer is fixed to the camera, [1, 1] would mean the layer moves with the camera, [2, 2] would mean the layer moves at twice the speed of the camera, etc.
Whether or not the layer has physics enabled
Adds an object to the layer
The object to add to the layer
A reference to the parent scene
Draws the layer onto the provided drawing context. This is handled automatically with scene and scene managers
The DrawOptions for the layer
Removes an object from the layer
The object to remove from the layer
Sets the boundaries of a scene
How far to the right objects can go
How far down objects can go
The canvas that the layer is drawn on
Whether or not to activate the bounds. True by default. If the scene has physics enabled, the bounds will be activated no matter what.
Generated using TypeDoc
Classdesc
Layer class, used for creating layers in the scene. Layers are independent of each other, and can have their own physics engines, objects, etc. Like multiple scenes within a single scene, drawn on top of each other.
Example