CanvasLayer

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

@GodotBaseClass
struct CanvasLayer {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

getCanvas
RID getCanvas()

Returns the RID of the canvas used by this layer.

getCustomViewport
Node getCustomViewport()
getFollowViewportScale
double getFollowViewportScale()
getLayer
long getLayer()
getOffset
Vector2 getOffset()
getRotation
double getRotation()
getRotationDegrees
double getRotationDegrees()
getScale
Vector2 getScale()
getTransform
Transform2D getTransform()
isFollowingViewport
bool isFollowingViewport()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(CanvasLayer other)
opEquals
bool opEquals(typeof(null) n)
setCustomViewport
void setCustomViewport(Node viewport)
setFollowViewport
void setFollowViewport(bool enable)
setFollowViewportScale
void setFollowViewportScale(double scale)
setLayer
void setLayer(long layer)
setOffset
void setOffset(Vector2 offset)
setRotation
void setRotation(double radians)
setRotationDegrees
void setRotationDegrees(double degrees)
setScale
void setScale(Vector2 scale)
setTransform
void setTransform(Transform2D transform)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

customViewport
Node customViewport [@property getter]
Node customViewport [@property setter]

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

followViewportEnable
bool followViewportEnable [@property getter]
bool followViewportEnable [@property setter]

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

followViewportScale
double followViewportScale [@property getter]
double followViewportScale [@property setter]

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

layer
long layer [@property getter]
long layer [@property setter]

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

offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]

The layer's base offset.

rotation
double rotation [@property getter]
double rotation [@property setter]

The layer's rotation in radians.

rotationDegrees
double rotationDegrees [@property getter]
double rotationDegrees [@property setter]

The layer's rotation in degrees.

scale
Vector2 scale [@property getter]
Vector2 scale [@property setter]

The layer's scale.

transform
Transform2D transform [@property getter]
Transform2D transform [@property setter]

The layer's transform.

Static functions

_new
CanvasLayer _new()

Construct a new instance of CanvasLayer. Note: use memnew!CanvasLayer instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta