Documentation
¶
Overview ¶
Package CanvasLayer provides methods for working with CanvasLayer object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasLayer() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) CustomViewport() Node.Instance
- func (self Instance) FollowViewportEnabled() bool
- func (self Instance) FollowViewportScale() Float.X
- func (self Instance) GetCanvas() RID.Canvas
- func (self Instance) GetFinalTransform() Transform2D.OriginXY
- func (self Instance) Hide()
- func (self Instance) ID() ID
- func (self Instance) Layer() int
- func (self Instance) Offset() Vector2.XY
- func (self Instance) OnVisibilityChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) Rotation() Angle.Radians
- func (self Instance) Scale() Vector2.XY
- func (self Instance) SetCustomViewport(value Node.Instance)
- func (self Instance) SetFollowViewportEnabled(value bool)
- func (self Instance) SetFollowViewportScale(value Float.X)
- func (self Instance) SetLayer(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOffset(value Vector2.XY)
- func (self Instance) SetRotation(value Angle.Radians)
- func (self Instance) SetScale(value Vector2.XY)
- func (self Instance) SetTransform(value Transform2D.OriginXY)
- func (self Instance) SetVisible(value bool)
- func (self Instance) Show()
- func (self Instance) Transform() Transform2D.OriginXY
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Visible() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasLayer ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.CanvasLayer
[CanvasItem]-derived 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 [code]0[/code], so a [CanvasLayer] with index [code]-1[/code] will be drawn below, and a [CanvasLayer] with index [code]1[/code] will be drawn above. This order will hold regardless of the [member CanvasItem.z_index] of the nodes within each layer. [CanvasLayer]s can be hidden and they can also optionally follow the viewport. This makes them useful for HUDs like health bar overlays (on layers [code]1[/code] and higher) or backgrounds (on layers [code]-1[/code] and lower). [b]Note:[/b] Embedded [Window]s are placed on layer [code]1024[/code]. [CanvasItem]s on layers [code]1025[/code] and higher appear in front of embedded windows. [b]Note:[/b] Each [CanvasLayer] is drawn on one specific [Viewport] and cannot be shared between multiple [Viewport]s, see [member custom_viewport]. When using multiple [Viewport]s, for example in a split-screen game, you need create an individual [CanvasLayer] for each [Viewport] you want it to be drawn on.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasLayer ¶
func (Instance) CustomViewport ¶
func (Instance) FollowViewportEnabled ¶
func (Instance) FollowViewportScale ¶
func (Instance) GetFinalTransform ¶
func (self Instance) GetFinalTransform() Transform2D.OriginXY
Returns the transform from the [CanvasLayer]s coordinate system to the [Viewport]s coordinate system.
func (Instance) Hide ¶
func (self Instance) Hide()
Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to [code]false[/code].
func (Instance) OnVisibilityChanged ¶
func (Instance) SetCustomViewport ¶
func (Instance) SetFollowViewportEnabled ¶
func (Instance) SetFollowViewportScale ¶
func (Instance) SetRotation ¶
func (Instance) SetTransform ¶
func (self Instance) SetTransform(value Transform2D.OriginXY)
func (Instance) SetVisible ¶
func (Instance) Show ¶
func (self Instance) Show()
Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to [code]true[/code].
func (Instance) Transform ¶
func (self Instance) Transform() Transform2D.OriginXY