Returns the minimum size for this control. See rectMinSize.
Use this method to process and accept inputs on UI elements. See acceptEvent. Replaces Godot 2's _input_event.
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.
Overrides the color in the theme resource the node uses.
Overrides an integer constant in the theme resource the node uses. If the constant is invalid, Godot clears the override.
Overrides the name font in the theme resource the node uses. If font is empty, Godot clears the override.
Overrides the name icon in the theme resource the node uses. If icon is empty, Godot clears the override.
Overrides the name shader in the theme resource the node uses. If shader is empty, Godot clears the override.
Overrides the name Stylebox in the theme resource the node uses. If stylebox is empty, Godot clears the override.
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.
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.
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.
Returns marginLeft and marginTop. See also rectPosition.
Returns the mouse cursor shape the control displays on mouse hover. See cursorshape.
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Return 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.
Returns marginRight and marginBottom.
Returns the control that has the keyboard focus or null if none.
Returns the position and size of the control relative to the top-left corner of the screen. See rectPosition and rectSize.
Returns the minimum size for this control. See rectMinSize.
Returns the width/height occupied in the parent control.
Returns the parent control node.
Returns the position and size of the control relative to the top-left corner of the parent Control. See rectPosition and rectSize.
Returns the rotation (in radians).
Returns the tooltip, which will appear when the cursor is resting over this control.
Steal the focus from another control and become the focused control (see setFocusMode).
Returns true if this is the current focused control. See focusMode.
Give up the focus. No other control will be able to receive keyboard input.
Sets marginLeft and marginTop at the same time.
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
Shows the given control at the mouse pointer. A good time to call this method is in getDragData.
Sets marginRight and marginBottom at the same time.
Sets the rotation (in radians).
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.
Anchors the bottom edge of the node to the origin, the center, or the end of its parent container. It changes how the bottom margin updates when the node moves or changes size. Use one of the ANCHOR_* constants. Default value: ANCHOR_BEGIN.
Anchors the left edge of the node to the origin, the center or the end of its parent container. It changes how the left margin updates when the node moves or changes size. Use one of the ANCHOR_* constants. Default value: ANCHOR_BEGIN.
Anchors the right edge of the node to the origin, the center or the end of its parent container. It changes how the right margin updates when the node moves or changes size. Use one of the ANCHOR_* constants. Default value: ANCHOR_BEGIN.
Anchors the top edge of the node to the origin, the center or the end of its parent container. It changes how the top margin updates when the node moves or changes size. Use one of the ANCHOR_* constants. Default value: ANCHOR_BEGIN.
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.
Tells Godot which node it should give keyboard focus to if the user presses Tab, the down arrow on the keyboard, or down on a gamepad. 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. If the user presses Tab, Godot will give focus to the closest node to the right first, then to the bottom. If the user presses Shift+Tab, Godot will look to the left of the node, then above it.
Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the left arrow on the keyboard or left on a gamepad. 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.
Tells Godot which node it should give keyboard focus to if the user presses Tab, the right arrow on the keyboard or right on a gamepad. 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.
Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the top arrow on the keyboard or top on a gamepad. 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.
Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments.
Distance between the node's bottom edge and its parent container, based on anchorBottom. Margins are often controlled by one or multiple parent Container nodes. Margins update automatically when you move or resize the node.
Distance between the node's left edge and its parent container, based on anchorLeft.
Distance between the node's right edge and its parent container, based on anchorRight.
Distance between the node's top edge and its parent container, based on anchorTop.
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.
Controls whether the control will be able to receive mouse button input events through _guiInput and how these events should be handled. Use one of the MOUSE_FILTER_* constants. See the constants to learn what each does.
The node's global position, relative to the world (usually to the top-left corner of the window).
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.
The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by rectPivotOffset.
The node's rotation around its pivot, in degrees. See rectPivotOffset to change the pivot's position.
The node's scale, relative to its rectSize. Change this property to scale the node around its rectPivotOffset.
The size of the node's bounding rectangle, in pixels. Container nodes update this property automatically.
Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the SIZE_* constants to change the flags. See the constants to learn what each does.
Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the SIZE_* constants to change the flags. See the constants to learn what each does.
If the node and at least one of its neighbours uses the 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.
Tells the parent Container nodes how they should resize and place the node on the Y axis. Use one of the SIZE_* constants to change the flags. See the constants to learn what each does.
Changing this property replaces the current Theme resource this node and all its Control children use.
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 User Interface or UI related nodes. Control features a bounding rectangle that defines its extents, an anchor position relative to its parent 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 accepted 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. Set mouseFilter to 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.