Control

package
v0.0.0-...-2b43b64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package Control provides methods for working with Control object instances.

Index

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 Anchor

type Anchor = gdclass.ControlAnchor //gd:Control.Anchor
const (
	/*Snaps one of the 4 anchor's sides to the origin of the node's [code]Rect[/code], in the top left. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].*/
	AnchorBegin Anchor = 0
	/*Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].*/
	AnchorEnd Anchor = 1
)

type Any

type Any interface {
	gd.IsClass
	AsControl() Instance
}

type CursorShape

type CursorShape = gdclass.ControlCursorShape //gd:Control.CursorShape
const (
	/*Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape].*/
	CursorArrow CursorShape = 0
	/*Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text.*/
	CursorIbeam CursorShape = 1
	/*Show the system's pointing hand mouse cursor when the user hovers the node.*/
	CursorPointingHand CursorShape = 2
	/*Show the system's cross mouse cursor when the user hovers the node.*/
	CursorCross CursorShape = 3
	/*Show the system's wait mouse cursor when the user hovers the node. Often an hourglass.*/
	CursorWait CursorShape = 4
	/*Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass.*/
	CursorBusy CursorShape = 5
	/*Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock.*/
	CursorDrag CursorShape = 6
	/*Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock.*/
	CursorCanDrop CursorShape = 7
	/*Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle.*/
	CursorForbidden CursorShape = 8
	/*Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically.*/
	CursorVsize CursorShape = 9
	/*Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally.*/
	CursorHsize CursorShape = 10
	/*Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.*/
	CursorBdiagsize CursorShape = 11
	/*Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically.*/
	CursorFdiagsize CursorShape = 12
	/*Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely.*/
	CursorMove CursorShape = 13
	/*Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_VSIZE].*/
	CursorVsplit CursorShape = 14
	/*Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_HSIZE].*/
	CursorHsplit CursorShape = 15
	/*Show the system's help mouse cursor when the user hovers the node, a question mark.*/
	CursorHelp CursorShape = 16
)

type FocusMode

type FocusMode = gdclass.ControlFocusMode //gd:Control.FocusMode
const (
	/*The node cannot grab focus. Use with [member focus_mode].*/
	FocusNone FocusMode = 0
	/*The node can only grab focus on mouse clicks. Use with [member focus_mode].*/
	FocusClick FocusMode = 1
	/*The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with [member focus_mode].*/
	FocusAll FocusMode = 2
)

type GrowDirection

type GrowDirection = gdclass.ControlGrowDirection //gd:Control.GrowDirection
const (
	/*The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis.*/
	GrowDirectionBegin GrowDirection = 0
	/*The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis.*/
	GrowDirectionEnd GrowDirection = 1
	/*The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.*/
	GrowDirectionBoth GrowDirection = 2
)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.Control

Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [Control] and [Container] nodes. [b]User Interface nodes and input[/b] Godot propagates input events via viewports. Each [Viewport] is responsible for propagating [InputEvent]s to their child nodes. As the [member SceneTree.root] is a [Window], this already happens automatically for all UI elements in your game. Input events are propagated through the [SceneTree] from the root node to all child nodes by calling [method Node._input]. For UI elements specifically, it makes more sense to override the virtual method [method _gui_input], which filters out unrelated input events, such as by checking z-order, [member mouse_filter], focus, or if the event was inside of the control's bounding box. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the Inspector. [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class.

See [Interface] for methods that can be overridden by a [Class] that extends it.

%!(EXTRA string=Control)

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AcceptEvent

func (self Instance) AcceptEvent()

Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input]. [b]Note:[/b] This does not affect the methods in [Input], only the way events are propagated.

func (Instance) AddThemeColorOverride

func (self Instance) AddThemeColorOverride(name string, color Color.RGBA)

Creates a local override for a theme [Color] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override]. See also [method get_theme_color]. [b]Example of overriding a label's color and resetting it later:[/b] [codeblocks] [gdscript] # Given the child Label node "MyLabel", override its font color with a custom value. $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0)) # Reset the font color of the child label. $MyLabel.remove_theme_color_override("font_color") # Alternatively it can be overridden with the default value from the Label type. $MyLabel.add_theme_color_override("font_color", get_theme_color("font_color", "Label")) [/gdscript] [csharp] // Given the child Label node "MyLabel", override its font color with a custom value. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0)); // Reset the font color of the child label. GetNode<Label>("MyLabel").RemoveThemeColorOverride("font_color"); // Alternatively it can be overridden with the default value from the Label type. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", GetThemeColor("font_color", "Label")); [/csharp] [/codeblocks]

func (Instance) AddThemeConstantOverride

func (self Instance) AddThemeConstantOverride(name string, constant int)

Creates a local override for a theme constant with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_constant_override]. See also [method get_theme_constant].

func (Instance) AddThemeFontOverride

func (self Instance) AddThemeFontOverride(name string, font [1]gdclass.Font)

Creates a local override for a theme [Font] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_override]. See also [method get_theme_font].

