Add a layer.
Add an object to the instances living in the container.
The object to be added.
Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.
Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.
Create a new object from its name. The object is also added to the instances living in the container (No need to call gdjs.RuntimeScene.addObject)
Create objects from initial instances data (for example, the initial instances of the scene or the instances of an external layout).
The instances data
The offset on X axis
The offset on Y axis
The offset on Z axis
If true, objects are tracked by setting their persistentUuid
to the same as the associated instance. Useful for hot-reloading when instances are changed.
Activate or deactivate the debug visualization for collisions and points.
Get a list of all gdjs.RuntimeObject living in the container. You should not, normally, need this method at all. It's only to be used in exceptional use cases where you need to loop through all objects, and it won't be performant.
The list of all runtime objects in the container
Fill the array passed as argument with the names of all layers
The array where to put the layer names
Get the renderer for visual debugging associated to the container.
Return the time elapsed since the last frame, in milliseconds, for objects on the layer.
Get the gdjs.RuntimeGame associated to this.
Get the data representing the initial shared data of the scene for the specified behavior.
The name of the behavior
The shared data for the behavior, if any.
Return the number of instances of the specified object living in the container.
The object name for which instances must be counted.
The name of the object
the instances of a given object in the container.
Get the layer with the given name
The name of the layer
The layer, or the base layer if not found
Get all the instances of the object called name.
Name of the object for which the instances must be returned.
The list of objects with the given name
Get the renderer associated to the RuntimeScene.
Get the gdjs.RuntimeScene associated to this.
Check if a layer exists
The name of the layer
Check if an object is registered, meaning that instances of it can be created and lives in the container.
Load the container from the given initial configuration.
An object containing the container data.
Must be called whenever an object must be removed from the container.
The object to be removed.
Triggered when the AABB of a child of the container could have changed.
Called when the associated object is destroyed (because it is removed from its parent container or the scene is being unloaded).
The container owning the object.
Register a gdjs.RuntimeObject so that instances of it can be used in the container.
The data for the object to register.
Remove a layer. All gdjs.RuntimeObject on this layer will be moved back to the base layer.
The name of the layer to remove
Set the data representing the initial shared data of the scene for the specified behavior.
The name of the behavior
The shared data for the behavior, or null to remove it.
Change the position of a layer.
The name of the layer to reorder
Unregister a gdjs.RuntimeObject. Instances will be destroyed.
The name of the object to unregister.
Update the data of a gdjs.RuntimeObject so that instances use this when constructed.
The data for the object to register.
Update the objects positions according to their forces
the parent container that contains the object associated with this container.
the object that is built with the instances of this container.
Generated using TypeDoc
The instance container of a custom object, containing instances of objects rendered on screen.
gdjs.CustomRuntimeObject