Skip to content

CanvasLayer

Eduard Gushchin edited this page Jul 1, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.CanvasLayer
Namespace Electron2D
Kind class
Category Rendering

Overview

Provides an Electron2D node that renders 2D descendants on an independent canvas layer.

Syntax

public class Electron2D.CanvasLayer : Electron2D.Node

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: CanvasLayer

Layer, visibility and transform baseline for independent 2D canvas ordering.

Remarks

Descendant Electron2D.CanvasItem nodes are submitted with this layer's numeric draw layer. Lower layers are drawn before higher layers, regardless of descendant ZIndex values.

Thread Safety

This type is not synchronized. Create and mutate layers on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
Layer Property Gets or sets the numeric draw layer.
Offset Property Gets or sets the layer offset.
Rotation Property Gets or sets the layer rotation in radians.
RotationDegrees Property Gets or sets the layer rotation in degrees.
Scale Property Gets or sets the layer scale.
Transform Property Gets or sets the layer transform.
Visible Property Gets or sets whether this canvas layer is visible.
Electron2D.CanvasLayer() Constructor Initializes a new instance of the CanvasLayer type.
GetFinalTransform() Method Gets the transform applied to descendant canvas items during submission.
Hide() Method Hides this canvas layer and its submitted descendants.
Show() Method Shows this canvas layer.

Member Details

Layer

Kind: Property

public System.Int32 Layer { get; set; }

Summary

Gets or sets the numeric draw layer.

Remarks

The default value is 1. Canvas items outside any CanvasLayer are submitted to layer 0.

Value

The current layer value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Offset

Kind: Property

public Electron2D.Vector2 Offset { get; set; }

Summary

Gets or sets the layer offset.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current offset value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Rotation

Kind: Property

public System.Single Rotation { get; set; }

Summary

Gets or sets the layer rotation in radians.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current rotation value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer.RotationDegrees

RotationDegrees

Kind: Property

public System.Single RotationDegrees { get; set; }

Summary

Gets or sets the layer rotation in degrees.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current rotation degrees value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer.Rotation

Scale

Kind: Property

public Electron2D.Vector2 Scale { get; set; }

Summary

Gets or sets the layer scale.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current scale value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Transform

Kind: Property

public Electron2D.Transform2D Transform { get; set; }

Summary

Gets or sets the layer transform.

Remarks

The setter decomposes offset, rotation and scale for transforms without skew. Skew is outside the Electron2D 0.1.0 Preview subset.

Value

The current transform value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Visible

Kind: Property

public System.Boolean Visible { get; set; }

Summary

Gets or sets whether this canvas layer is visible.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current visible value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Electron2D.CanvasLayer()

Kind: Constructor

public Electron2D.CanvasLayer()

Summary

Initializes a new instance of the CanvasLayer type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

GetFinalTransform()

Kind: Method

public Electron2D.Transform2D GetFinalTransform()()

Summary

Gets the transform applied to descendant canvas items during submission.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The layer transform for Electron2D 0.1.0 Preview.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer

Hide()

Kind: Method

public System.Void Hide()()

Summary

Hides this canvas layer and its submitted descendants.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer.Show

Show()

Kind: Method

public System.Void Show()()

Summary

Shows this canvas layer.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasLayer.Hide

Clone this wiki locally