Creates a new RenderLayer instance
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
RenderLayerOptions |
Configuration options for the RenderLayer |
||
options.sortableChildren |
boolean |
<optional> |
false |
If true, layer children will be automatically sorted each render |
options.sortFunction |
Function |
<optional> |
Custom function to sort layer children. Default sorts by zIndex |
Extends
- null
Members
defaultOptions RenderLayerOptions static
Default options for RenderLayer instances
Properties:
Name | Type | Description |
---|---|---|
sortableChildren |
boolean |
If true, layer children will be automatically sorted each render. Default false. |
sortFunction |
Function |
Function used to sort layer children. Default sorts by zIndex. |
renderLayerChildren Container[]
List of objects to be rendered by this layer
Function used to sort layer children if sortableChildren is true
Methods
Add an Container to this render layer. The Container will be rendered as part of this layer while maintaining its original parent in the scene graph. If the Container already belongs to a layer, it will be removed from the old layer before being added to this one.
Name | Type | Description |
---|---|---|
children |
U |
The Container(s) to add to this layer |
Returns:
Type | Description |
---|---|
U[0] |
Remove an Container from this render layer. The Container will no longer be rendered as part of this layer but maintains its original parent.
Name | Type | Description |
---|---|---|
children |
U |
The Container(s) to remove from this layer |
Returns:
Type | Description |
---|---|
U[0] |
Remove all objects from this render layer.
Sort the layer's children using the defined sort function. Will be called each render if sortableChildren is true. Otherwise can call this manually.