Control

All user interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent.

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 margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, margins, 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. User Interface nodes and input Godot sends input events to the scene's root node first, by calling Node._input. Node._input forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls MainLoop._inputEvent. Call acceptEvent so no other node receives the event. Once you accept an input, it becomes handled so Node._unhandledInput will not process it. Only one Control node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call grabFocus. Control nodes lose focus when another node grabs it, or if you hide the node in focus. Sets mouseFilter 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 add_*_override methods, like addFontOverride. You can override the theme with the inspector. Note: Theme items are not GodotObject properties. This means you can't access their values using GodotObject.get and GodotObject.set. Instead, use getColor, getConstant, getFont, getIcon, getStylebox, and the add_*_override methods provided by this class.

@GodotBaseClass
struct Control {}

Members

Aliases

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

Enums

Anchor
enum Anchor
Constants
enum Constants
CursorShape
enum CursorShape
FocusMode
enum FocusMode
GrowDirection
enum GrowDirection
LayoutPreset
enum LayoutPreset
LayoutPresetMode
enum LayoutPresetMode
MouseFilter
enum MouseFilter
SizeFlags
enum SizeFlags

Functions

_clipsInput
bool _clipsInput()

Virtual method to be implemented by the user. Returns whether _guiInput should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this Control. Similar to rectClipContent, but doesn't affect visibility. If not overridden, defaults to false.

_getMinimumSize
Vector2 _getMinimumSize()

Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to rectMinSize 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.

_getTooltip
String _getTooltip()
_guiInput
void _guiInput(InputEvent event)

Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See acceptEvent.

_makeCustomTooltip
Control _makeCustomTooltip(String for_text)

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 for_text includes the contents of the hintTooltip 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 null 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 Theme.setStylebox for the type "TooltipPanel" (see hintTooltip for an example). Note: The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its rectMinSize to some non-zero value. Example of usage with a custom-constructed node:

_overrideChanged
void _overrideChanged()
_setAnchor
void _setAnchor(long margin, double anchor)
_setGlobalPosition
void _setGlobalPosition(Vector2 position)
_setPosition
void _setPosition(Vector2 margin)
_setSize
void _setSize(Vector2 size)
_sizeChanged
void _sizeChanged()
_themeChanged
void _themeChanged()
_updateMinimumSize
void _updateMinimumSize()
acceptEvent
void acceptEvent()

Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to Node._unhandledInput or Node._unhandledKeyInput.

addColorOverride
void addColorOverride(String name, Color color)

Overrides the Color with given name in the theme resource the control uses. Note: Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color. Example of overriding a label's color and resetting it later:

addConstantOverride
void addConstantOverride(String name, long constant)

Overrides an integer constant with given name in the theme resource the control uses. If the constant is 0, the override is cleared and the constant from assigned Theme is used.

addFontOverride
void addFontOverride(String name, Font font)

Overrides the font with given name in the theme resource the control uses. If font is null or invalid, the override is cleared and the font from assigned Theme is used.

addIconOverride
void addIconOverride(String name, Texture texture)

Overrides the icon with given name in the theme resource the control uses. If icon is null or invalid, the override is cleared and the icon from assigned Theme is used.

addShaderOverride
void addShaderOverride(String name, Shader shader)

Overrides the Shader with given name in the theme resource the control uses. If shader is null or invalid, the override is cleared and the shader from assigned Theme is used.

addStyleboxOverride
void addStyleboxOverride(String name, StyleBox stylebox)

Overrides the StyleBox with given name in the theme resource the control uses. If stylebox is empty or invalid, the override is cleared and the StyleBox from assigned Theme is used. Example of modifying a property in a StyleBox by duplicating it:

canDropData
bool canDropData(Vector2 position, VariantArg1 data)

Godot calls this method to test if data from a control's getDragData can be dropped at position. position is local to this control. This method should only be used to test the data. Process the data in dropData.

dropData
void dropData(Vector2 position, VariantArg1 data)

Godot calls this method to pass you the data from a control's getDragData result. Godot first calls canDropData to test if data is allowed to drop at position where position is local to this control.

findNextValidFocus
Control findNextValidFocus()

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

findPrevValidFocus
Control findPrevValidFocus()

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

forceDrag
void forceDrag(VariantArg0 data, Control preview)

