Canvas drawing layer.
    public class CanvasLayer : Node

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

Inheritance Chain

Derived Classes

Constructors

    public CanvasLayer()

Properties

    public Node CustomViewport { get; set; }

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

    public int Layer { get; set; }

Layer index for draw order. Lower values are drawn first. Default value: 1.

    public Vector2 Offset { get; set; }

The layer’s base offset.

    public float Rotation { get; set; }

The layer’s rotation in radians.

    public float RotationDegrees { get; set; }

The layer’s rotation in degrees.

    public Vector2 Scale { get; set; }

The layer’s scale.

    public Transform2D Transform { get; set; }

The layer’s transform.

Methods

    public Node GetCustomViewport()

Getter for CustomViewport

    public int GetLayer()

Getter for Layer

    public Vector2 GetOffset()

Getter for Offset

    public float GetRotation()

Getter for Rotation

    public float GetRotationDegrees()

Getter for RotationDegrees

    public Vector2 GetScale()

Getter for Scale

    public Transform2D GetTransform()

Getter for Transform

    public World2D GetWorld2d()

Return the World2D used by this layer.

    public void SetCustomViewport(Node viewport)

Setter for CustomViewport

    public void SetLayer(int layer)

Setter for Layer

    public void SetOffset(Vector2 offset)

Setter for Offset

    public void SetRotation(float radians)

Setter for Rotation

    public void SetRotationDegrees(float degrees)

Setter for RotationDegrees

    public void SetScale(Vector2 scale)

Setter for Scale

    public void SetTransform(Transform2D transform)

Setter for Transform

Tags: