A tool for for running and testing example scenes.
Creates a new demo instance. See example for options and usage.
- {} options
Starts a new demo instance by running the first or given example. See example for options and usage.
- demo demo
- string [initalExampleId] example to start (defaults to first)
Stops the currently running example in the demo.
This requires that the example.init
function returned
an object specifiying a stop
function.
- demo demo
Stops and restarts the currently running example.
- demo demo
Starts the given example by its id. Any running example will be stopped.
- demo demo
- string exampleId
Starts the given example. Any running example will be stopped.
- demo demo
- example example
Enables or disables the inspector tool.
If enabled
a new Inspector
instance will be created and the old one destroyed.
- demo demo
- bool enabled
Enables or disables the Gui tool.
If enabled
a new Gui
instance will be created and the old one destroyed.
- demo demo
- bool enabled
A tool for modifying the properties of an engine and renderer.
Creates a Gui
- engine [engine]
- runner [runner]
- render [render]
- gui The created gui instance
Updates the Gui
- gui gui
Closes all sections of the Gui
- gui gui
Destroys the GUI
- gui gui
Events Documentation
Fired after the gui's clear button pressed
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the gui's save button pressed
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the gui's load button pressed
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
A tool for inspecting worlds.
Creates an inspector
- engine engine
- render [render]
- object options
- inspector The created inspector instance.
Destroys the inspector
- Inspector inspector
Events Documentation
Fired after the inspector's import button pressed
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the inspector's export button pressed
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the inspector user starts making a selection
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the inspector user ends making a selection
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the inspector is paused
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
Fired after the inspector is played
- {} event An event object
- {} event.source The source object of the event
- {} event.name The name of the event
An (experimental) tool for serializing matter.js worlds.
Creates a serializer.
- {} A serializer
Clones an object using a serializer and assigns it a new id
- object serializer
- object object
- {} The clone
Saves world state to local storage
- object serializer
- engine engine
- string key
Loads world state from local storage
- object serializer
- engine engine
- string key
Serialises the object using the given serializer and a Matter-specific replacer
- object serializer
- object object
- number indent
- string The serialised object