func (Instance) AddThemeFontSizeOverride

func (self Instance) AddThemeFontSizeOverride(name string, font_size int)

Creates a local override for a theme font size with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_size_override]. See also [method get_theme_font_size].

func (Instance) AddThemeIconOverride

func (self Instance) AddThemeIconOverride(name string, texture [1]gdclass.Texture2D)

Creates a local override for a theme icon with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_icon_override]. See also [method get_theme_icon].

func (Instance) AddThemeStyleboxOverride

func (self Instance) AddThemeStyleboxOverride(name string, stylebox [1]gdclass.StyleBox)

Creates a local override for a theme [StyleBox] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override]. See also [method get_theme_stylebox]. [b]Example of modifying a property in a StyleBox by duplicating it:[/b] [codeblocks] [gdscript] # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. # Resources are shared across instances, so we need to duplicate it # to avoid modifying the appearance of all other buttons. var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate() new_stylebox_normal.border_width_top = 3 new_stylebox_normal.border_color = Color(0, 1, 0.5) $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal) # Remove the stylebox override. $MyButton.remove_theme_stylebox_override("normal") [/gdscript] [csharp] // The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. // Resources are shared across instances, so we need to duplicate it // to avoid modifying the appearance of all other buttons. StyleBoxFlat newStyleboxNormal = GetNode<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat; newStyleboxNormal.BorderWidthTop = 3; newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f); GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal); // Remove the stylebox override. GetNode<Button>("MyButton").RemoveThemeStyleboxOverride("normal"); [/csharp] [/codeblocks]

func (Instance) AnchorBottom

func (self Instance) AnchorBottom() Float.X

func (Instance) AnchorLeft

func (self Instance) AnchorLeft() Float.X

func (Instance) AnchorRight

func (self Instance) AnchorRight() Float.X

func (Instance) AnchorTop

func (self Instance) AnchorTop() Float.X

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AutoTranslate

func (self Instance) AutoTranslate() bool

func (Instance) BeginBulkThemeOverride

func (self Instance) BeginBulkThemeOverride()

Prevents [code]*_theme_*_override[/code] methods from emitting [constant NOTIFICATION_THEME_CHANGED] until [method end_bulk_theme_override] is called.

func (Instance) ClipContents

func (self Instance) ClipContents() bool

func (Instance) CustomMinimumSize

func (self Instance) CustomMinimumSize() Vector2.XY

func (Instance) EndBulkThemeOverride

func (self Instance) EndBulkThemeOverride()

Ends a bulk theme override update. See [method begin_bulk_theme_override].

func (Instance) FindNextValidFocus

func (self Instance) FindNextValidFocus() [1]gdclass.Control

Finds the next (below in the tree) [Control] that can receive the focus.

func (Instance) FindPrevValidFocus

func (self Instance) FindPrevValidFocus() [1]gdclass.Control

Finds the previous (above in the tree) [Control] that can receive the focus.

func (Instance) FindValidFocusNeighbor

func (self Instance) FindValidFocusNeighbor(side Side) [1]gdclass.Control

Finds the next [Control] that can receive the focus on the specified [enum Side]. [b]Note:[/b] This is different from [method get_focus_neighbor], which returns the path of a specified focus neighbor.

func (Instance) FocusMode

func (self Instance) FocusMode() gdclass.ControlFocusMode

func (Instance) FocusNeighborBottom

func (self Instance) FocusNeighborBottom() string

func (Instance) FocusNeighborLeft

func (self Instance) FocusNeighborLeft() string

func (Instance) FocusNeighborRight

func (self Instance) FocusNeighborRight() string

func (Instance) FocusNeighborTop

func (self Instance) FocusNeighborTop() string

func (Instance) FocusNext

func (self Instance) FocusNext() string

func (Instance) FocusPrevious

func (self Instance) FocusPrevious() string

func (Instance) ForceDrag

func (self Instance) ForceDrag(data any, preview [1]gdclass.Control)

Forces drag and bypasses [method _get_drag_data] and [method set_drag_preview] by passing [param data] and [param preview]. Drag will start even if the mouse is neither over nor pressed on this control. The methods [method _can_drop_data] and [method _drop_data] must be implemented on controls that want to receive drop data.

func (Instance) GetBegin

func (self Instance) GetBegin() Vector2.XY

Returns [member offset_left] and [member offset_top]. See also [member position].

func (Instance) GetCombinedMinimumSize

func (self Instance) GetCombinedMinimumSize() Vector2.XY

Returns combined minimum size from [member custom_minimum_size] and [method get_minimum_size].

func (Instance) GetCursorShape

func (self Instance) GetCursorShape() gdclass.ControlCursorShape

Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape].

func (Instance) GetEnd

func (self Instance) GetEnd() Vector2.XY

Returns [member offset_right] and [member offset_bottom].

func (Instance) GetGlobalRect

func (self Instance) GetGlobalRect() Rect2.PositionSize

