Documentation ¶
Overview ¶
Package CanvasGroup provides methods for working with CanvasGroup object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsCanvasGroup() Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ClearMargin() Float.X
- func (self Instance) FitMargin() Float.X
- func (self Instance) SetClearMargin(value Float.X)
- func (self Instance) SetFitMargin(value Float.X)
- func (self Instance) SetUseMipmaps(value bool)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UseMipmaps() bool
- func (self Instance) Virtual(name string) reflect.Value
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 Instance ¶
type Instance [1]gdclass.CanvasGroup
Child [CanvasItem] nodes of a [CanvasGroup] are drawn as a single object. It allows to e.g. draw overlapping translucent 2D nodes without blending (set [member CanvasItem.self_modulate] property of [CanvasGroup] to achieve this effect). [b]Note:[/b] The [CanvasGroup] uses a custom shader to read from the backbuffer to draw its children. Assigning a [Material] to the [CanvasGroup] overrides the builtin shader. To duplicate the behavior of the builtin shader in a custom [Shader] use the following: [codeblock] shader_type canvas_item; render_mode unshaded;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void fragment() { vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0); if (c.a > 0.0001) { c.rgb /= c.a; } COLOR *= c; }
[/codeblock] [b]Note:[/b] Since [CanvasGroup] and [member CanvasItem.clip_children] both utilize the backbuffer, children of a [CanvasGroup] who have their [member CanvasItem.clip_children] set to anything other than [constant CanvasItem.CLIP_CHILDREN_DISABLED] will not function correctly.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasGroup ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance