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.


Методы

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

Атрибуты

Type (только для чтения) Returns always "layer"
Name The internal name of the layer
Active Specifies whether the layer is visible on screen
NumNodes (только для чтения) Returns the number of nodes of the layer
Width (только для чтения) Returns the width of the layer
Height (только для чтения) Returns the height of the layer
Main (только для чтения) Returns true if this is the scene's main layer

GetNode(NodeIndex)
GetNode(NodeName)

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

Параметры

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

Возвращаемое значение

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

Параметры

EntityName
The name of the new entity

Возвращаемое значение

Returns a reference to the newly created entity object.


InsertEntity(Index, EntityName)

Inserts a new entity to the scene layer

Параметры

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

Возвращаемое значение

Returns a reference to the newly created entity object.


AddRegion(RegionName)

Adds a new region to the top of the layer

Параметры

RegionName
The name of the new region

Возвращаемое значение

Returns a reference to the newly created region object.


InsertRegion(Index, RegionName)

Inserts a new region to the scene layer

Параметры

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

Возвращаемое значение

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

Параметры

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

Возвращаемое значение

Returns true if the node was successfuly deleted.