Forces drag and bypasses getDragData and setDragPreview by passing data and preview. Drag will start even if the mouse is neither over nor pressed on this control. The methods canDropData and dropData must be implemented on controls that want to receive drop data.

getAnchor
double getAnchor(long margin)

Returns the anchor identified by margin constant from margin enum. A getter method for anchorBottom, anchorLeft, anchorRight and anchorTop.

getBegin
Vector2 getBegin()

Returns marginLeft and marginTop. See also rectPosition.

getColor
Color getColor(String name, String node_type)

Returns a color from assigned Theme with given name and associated with Control of given node_type.

getCombinedMinimumSize
Vector2 getCombinedMinimumSize()

Returns combined minimum size from rectMinSize and getMinimumSize.

getConstant
long getConstant(String name, String node_type)

Returns a constant from assigned Theme with given name and associated with Control of given node_type.

getCursorShape
Control.CursorShape getCursorShape(Vector2 position)

Returns the mouse cursor shape the control displays on mouse hover. See cursorshape.

getCustomMinimumSize
Vector2 getCustomMinimumSize()
getDefaultCursorShape
Control.CursorShape getDefaultCursorShape()
getDragData
Variant getDragData(Vector2 position)

Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns null if there is no data to drag. Controls that want to receive drop data should implement canDropData and dropData. position is local to this control. Drag may be forced with forceDrag. A preview that will follow the mouse that should represent the data can be set with setDragPreview. A good time to set the preview is in this method.

getEnd
Vector2 getEnd()

Returns marginRight and marginBottom.

getFocusMode
Control.FocusMode getFocusMode()
getFocusNeighbour
NodePath getFocusNeighbour(long margin)

Returns the focus neighbour identified by margin constant from margin enum. A getter method for focusNeighbourBottom, focusNeighbourLeft, focusNeighbourRight and focusNeighbourTop.

getFocusNext
NodePath getFocusNext()
getFocusOwner
Control getFocusOwner()

Returns the control that has the keyboard focus or null if none.

getFocusPrevious
NodePath getFocusPrevious()
getFont
Ref!Font getFont(String name, String node_type)

Returns a font from assigned Theme with given name and associated with Control of given node_type.

getGlobalPosition
Vector2 getGlobalPosition()
getGlobalRect
Rect2 getGlobalRect()

Returns the position and size of the control relative to the top-left corner of the screen. See rectPosition and rectSize.

getHGrowDirection
Control.GrowDirection getHGrowDirection()
getHSizeFlags
long getHSizeFlags()
getIcon
Ref!Texture getIcon(String name, String node_type)

Returns an icon from assigned Theme with given name and associated with Control of given node_type.

getMargin
double getMargin(long margin)

Returns the anchor identified by margin constant from margin enum. A getter method for marginBottom, marginLeft, marginRight and marginTop.

getMinimumSize
Vector2 getMinimumSize()

Returns the minimum size for this control. See rectMinSize.

getMouseFilter
Control.MouseFilter getMouseFilter()
getParentAreaSize
Vector2 getParentAreaSize()

Returns the width/height occupied in the parent control.

getParentControl
Control getParentControl()

Returns the parent control node.

getPassOnModalCloseClick
bool getPassOnModalCloseClick()
getPivotOffset
Vector2 getPivotOffset()
getPosition
Vector2 getPosition()
getRect
Rect2 getRect()

Returns the position and size of the control relative to the top-left corner of the parent Control. See rectPosition and rectSize.

getRotation
double getRotation()

Returns the rotation (in radians).

getRotationDegrees
double getRotationDegrees()
getScale
Vector2 getScale()
getSize
Vector2 getSize()
getStretchRatio
double getStretchRatio()
getStylebox
Ref!StyleBox getStylebox(String name, String node_type)

Returns a StyleBox from assigned Theme with given name and associated with Control of given node_type.

getTheme
Ref!Theme getTheme()
getTooltip
String getTooltip(Vector2 at_position)

Returns the tooltip, which will appear when the cursor is resting over this control. See hintTooltip.

getVGrowDirection
Control.GrowDirection getVGrowDirection()
getVSizeFlags
long getVSizeFlags()
grabClickFocus
void grabClickFocus()

Creates an InputEventMouseButton that attempts to click the control. If the event is received, the control acquires focus.

grabFocus
void grabFocus()

Steal the focus from another control and become the focused control (see focusMode).

