The game associated to this scene.
A network ID associated to the scene to be used for multiplayer, to identify the scene across peers. A scene can have its networkId re-generated during the game, meaning that the scene is re-created on every peer.
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.
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
The scene's async tasks manager.
Get the renderer for visual debugging associated to the container.
Get the gdjs.RuntimeGame associated to this.
the right bound of:
the bottom bound of:
the left bound of:
the top bound of:
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 structure containing the triggers for "Trigger once" conditions.
Get the renderer associated to the container.
Return the value of the scene change that is requested.
Get the gdjs.RuntimeScene associated to this.
Shortcut to get the SoundManager of the game.
The gdjs.SoundManager of the game.
Get the TimeManager of the scene.
The gdjs.TimeManager of the scene.
the right bound of:
the bottom bound of:
the left bound of:
the top bound of:
Get the variables of the runtimeScene.
The container holding the variables of the scene.
Get the extension's variables for this scene.
The extension name.
The extension's variables for this scene.
the height of:
the center X of:
the center Y of:
the width of:
Must be called whenever an object must be removed from the container.
The object to be removed.
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
Request a scene change to be made. The change is handled externally (see gdjs.SceneStack) thanks to getRequestedChange and getRequestedScene methods.
One of RuntimeScene.CONTINUE|PUSH_SCENE|POP_SCENE|REPLACE_SCENE|CLEAR_SCENES|STOP_GAME.
Optional
sceneName: stringThe name of the new scene to launch, if applicable.
Change the background color, by setting the RGB components. Internally, the color is stored as an hexadecimal number.
The color red component (0-255).
The color green component (0-255).
The color blue component (0-255).
Set the function called each time the scene is stepped.
The function will be passed the runtimeScene
as argument.
Note that this is already set up by the gdjs.RuntimeScene constructor and that you should not need to use this method.
The function to be called.
Set the function called each time the scene is stepped to be the events generated code,
which is by convention assumed to be a function in gdjs
with a name based on the scene
mangled name.
The scene data, used to find where the code was generated.
Start a new profiler to measures the time passed in sections of the engine in the scene.
Function to be called when the profiler is stopped. Will be passed the profiler as argument.
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.
A scene being played, containing instances of objects rendered on screen.