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 bool FollowViewportEnable { get; set; }

    public float FollowViewportScale { get; set; }

    public int Layer { get; set; }

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

    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 RID GetCanvas()

Returns the RID of the canvas used by this layer.

    [Obsolete("GetCustomViewport is deprecated. Use the CustomViewport property instead.")]
    public Node GetCustomViewport()

Getter for CustomViewport

    [Obsolete("GetFollowViewportScale is deprecated. Use the FollowViewportScale property instead.")]
    public float GetFollowViewportScale()

Getter for FollowViewportScale

    [Obsolete("GetLayer is deprecated. Use the Layer property instead.")]
    public int GetLayer()

Getter for Layer

    [Obsolete("GetOffset is deprecated. Use the Offset property instead.")]
    public Vector2 GetOffset()

Getter for Offset

    [Obsolete("GetRotation is deprecated. Use the Rotation property instead.")]
    public float GetRotation()

Getter for Rotation

    [Obsolete("GetRotationDegrees is deprecated. Use the RotationDegrees property instead.")]
    public float GetRotationDegrees()

Getter for RotationDegrees

    [Obsolete("GetScale is deprecated. Use the Scale property instead.")]
    public Vector2 GetScale()

Getter for Scale

    [Obsolete("GetTransform is deprecated. Use the Transform property instead.")]
    public Transform2D GetTransform()

Getter for Transform

    [Obsolete("IsFollowingViewport is deprecated. Use the FollowViewportEnable property instead.")]
    public bool IsFollowingViewport()

Getter for FollowViewportEnable

    [Obsolete("SetCustomViewport is deprecated. Use the CustomViewport property instead.")]
    public void SetCustomViewport(Node viewport)

Setter for CustomViewport

    [Obsolete("SetFollowViewport is deprecated. Use the FollowViewportEnable property instead.")]
    public void SetFollowViewport(bool enable)

Setter for FollowViewportEnable

    [Obsolete("SetFollowViewportScale is deprecated. Use the FollowViewportScale property instead.")]
    public void SetFollowViewportScale(float scale)

Setter for FollowViewportScale

    [Obsolete("SetLayer is deprecated. Use the Layer property instead.")]
    public void SetLayer(int layer)

Setter for Layer

    [Obsolete("SetOffset is deprecated. Use the Offset property instead.")]
    public void SetOffset(Vector2 offset)

Setter for Offset

    [Obsolete("SetRotation is deprecated. Use the Rotation property instead.")]
    public void SetRotation(float radians)

Setter for Rotation

    [Obsolete("SetRotationDegrees is deprecated. Use the RotationDegrees property instead.")]
    public void SetRotationDegrees(float degrees)

Setter for RotationDegrees

    [Obsolete("SetScale is deprecated. Use the Scale property instead.")]
    public void SetScale(Vector2 scale)

Setter for Scale

    [Obsolete("SetTransform is deprecated. Use the Transform property instead.")]
    public void SetTransform(Transform2D transform)

Setter for Transform

Tags: