Layer object

The Layer object allows you to access the properties of your scene's layers. Layers can be queried by using the Scene.GetLayer method.


Methods

Layer actions
GetNode Queries a given node (region/entity) of the layer.
Dynamic object creation
AddEntity Adds a new entity to the top of the layer
InsertEntity Inserts a new entity to the scene layer
AddRegion Adds a new region to the top of the layer
InsertRegion Inserts a new region to the scene layer
DeleteNode Permanently removes a scene node (entity or region) from a scene layer

Attributes

Type (read only) Returns always "layer"
Name The internal name of the layer
Active Specifies whether the layer is visible on screen
NumNodes (read only) Returns the number of nodes of the layer
Width (read only) Returns the width of the layer
Height (read only) Returns the height of the layer
Main (read only) Returns true if this is the scene's main layer
CloseUp Specifies whether this is a close-up layer

GetNode(NodeIndex)
GetNode(NodeName)

Queries a given node (region/entity) of the layer.

Parameters

NodeIndex
An index of the requested scene node
NodeName
A name of the requested scene node

Return value

Returns the requested node or null if a specified node doesn't exist.


AddEntity(EntityName)

Adds a new entity to the top of the layer

Parameters

EntityName
The name of the new entity

Return value

Returns a reference to the newly created entity object.


InsertEntity(Index, EntityName)

Inserts a new entity to the scene layer

Parameters

Index
The position within scene nodes where the new entity is to be inserted
EntityName
The name of the new entity

Return value

Returns a reference to the newly created entity object.


AddRegion(RegionName)

Adds a new region to the top of the layer

Parameters

RegionName
The name of the new region

Return value

Returns a reference to the newly created region object.


InsertRegion(Index, RegionName)

Inserts a new region to the scene layer

Parameters

Index
The position within scene nodes where the new region is to be inserted
RegionName
The name of the new region

Return value

Returns a reference to the newly created region object.


DeleteNode(NodeIndex)
DeleteNode(NodeObject)

Permanently removes a scene node (entity or region) from a scene layer

Parameters

NodeIndex
The index of the scene node to be deleted
NodeObject
The scene node object to be deleted

Return value

Returns true if the node was successfuly deleted.