Add a layer.
The data to construct the layer
Add an object to the instances living on the scene.
The object to be added.
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 on the scene ( No need to call 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
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 on the scene. 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 on the scnee
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 the runtimeGame associated to the RuntimeScene.
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 on the scene.
The object name for which instances must be counted.
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 RuntimeScene.
Return the value of the scene change that is requested.
Return the name of the new scene to be launched.
See requestChange.
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.
Get the variables of the runtimeScene.
The container holding the variables of the scene.
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 scene.
Load the runtime scene from the given scene.
An object containing the scene data.
Must be called whenever an object must be removed from the scene.
The object to be removed.
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 scene.
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.
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 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
The new position in the list of layers
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.
Generated using TypeDoc
A scene being played, containing instances of objects rendered on screen.