Returns the position and size of the control relative to the containing canvas. See [member global_position] and [member size]. [b]Note:[/b] If the node itself or any parent [CanvasItem] between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful. [b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2].

func (Instance) GetMinimumSize

func (self Instance) GetMinimumSize() Vector2.XY

Returns the minimum size for this control. See [member custom_minimum_size].

func (Instance) GetParentAreaSize

func (self Instance) GetParentAreaSize() Vector2.XY

Returns the width/height occupied in the parent control.

func (Instance) GetParentControl

func (self Instance) GetParentControl() [1]gdclass.Control

Returns the parent control node.

func (Instance) GetRect

func (self Instance) GetRect() Rect2.PositionSize

Returns the position and size of the control in the coordinate system of the containing node. See [member position], [member scale] and [member size]. [b]Note:[/b] If [member rotation] is not the default rotation, the resulting size is not meaningful. [b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2].

func (Instance) GetScreenPosition

func (self Instance) GetScreenPosition() Vector2.XY

Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]). [b]Example usage for showing a popup:[/b] [codeblock] popup_menu.position = get_screen_position() + get_local_mouse_position() popup_menu.reset_size() popup_menu.popup() [/codeblock]

func (Instance) GetThemeColor

func (self Instance) GetThemeColor(name string) Color.RGBA

Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [param name] and [param theme_type]. If [param theme_type] is omitted the class name of the current control is used as the type, or [member theme_type_variation] if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked. For the current control its local overrides are considered first (see [method add_theme_color_override]), then its assigned [member theme]. After the current control, each parent control and its assigned [member theme] are considered; controls without a [member theme] assigned are skipped. If no matching [Theme] is found in the tree, the custom project [Theme] (see [member ProjectSettings.gui/theme/custom]) and the default [Theme] are used (see [ThemeDB]). [codeblocks] [gdscript] func _ready():

# Get the font color defined for the current Control's class, if it exists.
modulate = get_theme_color("font_color")
# Get the font color defined for the Button class.
modulate = get_theme_color("font_color", "Button")

[/gdscript] [csharp] public override void _Ready()

{
    // Get the font color defined for the current Control's class, if it exists.
    Modulate = GetThemeColor("font_color");
    // Get the font color defined for the Button class.
    Modulate = GetThemeColor("font_color", "Button");
}

[/csharp] [/codeblocks]

func (Instance) GetThemeConstant

func (self Instance) GetThemeConstant(name string) int

Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) GetThemeDefaultBaseScale

func (self Instance) GetThemeDefaultBaseScale() Float.X

Returns the default base scale value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_base_scale] value. See [method get_theme_color] for details.

func (Instance) GetThemeDefaultFont

func (self Instance) GetThemeDefaultFont() [1]gdclass.Font

Returns the default font from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font] value. See [method get_theme_color] for details.

func (Instance) GetThemeDefaultFontSize

func (self Instance) GetThemeDefaultFontSize() int

Returns the default font size value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font_size] value. See [method get_theme_color] for details.

func (Instance) GetThemeFont

func (self Instance) GetThemeFont(name string) [1]gdclass.Font

Returns a [Font] from the first matching [Theme] in the tree if that [Theme] has a font item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) GetThemeFontSize

func (self Instance) GetThemeFontSize(name string) int

Returns a font size from the first matching [Theme] in the tree if that [Theme] has a font size item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) GetThemeIcon

func (self Instance) GetThemeIcon(name string) [1]gdclass.Texture2D

Returns an icon from the first matching [Theme] in the tree if that [Theme] has an icon item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) GetThemeStylebox

func (self Instance) GetThemeStylebox(name string) [1]gdclass.StyleBox

Returns a [StyleBox] from the first matching [Theme] in the tree if that [Theme] has a stylebox item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) GetTooltip