hasColor
bool hasColor(String name, String node_type)

Returns true if Color with given name and associated with Control of given node_type exists in assigned Theme.

hasColorOverride
bool hasColorOverride(String name)

Returns true if Color with given name has a valid override in this Control node.

hasConstant
bool hasConstant(String name, String node_type)

Returns true if constant with given name and associated with Control of given node_type exists in assigned Theme.

hasConstantOverride
bool hasConstantOverride(String name)

Returns true if constant with given name has a valid override in this Control node.

hasFocus
bool hasFocus()

Returns true if this is the current focused control. See focusMode.

hasFont
bool hasFont(String name, String node_type)

Returns true if font with given name and associated with Control of given node_type exists in assigned Theme.

hasFontOverride
bool hasFontOverride(String name)

Returns true if font with given name has a valid override in this Control node.

hasIcon
bool hasIcon(String name, String node_type)

Returns true if icon with given name and associated with Control of given node_type exists in assigned Theme.

hasIconOverride
bool hasIconOverride(String name)

Returns true if icon with given name has a valid override in this Control node.

hasPoint
bool hasPoint(Vector2 point)

Virtual method to be implemented by the user. Returns whether the given point is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. Note: If you want to check if a point is inside the control, you can use get_rect().has_point(point).

hasShaderOverride
bool hasShaderOverride(String name)

Returns true if Shader with given name has a valid override in this Control node.

hasStylebox
bool hasStylebox(String name, String node_type)

Returns true if StyleBox with given name and associated with Control of given node_type exists in assigned Theme.

hasStyleboxOverride
bool hasStyleboxOverride(String name)

Returns true if StyleBox with given name has a valid override in this Control node.

isClippingContents
bool isClippingContents()
minimumSizeChanged
void minimumSizeChanged()

Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with getMinimumSize when the return value is changed. Setting rectMinSize directly calls this method automatically.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Control other)
opEquals
bool opEquals(typeof(null) n)
releaseFocus
void releaseFocus()

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

setAnchor
void setAnchor(long margin, double anchor, bool keep_margin, bool push_opposite_anchor)

Sets the anchor identified by margin constant from margin enum to value anchor. A setter method for anchorBottom, anchorLeft, anchorRight and anchorTop. If keep_margin is true, margins aren't updated after this operation. If push_opposite_anchor is true 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 push_opposite_anchor was false, the left anchor would get value 0.5.

setAnchorAndMargin
void setAnchorAndMargin(long margin, double anchor, double offset, bool push_opposite_anchor)

Works the same as setAnchor, but instead of keep_margin argument and automatic update of margin, it allows to set the margin offset yourself (see setMargin).

setAnchorsAndMarginsPreset
void setAnchorsAndMarginsPreset(long preset, long resize_mode, long margin)

Sets both anchor preset and margin preset. See setAnchorsPreset and setMarginsPreset.

setAnchorsPreset
void setAnchorsPreset(long preset, bool keep_margins)

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

setBegin
void setBegin(Vector2 position)

Sets marginLeft and marginTop at the same time. Equivalent of changing rectPosition.

setClipContents
void setClipContents(bool enable)
setCustomMinimumSize
void setCustomMinimumSize(Vector2 size)
setDefaultCursorShape
void setDefaultCursorShape(long shape)
setDragForwarding
void setDragForwarding(Control target)

Forwards the handling of this control's drag and drop to target control. Forwarding can be implemented in the target control similar to the methods getDragData, canDropData, and dropData but with two differences: 1. The function name must be suffixed with _fw 2. The function must take an extra argument that is the control doing the forwarding

setDragPreview
void setDragPreview(Control control)

Shows the given control at the mouse pointer. A good time to call this method is in getDragData. 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.

setEnd
void setEnd(Vector2 position)

Sets marginRight and marginBottom at the same time.

setFocusMode
void setFocusMode(long mode)
setFocusNeighbour
void setFocusNeighbour(long margin, NodePathArg1 neighbour)

Sets the anchor identified by margin constant from margin enum to Control at neighbor node path. A setter method for focusNeighbourBottom, focusNeighbourLeft, focusNeighbourRight and focusNeighbourTop.

setFocusNext
void setFocusNext(NodePathArg0 next)
setFocusPrevious
void setFocusPrevious(NodePathArg0 previous)
setGlobalPosition
void setGlobalPosition(Vector2 position, bool keep_margins)

