Figure 1: Example layer containing some sprites

Adding a child node to a layer increases the child's reference count by one. The child's reference count will be decremented only when the parent layer is destroyed or when explicitly removed via the "remove_child" method. Child nodes can only have a single parent, so the same sprite cannot be parented by two layers simultaneously.

- .alpha

Alpha modifier value. This is a number value from 0 to 1 (default value is 1 which is opaque)

- .color

Color modulation value. This is a Color object

- .depth

Z-ordering of the layer. Child nodes of the layer will have this value added to their own depth. This is a number value (default is 0)

- .rotation

Rotation of the layer in degrees. The layer turns clockwise as this value increases. This is a number value (default is 0)

- .scalex

Horizontal scale of the layer. This is a number value (default is 1)

- .scaley

Vertical scale of the layer. This is a number value (default is 1)

- .visible

Includes or excludes the layer from being rendered. This is a boolean value (default is true)

- .x

X-position of the layer in parent coordinates. This is a number value (default is 0)

- .y

Y-position of the layer in parent coordinates. This is a number value (default is 0)

- Layer ( [x, y] )

Creates a new layer object

- add_child ( child )

Adds a Camera, Sprite or Layer object as a child node to the layer

- change_position ( x, y )

Translates the layer by a given amount

- change_rotation ( degrees )

Rotates the layer around its origin by a given amount in degrees

- change_rotation_r ( radians )

Rotates the layer around its origin by a given amount in radians

- change_scale ( x, y )

Scales the layer by a given amount

- change_scalex ( x )

Scales the layer horizontally by a given amount

- change_scaley ( y )

Scales the layer vertically by a given amount

- get_local_point ( x, y )

Transforms a position from topmost parent to local coordinates. Returns the transformed coordinates

- get_parent_point ( x, y )

Transforms a position from local to parent coordinates. Returns the transformed coordinates

- get_world_point ( x, y )

Transforms a position from local to topmost parent coordinates. Returns the transformed coordinates

- remove_child ( child )

Removes an existing child node from the layer

- remove_children ( )

Removes all existing child nodes from the layer

- set_position ( x, y )

Translates the layer to a given location

- set_rotation ( degrees )

Rotates the layer to a given angle in degrees

- set_rotation_r ( radians )

Rotates the layer to a given angle in radians

- set_scale ( x, y )

Scales the layer to given proportions