func (self Instance) GetTooltip() string

Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text]. This method can be overridden to customize its behavior. See [method _get_tooltip]. [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed.

func (Instance) GlobalPosition

func (self Instance) GlobalPosition() Vector2.XY

func (Instance) GrabClickFocus

func (self Instance) GrabClickFocus()

Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus. [codeblocks] [gdscript] func _process(delta):

grab_click_focus() # When clicking another Control node, this node will be clicked instead.

[/gdscript] [csharp] public override void _Process(double delta)

{
    GrabClickFocus(); // When clicking another Control node, this node will be clicked instead.
}

[/csharp] [/codeblocks]

func (Instance) GrabFocus

func (self Instance) GrabFocus()

Steal the focus from another control and become the focused control (see [member focus_mode]). [b]Note:[/b] Using this method together with [method Callable.call_deferred] makes it more reliable, especially when called inside [method Node._ready].

func (Instance) GrowHorizontal

func (self Instance) GrowHorizontal() gdclass.ControlGrowDirection

func (Instance) GrowVertical

func (self Instance) GrowVertical() gdclass.ControlGrowDirection

func (Instance) HasFocus

func (self Instance) HasFocus() bool

Returns [code]true[/code] if this is the current focused control. See [member focus_mode].

func (Instance) HasThemeColor

func (self Instance) HasThemeColor(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has a color item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeColorOverride

func (self Instance) HasThemeColorOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme [Color] with the specified [param name] in this [Control] node. See [method add_theme_color_override].

func (Instance) HasThemeConstant

func (self Instance) HasThemeConstant(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has a constant item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeConstantOverride

func (self Instance) HasThemeConstantOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme constant with the specified [param name] in this [Control] node. See [method add_theme_constant_override].

func (Instance) HasThemeFont

func (self Instance) HasThemeFont(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeFontOverride

func (self Instance) HasThemeFontOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme [Font] with the specified [param name] in this [Control] node. See [method add_theme_font_override].

func (Instance) HasThemeFontSize

func (self Instance) HasThemeFontSize(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font size item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeFontSizeOverride

func (self Instance) HasThemeFontSizeOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme font size with the specified [param name] in this [Control] node. See [method add_theme_font_size_override].

func (Instance) HasThemeIcon

func (self Instance) HasThemeIcon(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has an icon item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeIconOverride

func (self Instance) HasThemeIconOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme icon with the specified [param name] in this [Control] node. See [method add_theme_icon_override].

func (Instance) HasThemeStylebox

func (self Instance) HasThemeStylebox(name string) bool

Returns [code]true[/code] if there is a matching [Theme] in the tree that has a stylebox item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details.

func (Instance) HasThemeStyleboxOverride

func (self Instance) HasThemeStyleboxOverride(name string) bool

Returns [code]true[/code] if there is a local override for a theme [StyleBox] with the specified [param name] in this [Control] node. See [method add_theme_stylebox_override].

func (Instance) IsDragSuccessful

func (self Instance) IsDragSuccessful() bool

Returns [code]true[/code] if a drag operation is successful. Alternative to [method Viewport.gui_is_drag_successful]. Best used with [constant Node.NOTIFICATION_DRAG_END].

func (Instance) IsLayoutRtl

func (self Instance) IsLayoutRtl() bool

Returns [code]true[/code] if layout is right-to-left.

func (Instance) LayoutDirection

func (self Instance) LayoutDirection() gdclass.ControlLayoutDirection

func (Instance) LocalizeNumeralSystem

func (self Instance) LocalizeNumeralSystem() bool

func (Instance) MouseDefaultCursorShape

func (self Instance) MouseDefaultCursorShape() gdclass.ControlCursorShape

func (Instance) MouseFilter

func (self Instance) MouseFilter() gdclass.ControlMouseFilter

func (Instance) MouseForcePassScrollEvents

func (self Instance) MouseForcePassScrollEvents() bool

func (Instance) OffsetBottom

func (self Instance) OffsetBottom() Float.X

func (Instance) OffsetLeft

func (self Instance) OffsetLeft() Float.X

func (Instance) OffsetRight

func (self Instance) OffsetRight() Float.X

func (Instance) OffsetTop

func (self Instance) OffsetTop() Float.X

func (Instance) OnFocusEntered

func (self Instance) OnFocusEntered(cb func())

func (Instance) OnFocusExited

func (self Instance) OnFocusExited(cb func())

func (Instance) OnGuiInput

func (self Instance) OnGuiInput(cb func(event [1]gdclass.InputEvent))

func (Instance) OnMinimumSizeChanged

func (self Instance) OnMinimumSizeChanged(cb func())

func (Instance) OnMouseEntered

func (self Instance) OnMouseEntered(cb func())

func (Instance) OnMouseExited

func (self Instance) OnMouseExited(cb func())

func (Instance) OnResized

func (self Instance) OnResized(cb func())

func (Instance) OnSizeFlagsChanged

func (self Instance) OnSizeFlagsChanged(cb func())

func (Instance) OnThemeChanged

func (self Instance) OnThemeChanged(cb func())

func (Instance) PivotOffset

func (self Instance) PivotOffset() Vector2.XY

func (Instance) Position

func (self Instance) Position() Vector2.XY

func (Instance) ReleaseFocus

func (self Instance) ReleaseFocus()

Give up the focus. No other control will be able to receive input.

func (Instance) RemoveThemeColorOverride

func (self Instance) RemoveThemeColorOverride(name string)

Removes a local override for a theme [Color] with the specified [param name] previously added by [method add_theme_color_override] or via the Inspector dock.

func (Instance) RemoveThemeConstantOverride

func (self Instance) RemoveThemeConstantOverride(name string)

Removes a local override for a theme constant with the specified [param name] previously added by [method add_theme_constant_override] or via the Inspector dock.

func (Instance) RemoveThemeFontOverride

func (self Instance) RemoveThemeFontOverride(name string)

Removes a local override for a theme [Font] with the specified [param name] previously added by [method add_theme_font_override] or via the Inspector dock.

func (Instance) RemoveThemeFontSizeOverride

func (self Instance) RemoveThemeFontSizeOverride(name string)

Removes a local override for a theme font size with the specified [param name] previously added by [method add_theme_font_size_override] or via the Inspector dock.

func (Instance) RemoveThemeIconOverride

func (self Instance) RemoveThemeIconOverride(name string)

Removes a local override for a theme icon with the specified [param name] previously added by [method add_theme_icon_override] or via the Inspector dock.

func (Instance) RemoveThemeStyleboxOverride

func (self Instance) RemoveThemeStyleboxOverride(name string)

Removes a local override for a theme [StyleBox] with the specified [param name] previously added by [method add_theme_stylebox_override] or via the Inspector dock.

func (Instance) ResetSize

func (self Instance) ResetSize()

Resets the size to [method get_combined_minimum_size]. This is equivalent to calling [code]set_size(Vector2())[/code] (or any size below the minimum).

func (Instance) Rotation

func (self Instance) Rotation() Float.X

func (Instance) RotationDegrees

func (self Instance) RotationDegrees() Float.X

func (Instance) Scale

func (self Instance) Scale() Vector2.XY

func (Instance) SetAnchor

func (self Instance) SetAnchor(side Side, anchor Float.X)

Sets the anchor for the specified [enum Side] to [param anchor]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. If [param keep_offset] is [code]true[/code], offsets aren't updated after this operation. If [param push_opposite_anchor] is [code]true[/code] and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [param push_opposite_anchor] was [code]false[/code], the left anchor would get value 0.5.

func (Instance) SetAnchorAndOffset

func (self Instance) SetAnchorAndOffset(side Side, anchor Float.X, offset Float.X)

Works the same as [method set_anchor], but instead of [code]keep_offset[/code] argument and automatic update of offset, it allows to set the offset yourself (see [method set_offset]).

func (Instance) SetAnchorsAndOffsetsPreset

func (self Instance) SetAnchorsAndOffsetsPreset(preset gdclass.ControlLayoutPreset)

Sets both anchor preset and offset preset. See [method set_anchors_preset] and [method set_offsets_preset].

func (Instance) SetAnchorsPreset

func (self Instance) SetAnchorsPreset(preset gdclass.ControlLayoutPreset)

Sets the anchors to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor. If [param keep_offsets] is [code]true[/code], control's position will also be updated.

func (Instance) SetAutoTranslate

func (self Instance) SetAutoTranslate(value bool)

func (Instance) SetBegin

func (self Instance) SetBegin(position Vector2.XY)

Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member position].

func (Instance) SetClipContents

func (self Instance) SetClipContents(value bool)

func (Instance) SetCustomMinimumSize

func (self Instance) SetCustomMinimumSize(value Vector2.XY)

func (Instance) SetDragForwarding

func (self Instance) SetDragForwarding(drag_func func(at_position Vector2.XY) any, can_drop_func func(at_position Vector2.XY, data any) bool, drop_func func(at_position Vector2.XY, data any))

Forwards the handling of this control's [method _get_drag_data], [method _can_drop_data] and [method _drop_data] virtual functions to delegate callables. For each argument, if not empty, the delegate callable is used, otherwise the local (virtual) function is used. The function format for each callable should be exactly the same as the virtual functions described above.

func (Instance) SetDragPreview

func (self Instance) SetDragPreview(control [1]gdclass.Control)

Shows the given control at the mouse pointer. A good time to call this method is in [method _get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. [codeblocks] [gdscript] @export var color = Color(1, 0, 0, 1)

func _get_drag_data(position):

# Use a control that is not in the tree
var cpb = ColorPickerButton.new()
cpb.color = color
cpb.size = Vector2(50, 50)
set_drag_preview(cpb)
return color

[/gdscript] [csharp] [Export] private Color _color = new Color(1, 0, 0, 1);

public override Variant _GetDragData(Vector2 atPosition)

{
    // Use a control that is not in the tree
    var cpb = new ColorPickerButton();
    cpb.Color = _color;
    cpb.Size = new Vector2(50, 50);
    SetDragPreview(cpb);
    return _color;
}

[/csharp] [/codeblocks]

func (Instance) SetEnd

func (self Instance) SetEnd(position Vector2.XY)

Sets [member offset_right] and [member offset_bottom] at the same time.

func (Instance) SetFocusMode

func (self Instance) SetFocusMode(value gdclass.ControlFocusMode)

func (Instance) SetFocusNeighborBottom

func (self Instance) SetFocusNeighborBottom(value string)

func (Instance) SetFocusNeighborLeft

func (self Instance) SetFocusNeighborLeft(value string)

func (Instance) SetFocusNeighborRight

func (self Instance) SetFocusNeighborRight(value string)

func (Instance) SetFocusNeighborTop

func (self Instance) SetFocusNeighborTop(value string)

func (Instance) SetFocusNext

func (self Instance) SetFocusNext(value string)

func (Instance) SetFocusPrevious

func (self Instance) SetFocusPrevious(value string)

func (Instance) SetGlobalPosition

func (self Instance) SetGlobalPosition(position Vector2.XY)

Sets the [member global_position] to given [param position]. If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets.

func (Instance) SetGrowHorizontal

func (self Instance) SetGrowHorizontal(value gdclass.ControlGrowDirection)

func (Instance) SetGrowVertical

func (self Instance) SetGrowVertical(value gdclass.ControlGrowDirection)

func (Instance) SetLayoutDirection

func (self Instance) SetLayoutDirection(value gdclass.ControlLayoutDirection)

func (Instance) SetLocalizeNumeralSystem

func (self Instance) SetLocalizeNumeralSystem(value bool)

func (Instance) SetMouseDefaultCursorShape

func (self Instance) SetMouseDefaultCursorShape(value gdclass.ControlCursorShape)

func (Instance) SetMouseFilter

func (self Instance) SetMouseFilter(value gdclass.ControlMouseFilter)

func (Instance) SetMouseForcePassScrollEvents

func (self Instance) SetMouseForcePassScrollEvents(value bool)

func (Instance) SetOffsetBottom

func (self Instance) SetOffsetBottom(value Float.X)

func (Instance) SetOffsetLeft

func (self Instance) SetOffsetLeft(value Float.X)

func (Instance) SetOffsetRight

func (self Instance) SetOffsetRight(value Float.X)

func (Instance) SetOffsetTop

func (self Instance) SetOffsetTop(value Float.X)

func (Instance) SetOffsetsPreset

func (self Instance) SetOffsetsPreset(preset gdclass.ControlLayoutPreset)

Sets the offsets to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor. Use parameter [param resize_mode] with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the [Control]. Constant size will be ignored if used with presets that change size, e.g. [constant PRESET_LEFT_WIDE]. Use parameter [param margin] to determine the gap between the [Control] and the edges.

func (Instance) SetPivotOffset

func (self Instance) SetPivotOffset(value Vector2.XY)

func (Instance) SetPosition

func (self Instance) SetPosition(position Vector2.XY)

Sets the [member position] to given [param position]. If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets.

func (Instance) SetRotation

func (self Instance) SetRotation(value Float.X)

func (Instance) SetRotationDegrees

func (self Instance) SetRotationDegrees(value Float.X)

func (Instance) SetScale

func (self Instance) SetScale(value Vector2.XY)

func (Instance) SetShortcutContext

func (self Instance) SetShortcutContext(value [1]gdclass.Node)

func (Instance) SetSize

func (self Instance) SetSize(size Vector2.XY)

Sets the size (see [member size]). If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets.

func (Instance) SetSizeFlagsHorizontal

func (self Instance) SetSizeFlagsHorizontal(value gdclass.ControlSizeFlags)

func (Instance) SetSizeFlagsStretchRatio

func (self Instance) SetSizeFlagsStretchRatio(value Float.X)

func (Instance) SetSizeFlagsVertical

func (self Instance) SetSizeFlagsVertical(value gdclass.ControlSizeFlags)

func (Instance) SetTheme

func (self Instance) SetTheme(value [1]gdclass.Theme)

func (Instance) SetThemeTypeVariation

func (self Instance) SetThemeTypeVariation(value string)

func (Instance) SetTooltipText

func (self Instance) SetTooltipText(value string)

func (Instance) ShortcutContext

func (self Instance) ShortcutContext() [1]gdclass.Node

func (Instance) Size

func (self Instance) Size() Vector2.XY

func (Instance) SizeFlagsHorizontal

func (self Instance) SizeFlagsHorizontal() gdclass.ControlSizeFlags

func (Instance) SizeFlagsStretchRatio

func (self Instance) SizeFlagsStretchRatio() Float.X

func (Instance) SizeFlagsVertical

func (self Instance) SizeFlagsVertical() gdclass.ControlSizeFlags

func (Instance) Theme

func (self Instance) Theme() [1]gdclass.Theme

func (Instance) ThemeTypeVariation

func (self Instance) ThemeTypeVariation() string

func (Instance) TooltipText

func (self Instance) TooltipText() string

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) UpdateMinimumSize

func (self Instance) UpdateMinimumSize()

Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) WarpMouse

func (self Instance) WarpMouse(position Vector2.XY)

Moves the mouse cursor to [param position], relative to [member position] of this [Control]. [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.

type Interface

type Interface interface {
	//Virtual method to be implemented by the user. Returns whether the given [param point] is inside this control.
	//If not overridden, default behavior is checking if the point is within control's Rect.
	//[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]Rect2(Vector2.ZERO, size).has_point(point)[/code].
	HasPoint(point Vector2.XY) bool
	//User defined BiDi algorithm override function.
	//Returns an [Array] of [Vector3i] text ranges and text base directions, in the left-to-right order. Ranges should cover full source [param text] without overlaps. BiDi algorithm will be used on each range separately.
	StructuredTextParser(args []any, text string) []Vector3i.XYZ
	//Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member custom_minimum_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).
	//If not overridden, defaults to [constant Vector2.ZERO].
	//[b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc.
	GetMinimumSize() Vector2.XY
	//Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip].
	//[b]Note:[/b] If this method returns an empty [String], no tooltip is displayed.
	GetTooltip(at_position Vector2.XY) string
	//Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [param at_position] is local to this control. Drag may be forced with [method force_drag].
	//A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
	//[codeblocks]
	//[gdscript]
	//func _get_drag_data(position):
	//    var mydata = make_data() # This is your custom method generating the drag data.
	//    set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
	//    return mydata
	//[/gdscript]
	//[csharp]
	//public override Variant _GetDragData(Vector2 atPosition)
	//{
	//    var myData = MakeData(); // This is your custom method generating the drag data.
	//    SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data.
	//    return myData;
	//}
	//[/csharp]
	//[/codeblocks]
	GetDragData(at_position Vector2.XY) any
	//Godot calls this method to test if [param data] from a control's [method _get_drag_data] can be dropped at [param at_position]. [param at_position] is local to this control.
	//This method should only be used to test the data. Process the data in [method _drop_data].
	//[codeblocks]
	//[gdscript]
	//func _can_drop_data(position, data):
	//    # Check position if it is relevant to you
	//    # Otherwise, just check data
	//    return typeof(data) == TYPE_DICTIONARY and data.has("expected")
	//[/gdscript]
	//[csharp]
	//public override bool _CanDropData(Vector2 atPosition, Variant data)
	//{
	//    // Check position if it is relevant to you
	//    // Otherwise, just check data
	//    return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("expected");
	//}
	//[/csharp]
	//[/codeblocks]
	CanDropData(at_position Vector2.XY, data any) bool
	//Godot calls this method to pass you the [param data] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [param data] is allowed to drop at [param at_position] where [param at_position] is local to this control.
	//[codeblocks]
	//[gdscript]
	//func _can_drop_data(position, data):
	//    return typeof(data) == TYPE_DICTIONARY and data.has("color")
	//
	//func _drop_data(position, data):
	//    var color = data["color"]
	//[/gdscript]
	//[csharp]
	//public override bool _CanDropData(Vector2 atPosition, Variant data)
	//{
	//    return data.VariantType == Variant.Type.Dictionary && dict.AsGodotDictionary().ContainsKey("color");
	//}
	//
	//public override void _DropData(Vector2 atPosition, Variant data)
	//{
	//    Color color = data.AsGodotDictionary()["color"].AsColor();
	//}
	//[/csharp]
	//[/codeblocks]
	DropData(at_position Vector2.XY, data any)
	//Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [param for_text] includes the contents of the [member tooltip_text] property.
	//The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead.
	//The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member tooltip_text] for an example).
	//[b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member custom_minimum_size] to some non-zero value.
	//[b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.
	//[b]Example of usage with a custom-constructed node:[/b]
	//[codeblocks]
	//[gdscript]
	//func _make_custom_tooltip(for_text):
	//    var label = Label.new()
	//    label.text = for_text
	//    return label
	//[/gdscript]
	//[csharp]
	//public override Control _MakeCustomTooltip(string forText)
	//{
	//    var label = new Label();
	//    label.Text = forText;
	//    return label;
	//}
	//[/csharp]
	//[/codeblocks]
	//[b]Example of usage with a custom scene instance:[/b]
	//[codeblocks]
	//[gdscript]
	//func _make_custom_tooltip(for_text):
	//    var tooltip = preload("res://some_tooltip_scene.tscn").instantiate()
	//    tooltip.get_node("Label").text = for_text
	//    return tooltip
	//[/gdscript]
	//[csharp]
	//public override Control _MakeCustomTooltip(string forText)
	//{
	//    Node tooltip = ResourceLoader.Load<PackedScene>("res://some_tooltip_scene.tscn").Instantiate();
	//    tooltip.GetNode<Label>("Label").Text = forText;
	//    return tooltip;
	//}
	//[/csharp]
	//[/codeblocks]
	MakeCustomTooltip(for_text string) Object.Instance
	//Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
	//[b]Example usage for clicking a control:[/b]
	//[codeblocks]
	//[gdscript]
	//func _gui_input(event):
	//    if event is InputEventMouseButton:
	//        if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
	//            print("I've been clicked D:")
	//[/gdscript]
	//[csharp]
	//public override void _GuiInput(InputEvent @event)
	//{
	//    if (@event is InputEventMouseButton mb)
	//    {
	//        if (mb.ButtonIndex == MouseButton.Left && mb.Pressed)
	//        {
	//            GD.Print("I've been clicked D:");
	//        }
	//    }
	//}
	//[/csharp]
	//[/codeblocks]
	//The event won't trigger if:
	//* clicking outside the control (see [method _has_point]);
	//* control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
	//* control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
	//* control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event;
	//* it happens outside the parent's rectangle and the parent has either [member clip_contents] enabled.
	//[b]Note:[/b] Event position is relative to the control origin.
	GuiInput(event [1]gdclass.InputEvent)
}

type LayoutDirection

type LayoutDirection = gdclass.ControlLayoutDirection //gd:Control.LayoutDirection
const (
	/*Automatic layout direction, determined from the parent control layout direction.*/
	LayoutDirectionInherited LayoutDirection = 0
	/*Automatic layout direction, determined from the current locale.*/
	LayoutDirectionLocale LayoutDirection = 1
	/*Left-to-right layout direction.*/
	LayoutDirectionLtr LayoutDirection = 2
	/*Right-to-left layout direction.*/
	LayoutDirectionRtl LayoutDirection = 3
)

type LayoutPreset

type LayoutPreset = gdclass.ControlLayoutPreset //gd:Control.LayoutPreset
const (
	/*Snap all 4 anchors to the top-left of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetTopLeft LayoutPreset = 0
	/*Snap all 4 anchors to the top-right of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetTopRight LayoutPreset = 1
	/*Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetBottomLeft LayoutPreset = 2
	/*Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetBottomRight LayoutPreset = 3
	/*Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetCenterLeft LayoutPreset = 4
	/*Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetCenterTop LayoutPreset = 5
	/*Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetCenterRight LayoutPreset = 6
	/*Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetCenterBottom LayoutPreset = 7
	/*Snap all 4 anchors to the center of the parent control's bounds. Use with [method set_anchors_preset].*/
	PresetCenter LayoutPreset = 8
	/*Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with [method set_anchors_preset].*/
	PresetLeftWide LayoutPreset = 9
	/*Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset].*/
	PresetTopWide LayoutPreset = 10
	/*Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset].*/
	PresetRightWide LayoutPreset = 11
	/*Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with [method set_anchors_preset].*/
	PresetBottomWide LayoutPreset = 12
	/*Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with [method set_anchors_preset].*/
	PresetVcenterWide LayoutPreset = 13
	/*Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset].*/
	PresetHcenterWide LayoutPreset = 14
	/*Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. Use with [method set_anchors_preset].*/
	PresetFullRect LayoutPreset = 15
)

type LayoutPresetMode

type LayoutPresetMode = gdclass.ControlLayoutPresetMode //gd:Control.LayoutPresetMode
const (
	/*The control will be resized to its minimum size.*/
	PresetModeMinsize LayoutPresetMode = 0
	/*The control's width will not change.*/
	PresetModeKeepWidth LayoutPresetMode = 1
	/*The control's height will not change.*/
	PresetModeKeepHeight LayoutPresetMode = 2
	/*The control's size will not change.*/
	PresetModeKeepSize LayoutPresetMode = 3
)

type MouseFilter

type MouseFilter = gdclass.ControlMouseFilter //gd:Control.MouseFilter
const (
	/*The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.*/
	MouseFilterStop MouseFilter = 0
	/*The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing.*/
	MouseFilterPass MouseFilter = 1
	/*The control will not receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically.
	  [b]Note:[/b] If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted.*/
	MouseFilterIgnore MouseFilter = 2
)

type Side

type Side int
const (
	/*Left side, usually used for [Control] or [StyleBox]-derived classes.*/
	SideLeft Side = 0
	/*Top side, usually used for [Control] or [StyleBox]-derived classes.*/
	SideTop Side = 1
	/*Right side, usually used for [Control] or [StyleBox]-derived classes.*/
	SideRight Side = 2
	/*Bottom side, usually used for [Control] or [StyleBox]-derived classes.*/
	SideBottom Side = 3
)

type SizeFlags

type SizeFlags = gdclass.ControlSizeFlags //gd:Control.SizeFlags
const (
	/*Tells the parent [Container] to align the node with its start, either the top or the left edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical].
	  [b]Note:[/b] Setting this flag is equal to not having any size flags.*/
	SizeShrinkBegin SizeFlags = 0
	/*Tells the parent [Container] to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with [member size_flags_horizontal] and [member size_flags_vertical].*/
	SizeFill SizeFlags = 1
	/*Tells the parent [Container] to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See [member size_flags_stretch_ratio]. Use with [member size_flags_horizontal] and [member size_flags_vertical].*/
	SizeExpand SizeFlags = 2
	/*Sets the node's size flags to both fill and expand. See [constant SIZE_FILL] and [constant SIZE_EXPAND] for more information.*/
	SizeExpandFill SizeFlags = 3
	/*Tells the parent [Container] to center the node in the available space. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical].*/
	SizeShrinkCenter SizeFlags = 4
	/*Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical].*/
	SizeShrinkEnd SizeFlags = 8
)

type TextDirection

type TextDirection = gdclass.ControlTextDirection //gd:Control.TextDirection
const (
	/*Text writing direction is the same as layout direction.*/
	TextDirectionInherited TextDirection = 3
	/*Automatic text writing direction, determined from the current locale and text content.*/
	TextDirectionAuto TextDirection = 0
	/*Left-to-right text writing direction.*/
	TextDirectionLtr TextDirection = 1
	/*Right-to-left text writing direction.*/
	TextDirectionRtl TextDirection = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL