Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

CanvasLayer

0 0 vote
Article Rating

Inherits: Node < Object

Inherited By: ParallaxBackground

Canvas drawing layer.

Description

Canvas drawing 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).

Methods

RIDget_canvas ( ) const

Property Descriptions

  • Node custom_viewport
Setterset_custom_viewport(value)
Getterget_custom_viewport()

The custom Viewport node assigned to the CanvasLayer. If null, uses the default viewport instead.


  • bool follow_viewport_enable
Defaultfalse
Setterset_follow_viewport(value)
Getteris_following_viewport()

Sets the layer to follow the viewport in order to simulate a pseudo 3D effect.


  • float follow_viewport_scale
Default1.0
Setterset_follow_viewport_scale(value)
Getterget_follow_viewport_scale()

Scales the layer when using follow_viewport_enable. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales.


Default1
Setterset_layer(value)
Getterget_layer()

Layer index for draw order. Lower values are drawn first.


DefaultVector2( 0, 0 )
Setterset_offset(value)
Getterget_offset()

The layer’s base offset.


Default0.0
Setterset_rotation(value)
Getterget_rotation()

The layer’s rotation in radians.


Default0.0
Setterset_rotation_degrees(value)
Getterget_rotation_degrees()

The layer’s rotation in degrees.


DefaultVector2( 1, 1 )
Setterset_scale(value)
Getterget_scale()

The layer’s scale.


DefaultTransform2D( 1, 0, 0, 1, 0, 0 )
Setterset_transform(value)
Getterget_transform()

The layer’s transform.

Method Descriptions

  • RID get_canvas ( ) const

Returns the RID of the canvas used by this layer.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x