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.
This method doesn't handle 3D rotations.
The X position of the point, in parent coordinates.
The Y position of the point, in parent coordinates.
Array that will be updated with the result
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.
This method doesn't handle 3D rotations.
The X position of the point, in layer coordinates.
The Y position of the point, in layer coordinates.
Array that will be updated with the result (x and y position of the point in parent coordinates).
Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.
This method handles 3D rotations.
The x position, in canvas coordinates.
The y position, in canvas coordinates.
The camera number. Currently ignored.
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.
This method doesn't handle 3D rotations.
The x position, in container coordinates.
The y position, in container coordinates.
The camera number. Currently ignored.
The point instance that is used to return the result.
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 camera number. Currently ignored.
The height of the camera
Get the rotation of the camera, expressed in degrees.
The camera number. Currently ignored.
The rotation, in degrees.
Get the camera width (which can be different than the game resolution width if the camera is zoomed).
The camera number. Currently ignored.
The width of the camera
Change the camera center X position.
The camera number. Currently ignored.
The x position of the camera
Change the camera center Y position.
The camera number. Currently ignored.
The y position of the camera
Get the camera center Z position.
The field of view.
The camera number. Currently ignored.
The z position of the camera
Get the zoom of a camera.
The camera number. Currently ignored.
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 collection of effects to be rendered by the underlying renderer.
The renderer effects.
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.
The new rotation, in degrees.
The camera number. Currently ignored.
Set the camera center X position.
The new x position
The camera number. Currently ignored.
Set the camera center Y position.
The new y position
The camera number. Currently ignored.
Set the camera center Z position.
The new y position.
The field of view.
The camera number. Currently ignored.
Set the zoom of a camera.
The new zoom. Must be superior to 0. 1 is the default zoom.
The camera number. Currently ignored.
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 property value (for properties that are booleans).
The name of the effect to update.
The name of the property to update.
The new value (boolean).
Change an effect property value (for properties that are numbers).
The name of the effect to update.
The name of the property to update.
The new value (number).
Change an effect property value (for properties that are strings).
The name of the effect to update.
The name of the property 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 scene, used to display objects.