Sets the rectGlobalPosition to given position. If keep_margins is true, control's anchors will be updated instead of margins.

setHGrowDirection
void setHGrowDirection(long direction)
setHSizeFlags
void setHSizeFlags(long flags)
setMargin
void setMargin(long margin, double offset)

Sets the margin identified by margin constant from margin enum to given offset. A setter method for marginBottom, marginLeft, marginRight and marginTop.

setMarginsPreset
void setMarginsPreset(long preset, long resize_mode, long margin)

Sets the margins to a preset from Control.layoutpreset enum. This is the code equivalent to using the Layout menu in the 2D editor. Use parameter resize_mode with constants from 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. PRESET_LEFT_WIDE. Use parameter margin to determine the gap between the Control and the edges.

setMouseFilter
void setMouseFilter(long filter)
setPassOnModalCloseClick
void setPassOnModalCloseClick(bool enabled)
setPivotOffset
void setPivotOffset(Vector2 pivot_offset)
setPosition
void setPosition(Vector2 position, bool keep_margins)

Sets the rectPosition to given position. If keep_margins is true, control's anchors will be updated instead of margins.

setRotation
void setRotation(double radians)

Sets the rotation (in radians).

setRotationDegrees
void setRotationDegrees(double degrees)
setScale
void setScale(Vector2 scale)
setSize
void setSize(Vector2 size, bool keep_margins)

Sets the size (see rectSize). If keep_margins is true, control's anchors will be updated instead of margins.

setStretchRatio
void setStretchRatio(double ratio)
setTheme
void setTheme(Theme theme)
setTooltip
void setTooltip(String tooltip)
setVGrowDirection
void setVGrowDirection(long direction)
setVSizeFlags
void setVSizeFlags(long flags)
showModal
void showModal(bool exclusive)

Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. If exclusive is true, other controls will not receive input and clicking outside this control will not close it.

toHash
size_t toHash()
warpMouse
void warpMouse(Vector2 to_position)

Moves the mouse cursor to to_position, relative to rectPosition of this Control.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

anchorBottom
double anchorBottom [@property getter]
double anchorBottom [@property setter]

Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the anchor constants for convenience.

anchorLeft
double anchorLeft [@property getter]
double anchorLeft [@property setter]

Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the anchor constants for convenience.

anchorRight
double anchorRight [@property getter]
double anchorRight [@property setter]

Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the anchor constants for convenience.

anchorTop
double anchorTop [@property getter]
double anchorTop [@property setter]

Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the anchor constants for convenience.

focusMode
Control.FocusMode focusMode [@property getter]
long focusMode [@property setter]

The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.

