CanvasLayer

Inherits: Node < Object

Inherited By: ParallaxBackground

Category: Core

Brief Description

Canvas Item layer.

Member Functions

int get_layer ( ) const
Vector2 get_offset ( ) const
float get_rotation ( ) const
float get_rotationd ( ) const
Vector2 get_scale ( ) const
Matrix32 get_transform ( ) const
RID get_viewport ( ) const
World2D get_world_2d ( ) const
void set_layer ( int layer )
void set_offset ( Vector2 offset )
void set_rotation ( float radians )
void set_rotationd ( float degrees )
void set_scale ( Vector2 scale )
void set_transform ( Matrix32 transform )

Description

Canvas Item layer. CanvasItem nodes that are direct or indirect children of a CanvasLayer will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a CanvasLayer with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below).

Member Function Description

  • int get_layer ( ) const

Return the layer index, determines the draw order, a lower value will be below a higher one.

Return the base offset for this layer (helper).

  • float get_rotation ( ) const

Return the base rotation for this layer (helper).

  • float get_rotationd ( ) const

Get rotation of the layer in degree.

Return the base scale for this layer (helper).

Return the base transform for this layer.

  • RID get_viewport ( ) const

Return the viewport RID for this layer.

Return the World2D used by this layer.

  • void set_layer ( int layer )

Set the layer index, determines the draw order, a lower value will be below a higher one.

  • void set_offset ( Vector2 offset )

Set the base offset for this layer (helper).

  • void set_rotation ( float radians )

Set the base rotation for this layer (helper).

  • void set_rotationd ( float degrees )

Set rotation of the layer in degree.

Set the base scale for this layer (helper).

  • void set_transform ( Matrix32 transform )

Set the base transform for this layer.