Add a new effect, or replace the one with the same name.
The data of the effect to add.
Return an array containing the coordinates of the point passed as parameter in layer local coordinates (as opposed to the parent coordinates).
All transformations (scale, rotation) are supported.
Return an array containing the coordinates of the point passed as parameter in parent coordinate coordinates (as opposed to the layer local coordinates).
All transformations (scale, rotation) are supported.
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.
Enable or disable an effect.
The name of the effect to enable or disable.
true to enable, false to disable
Change the position, rotation and scale (zoom) of the layer camera to be the same as the base layer camera.
Get the camera height (which can be different than the game resolution height if the camera is zoomed).
The height of the camera
Get the rotation of the camera, expressed in degrees.
The rotation, in degrees.
Get the camera width (which can be different than the game resolution width if the camera is zoomed).
The width of the camera
Change the camera center X position.
The x position of the camera
Change the camera center Y position.
The y position of the camera
Get the camera center Z position.
The z position of the camera
Get the zoom of a camera.
The zoom.
The clear color is defined in the format [r, g, b], with components in the range of 0 to 1.
the clear color of layer in the range of [0, 1].
Get the default Z order to be attributed to objects created on this layer (usually from events generated code).
Return the time elapsed since the last frame, in milliseconds, for objects on the layer.
The instance container the layer belongs to (deprecated - can be omitted).
Return the initial effects data for the layer. Only to be used by renderers.
Get the name of the layer
The name of the layer
Returns the scene the layer belongs to directly or indirectly
the scene the layer belongs to directly or indirectly
Get the time scale for the objects on the layer.
Check if an effect exists on this layer
The name of the effect
true if the effect exists, false otherwise.
Check if an effect is enabled
The name of the effect
true if the effect is enabled, false otherwise.
Return true if the layer is a lighting layer, false otherwise.
true if it is a lighting layer, false otherwise.
Check if the layer is visible.
true if the layer is visible.
Called by the RuntimeScene whenever the game resolution size is changed. Updates the layer width/height and position.
Remove the effect with the specified name
The name of the effect.
Set the rotation of the camera, expressed in degrees. The rotation is made around the camera center.
Set the camera center X position.
Set the camera center Y position.
Set the camera center Z position.
Set the zoom of a camera.
Set the clear color in format [r, g, b], with components in the range of 0 to 1.;
Red color component in the range 0-255.
Green color component in the range 0-255.
Blue color component in the range 0-255.
Set the default Z order to be attributed to objects created on this layer.
The Z order to use when creating a new object from events.
Change an effect parameter value (for parameters that are booleans).
The name of the effect to update.
The name of the parameter to update.
The new value (boolean).
Change an effect parameter value (for parameters that are numbers).
The name of the effect to update.
The name of the parameter to update.
The new value (number).
Change an effect parameter value (for parameters that are strings).
The name of the effect to update.
The name of the parameter to update.
The new value (string).
Set whether layer's camera follows base layer's camera or not.
Set the time scale for the objects on the layer: time will be slower if time scale is < 1, faster if > 1.
The new time scale (must be positive).
Show (or hide) the layer.
true to show the layer, false to hide it.
Called at each frame, after events are run and before rendering.
The data used to initialize the layer
The container in which the layer is used
Generated using TypeDoc
Represents a layer of a custom object. It doesn't allow to move any camera because it doesn't make sense inside an object.