Add a layer.
The data to construct the 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.
The x position, in container coordinates.
The y position, in container coordinates.
The point instance that is used to return the result.
Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.
The x position, in container coordinates.
The y position, in container coordinates.
The point instance that is used to return the result.
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)
The name of the object to be created
The created object
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.
the right bound of:
the bottom bound of:
the left bound of:
the top bound of:
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 container.
Get the gdjs.RuntimeScene associated to this.
the right bound of:
the bottom bound of:
the left bound of:
the top bound of:
the height of:
the center X of:
the center Y of:
the width of:
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.
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.
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
Generated using TypeDoc
A container of object instances rendered on screen.