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 an identifier for a new object of the scene.
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
The scene's async tasks manager.
Get the background color, as an hexadecimal number.
The current background color.
Get whether the canvas should be cleared before this scene rendering.
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 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 the name of the scene.
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 profiler associated with the scene, or null if none.
Get the renderer associated to the container.
Return the value of the scene change that is requested.
Return the name of the new scene to be launched.
See requestChange.
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:
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 runtime scene from the given scene.
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.
Should be called when the canvas where the scene is rendered has been resized. See gdjs.RuntimeGame.startGameLoop in particular.
Called when a scene is "paused", i.e it will be not be rendered again for some time, until it's resumed or unloaded.
Called when a scene is "resumed", i.e it will be rendered again on screen after having being paused.
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
Render the PIXI container associated to the runtimeScene.
Step and render the scene.
In milliseconds
true if the game loop should continue, false if a scene change/push/pop or a game stop was requested.
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.
The name of the new scene to launch, if applicable.
Check if the scene was just resumed. This is true during the first frame after the scene has been unpaused.
true if the scene was just resumed
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 whether the canvas should be cleared before this scene rendering. This is experimental: if possible, try to avoid relying on this and use custom objects to build complex scenes.
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.
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
Stop the profiler being run on the scene.
Called before a scene is removed from the stack of scenes rendered on the screen.
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 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.
Generated using TypeDoc
A scene being played, containing instances of objects rendered on screen.