focusNeighbourBottom
NodePath focusNeighbourBottom [@property getter]
NodePath focusNeighbourBottom [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the ui_down input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the bottom of this one.

focusNeighbourLeft
NodePath focusNeighbourLeft [@property getter]
NodePath focusNeighbourLeft [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the ui_left input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the left of this one.

focusNeighbourRight
NodePath focusNeighbourRight [@property getter]
NodePath focusNeighbourRight [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the ui_right input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the bottom of this one.

focusNeighbourTop
NodePath focusNeighbourTop [@property getter]
NodePath focusNeighbourTop [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the ui_top input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the bottom of this one.

focusNext
NodePath focusNext [@property getter]
NodePath focusNext [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the ui_focus_next input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.

focusPrevious
NodePath focusPrevious [@property getter]
NodePath focusPrevious [@property setter]

Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the ui_focus_prev input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.

growHorizontal
Control.GrowDirection growHorizontal [@property getter]
long growHorizontal [@property setter]

Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.

growVertical
Control.GrowDirection growVertical [@property getter]
long growVertical [@property setter]

Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.

hintTooltip
String hintTooltip [@property getter]
String hintTooltip [@property setter]

Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the mouseFilter property is not constant MOUSE_FILTER_IGNORE. You can change the time required for the tooltip to appear with gui/timers/tooltip_delay_sec option in Project Settings. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding _makeCustomTooltip. The default tooltip includes a PopupPanel and Label whose theme properties can be customized using Theme methods with the "TooltipPanel" and "TooltipLabel" respectively. For example:

inputPassOnModalCloseClick
bool inputPassOnModalCloseClick [@property getter]
bool inputPassOnModalCloseClick [@property setter]

Enables whether input should propagate when you close the control as modal. If false, stops event handling at the viewport input event handling. The viewport first hides the modal and after marks the input as handled.

marginBottom
double marginBottom [@property getter]
double marginBottom [@property setter]

Distance between the node's bottom edge and its parent control, based on anchorBottom. Margins are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Margins update automatically when you move or resize the node.

marginLeft
double marginLeft [@property getter]
double marginLeft [@property setter]

Distance between the node's left edge and its parent control, based on anchorLeft. Margins are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Margins update automatically when you move or resize the node.

marginRight
double marginRight [@property getter]
double marginRight [@property setter]

Distance between the node's right edge and its parent control, based on anchorRight. Margins are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Margins update automatically when you move or resize the node.

marginTop
double marginTop [@property getter]
double marginTop [@property setter]

Distance between the node's top edge and its parent control, based on anchorTop. Margins are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Margins update automatically when you move or resize the node.

mouseDefaultCursorShape
Control.CursorShape mouseDefaultCursorShape [@property getter]
long mouseDefaultCursorShape [@property setter]

The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. Note: On Linux, shapes may vary depending on the cursor theme of the system.

mouseFilter
Control.MouseFilter mouseFilter [@property getter]
long mouseFilter [@property setter]

Controls whether the control will be able to receive mouse button input events through _guiInput and how these events should be handled. Also controls whether the control can receive the mouseEntered, and mouseExited signals. See the constants to learn what each does.

rectClipContent
bool rectClipContent [@property getter]
bool rectClipContent [@property setter]

Enables whether rendering of CanvasItem based children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered.

rectGlobalPosition
Vector2 rectGlobalPosition [@property getter]
Vector2 rectGlobalPosition [@property setter]

The node's global position, relative to the world (usually to the top-left corner of the window).

rectMinSize
Vector2 rectMinSize [@property getter]
Vector2 rectMinSize [@property setter]

The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.

rectPivotOffset
Vector2 rectPivotOffset [@property getter]
Vector2 rectPivotOffset [@property setter]

By default, the node's pivot is its top-left corner. When you change its rectScale, it will scale around this pivot. Set this property to rectSize / 2 to center the pivot in the node's rectangle.

rectPosition
Vector2 rectPosition [@property getter]
Vector2 rectPosition [@property setter]

The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by rectPivotOffset.

rectRotation
double rectRotation [@property getter]
double rectRotation [@property setter]

The node's rotation around its pivot, in degrees. See rectPivotOffset to change the pivot's position.

rectScale
Vector2 rectScale [@property getter]
Vector2 rectScale [@property setter]

The node's scale, relative to its rectSize. Change this property to scale the node around its rectPivotOffset. The Control's hintTooltip will also scale according to this value. Note: This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the url=https://docs.godotengine.org/en/3.3/tutorials/viewports/multiple_resolutions.htmldocumentation/url instead of scaling Controls individually. Note: If the Control node is a child of a Container node, the scale will be reset to Vector2(1, 1) when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using yield(get_tree(), "idle_frame") then set its rectScale property.

rectSize
Vector2 rectSize [@property getter]
Vector2 rectSize [@property setter]

The size of the node's bounding rectangle, in pixels. Container nodes update this property automatically.

sizeFlagsHorizontal
long sizeFlagsHorizontal [@property setter]

Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the sizeflags constants to change the flags. See the constants to learn what each does.

sizeFlagsHorizontal
long sizeFlagsHorizontal [@property getter]

Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the sizeflags constants to change the flags. See the constants to learn what each does.

sizeFlagsStretchRatio
double sizeFlagsStretchRatio [@property getter]
double sizeFlagsStretchRatio [@property setter]

If the node and at least one of its neighbours uses the constant SIZE_EXPAND size flag, the parent Container will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.

sizeFlagsVertical
long sizeFlagsVertical [@property getter]
long sizeFlagsVertical [@property setter]

Tells the parent Container nodes how they should resize and place the node on the Y axis. Use one of the sizeflags constants to change the flags. See the constants to learn what each does.

theme
Theme theme [@property getter]
Theme theme [@property setter]

Changing this property replaces the current Theme resource this node and all its Control children use.

Static functions

_new
Control _new()

Construct a new instance of Control. Note: use memnew!Control 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