.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Control: Control ======= **Inherits:** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`Label`, :ref:`Tabs`, :ref:`TextureFrame`, :ref:`ButtonArray`, :ref:`VideoPlayer`, :ref:`LineEdit`, :ref:`ColorFrame`, :ref:`Container`, :ref:`ReferenceFrame`, :ref:`Patch9Frame`, :ref:`TextEdit`, :ref:`BaseButton`, :ref:`Popup`, :ref:`Tree`, :ref:`Separator`, :ref:`Panel`, :ref:`TabContainer`, :ref:`Range`, :ref:`RichTextLabel`, :ref:`GraphEdit`, :ref:`ItemList` **Category:** Core Brief Description ----------------- Control is the base node for all the GUI components. Member Functions ---------------- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_input_event` **(** :ref:`InputEvent` event **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`accept_event` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_color_override` **(** :ref:`String` name, :ref:`Color` color **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_constant_override` **(** :ref:`String` name, :ref:`int` constant **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_font_override` **(** :ref:`String` name, :ref:`Font` font **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_icon_override` **(** :ref:`String` name, :ref:`Texture` texture **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_shader_override` **(** :ref:`String` name, :ref:`Shader` shader **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_style_override` **(** :ref:`String` name, :ref:`StyleBox` stylebox **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`can_drop_data` **(** :ref:`Vector2` pos, :ref:`Variant` data **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`drop_data` **(** :ref:`Vector2` pos, :ref:`Variant` data **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`force_drag` **(** :ref:`Variant` data, :ref:`Object` preview **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_anchor` **(** :ref:`int` margin **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_begin` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_combined_minimum_size` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cursor_shape` **(** :ref:`Vector2` pos=Vector2(0, 0) **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_custom_minimum_size` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_default_cursor_shape` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_drag_data` **(** :ref:`Vector2` pos **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_end` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_focus_mode` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NodePath` | :ref:`get_focus_neighbour` **(** :ref:`int` margin **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`get_focus_owner` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_global_pos` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_global_rect` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_h_size_flags` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_margin` **(** :ref:`int` margin **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_minimum_size` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_minimum_size` **(** **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_parent_area_size` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`get_parent_control` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_pos` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_rect` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_rotation` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_rotation_deg` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_scale` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_size` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_stretch_ratio` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Theme` | :ref:`get_theme` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_tooltip` **(** :ref:`Vector2` atpos=Vector2(0, 0) **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_v_size_flags` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`grab_click_focus` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`grab_focus` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_color_override` **(** :ref:`String` name **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_constant_override` **(** :ref:`String` name **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_focus` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_font_override` **(** :ref:`String` name **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_icon_override` **(** :ref:`String` name **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`has_point` **(** :ref:`Vector2` point **)** virtual | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` type="" **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_stylebox_override` **(** :ref:`String` name **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_ignoring_mouse` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_stopping_mouse` **(** **)** const | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`minimum_size_changed` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`release_focus` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_anchor` **(** :ref:`int` margin, :ref:`int` anchor_mode, :ref:`bool` keep_margin=false **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_anchor_and_margin` **(** :ref:`int` margin, :ref:`int` anchor_mode, :ref:`float` offset **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_area_as_parent_rect` **(** :ref:`int` margin=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_begin` **(** :ref:`Vector2` pos **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_minimum_size` **(** :ref:`Vector2` size **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_default_cursor_shape` **(** :ref:`int` shape **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_drag_forwarding` **(** :ref:`Control` target **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_drag_preview` **(** :ref:`Control` control **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_end` **(** :ref:`Vector2` pos **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_focus_mode` **(** :ref:`int` mode **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_focus_neighbour` **(** :ref:`int` margin, :ref:`NodePath` neighbour **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_global_pos` **(** :ref:`Vector2` pos **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_h_size_flags` **(** :ref:`int` flags **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_ignore_mouse` **(** :ref:`bool` ignore **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_margin` **(** :ref:`int` margin, :ref:`float` offset **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_pos` **(** :ref:`Vector2` pos **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_rotation` **(** :ref:`float` radians **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_rotation_deg` **(** :ref:`float` degrees **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_scale` **(** :ref:`Vector2` scale **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_size` **(** :ref:`Vector2` size **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stop_mouse` **(** :ref:`bool` stop **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stretch_ratio` **(** :ref:`float` ratio **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_theme` **(** :ref:`Theme` theme **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tooltip` **(** :ref:`String` tooltip **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_v_size_flags` **(** :ref:`int` flags **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`show_modal` **(** :ref:`bool` exclusive=false **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`warp_mouse` **(** :ref:`Vector2` to_pos **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **focus_enter** **(** **)** Emitted when keyboard focus is gained. - **focus_exit** **(** **)** Emitted when the keyboard focus is lost. - **input_event** **(** :ref:`InputEvent` ev **)** Emitted when an input event is received. Connecting in realtime is recommended for accepting the events. - **minimum_size_changed** **(** **)** Emitted when the minimum size of the control changed. - **modal_close** **(** **)** - **mouse_enter** **(** **)** Emitted when the mouse enters the control area. - **mouse_exit** **(** **)** Emitted when the mouse left the control area. - **resized** **(** **)** Emitted when the control changed size. - **size_flags_changed** **(** **)** Emitted when the size flags changed. Numeric Constants ----------------- - **FOCUS_NONE** = **0** --- Control can't acquire focus. - **FOCUS_CLICK** = **1** --- Control can acquire focus only if clicked. - **FOCUS_ALL** = **2** --- Control can acquire focus if clicked, or by pressing TAB/Directionals in the keyboard from another Control. - **NOTIFICATION_RESIZED** = **40** --- Control changed size (get_size() reports the new size). - **NOTIFICATION_MOUSE_ENTER** = **41** --- Mouse pointer entered the area of the Control. - **NOTIFICATION_MOUSE_EXIT** = **42** --- Mouse pointer exited the area of the Control. - **NOTIFICATION_FOCUS_ENTER** = **43** --- Control gained focus. - **NOTIFICATION_FOCUS_EXIT** = **44** --- Control lost focus. - **NOTIFICATION_THEME_CHANGED** = **45** --- Theme changed. Redrawing is desired. - **NOTIFICATION_MODAL_CLOSE** = **46** --- Modal control was closed. - **CURSOR_ARROW** = **0** - **CURSOR_IBEAM** = **1** - **CURSOR_POINTING_HAND** = **2** - **CURSOR_CROSS** = **3** - **CURSOR_WAIT** = **4** - **CURSOR_BUSY** = **5** - **CURSOR_DRAG** = **6** - **CURSOR_CAN_DROP** = **7** - **CURSOR_FORBIDDEN** = **8** - **CURSOR_VSIZE** = **9** - **CURSOR_HSIZE** = **10** - **CURSOR_BDIAGSIZE** = **11** - **CURSOR_FDIAGSIZE** = **12** - **CURSOR_MOVE** = **13** - **CURSOR_VSPLIT** = **14** - **CURSOR_HSPLIT** = **15** - **CURSOR_HELP** = **16** - **PRESET_TOP_LEFT** = **0** - **PRESET_TOP_RIGHT** = **1** - **PRESET_BOTTOM_LEFT** = **2** - **PRESET_BOTTOM_RIGHT** = **3** - **PRESET_CENTER_LEFT** = **4** - **PRESET_CENTER_TOP** = **5** - **PRESET_CENTER_RIGHT** = **6** - **PRESET_CENTER_BOTTOM** = **7** - **PRESET_CENTER** = **8** - **PRESET_LEFT_WIDE** = **9** - **PRESET_TOP_WIDE** = **10** - **PRESET_RIGHT_WIDE** = **11** - **PRESET_BOTTOM_WIDE** = **12** - **PRESET_VCENTER_WIDE** = **13** - **PRESET_HCENTER_WIDE** = **14** - **PRESET_WIDE** = **15** - **SIZE_EXPAND** = **2** - **SIZE_FILL** = **1** - **SIZE_EXPAND_FILL** = **3** - **SIZE_SHRINK_CENTER** = **4** - **SIZE_SHRINK_END** = **8** - **MOUSE_FILTER_STOP** = **0** - **MOUSE_FILTER_PASS** = **1** - **MOUSE_FILTER_IGNORE** = **2** - **GROW_DIRECTION_BEGIN** = **0** - **GROW_DIRECTION_END** = **1** - **ANCHOR_BEGIN** = **0** --- X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP. - **ANCHOR_END** = **1** --- X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM. Description ----------- Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. In this way, sections of the scene tree made of contiguous control nodes, become user interfaces. Controls are relative to the parent position and size by using anchors and margins. This ensures that they can adapt easily in most situation to changing dialog and screen sizes. When more flexibility is desired, :ref:`Container` derived nodes can be used. Anchors work by defining which margin do they follow, and a value relative to it. Allowed anchoring modes are ANCHOR_BEGIN, where the margin is relative to the top or left margins of the parent (in pixels), ANCHOR_END for the right and bottom margins of the parent and ANCHOR_RATIO, which is a ratio from 0 to 1 in the parent range. Input device events are first sent to the root controls via the :ref:`Node._input`, which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling :ref:`MainLoop._input_event`. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even :ref:`Node._unhandled_input`), the control can accept it by calling :ref:`accept_event`. Only one control can hold the keyboard focus (receiving keyboard events), for that the control must define the focus mode with :ref:`set_focus_mode`. Focus is lost when another control gains it, or the current focus owner is hidden. It is sometimes desired for a control to ignore mouse/pointer events. This is often the case when placing other controls on top of a button, in such cases. Calling :ref:`set_ignore_mouse` enables this function. Finally, controls are skinned according to a :ref:`Theme`. Setting a :ref:`Theme` on a control will propagate all the skinning down the tree. Optionally, skinning can be overridden per each control by calling the add\_\*_override functions, or from the editor. Member Function Description --------------------------- .. _class_Control__get_minimum_size: - :ref:`Vector2` **_get_minimum_size** **(** **)** virtual Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. .. _class_Control__gui_input: - void **_gui_input** **(** :ref:`InputEvent` event **)** virtual .. _class_Control_accept_event: - void **accept_event** **(** **)** Handles the event, no other control will receive it and it will not be sent to nodes waiting on :ref:`Node._unhandled_input` or :ref:`Node._unhandled_key_input`. .. _class_Control_add_color_override: - void **add_color_override** **(** :ref:`String` name, :ref:`Color` color **)** .. _class_Control_add_constant_override: - void **add_constant_override** **(** :ref:`String` name, :ref:`int` constant **)** Override a single constant (integer) in the theme of this Control. If constant equals Theme.INVALID_CONSTANT, override is cleared. .. _class_Control_add_font_override: - void **add_font_override** **(** :ref:`String` name, :ref:`Font` font **)** Override a single font (font) in the theme of this Control. If font is empty, override is cleared. .. _class_Control_add_icon_override: - void **add_icon_override** **(** :ref:`String` name, :ref:`Texture` texture **)** Override a single icon (:ref:`Texture`) in the theme of this Control. If texture is empty, override is cleared. .. _class_Control_add_shader_override: - void **add_shader_override** **(** :ref:`String` name, :ref:`Shader` shader **)** .. _class_Control_add_style_override: - void **add_style_override** **(** :ref:`String` name, :ref:`StyleBox` stylebox **)** Override a single stylebox (Stylebox) in the theme of this Control. If stylebox is empty, override is cleared. .. _class_Control_can_drop_data: - :ref:`bool` **can_drop_data** **(** :ref:`Vector2` pos, :ref:`Variant` data **)** virtual .. _class_Control_drop_data: - void **drop_data** **(** :ref:`Vector2` pos, :ref:`Variant` data **)** virtual .. _class_Control_force_drag: - void **force_drag** **(** :ref:`Variant` data, :ref:`Control` preview **)** .. _class_Control_get_anchor: - :ref:`float` **get_anchor** **(** :ref:`int` margin **)** const Return the anchor type (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). .. _class_Control_get_begin: - :ref:`Vector2` **get_begin** **(** **)** const .. _class_Control_get_color: - :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_get_combined_minimum_size: - :ref:`Vector2` **get_combined_minimum_size** **(** **)** const .. _class_Control_get_constant: - :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_get_cursor_shape: - :ref:`int` **get_cursor_shape** **(** :ref:`Vector2` pos=Vector2( 0, 0 ) **)** const Return the cursor shape at a certain position in the control. .. _class_Control_get_custom_minimum_size: - :ref:`Vector2` **get_custom_minimum_size** **(** **)** const .. _class_Control_get_default_cursor_shape: - :ref:`int` **get_default_cursor_shape** **(** **)** const Return the default cursor shape for this control. See enum CURSOR\_\* for the list of shapes. .. _class_Control_get_drag_data: - :ref:`Object` **get_drag_data** **(** :ref:`Vector2` pos **)** virtual .. _class_Control_get_end: - :ref:`Vector2` **get_end** **(** **)** const Returns MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see :ref:`set_margin`). .. _class_Control_get_focus_mode: - :ref:`int` **get_focus_mode** **(** **)** const Returns the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL) (see :ref:`set_focus_mode`). .. _class_Control_get_focus_neighbour: - :ref:`NodePath` **get_focus_neighbour** **(** :ref:`int` margin **)** const Return the forced neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function. .. _class_Control_get_focus_owner: - :ref:`Control` **get_focus_owner** **(** **)** const Return which control is owning the keyboard focus, or null if no one. .. _class_Control_get_font: - :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_get_global_position: - :ref:`Vector2` **get_global_position** **(** **)** const Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode. .. _class_Control_get_global_rect: - :ref:`Rect2` **get_global_rect** **(** **)** const Return position and size of the Control, relative to the top-left corner of the *window* Control. This is a helper (see :ref:`get_global_position`, :ref:`get_size`). .. _class_Control_get_h_grow_direction: - :ref:`int` **get_h_grow_direction** **(** **)** const .. _class_Control_get_h_size_flags: - :ref:`int` **get_h_size_flags** **(** **)** const Hint for containers, return horizontal positioning flags. .. _class_Control_get_icon: - :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_get_margin: - :ref:`float` **get_margin** **(** :ref:`int` margin **)** const Return a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being returned depends on the anchor mode. .. _class_Control_get_minimum_size: - :ref:`Vector2` **get_minimum_size** **(** **)** const Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. .. _class_Control_get_mouse_filter: - :ref:`int` **get_mouse_filter** **(** **)** const Return when the control is ignoring mouse events (even touchpad events send mouse events). .. _class_Control_get_parent_area_size: - :ref:`Vector2` **get_parent_area_size** **(** **)** const .. _class_Control_get_parent_control: - :ref:`Control` **get_parent_control** **(** **)** const .. _class_Control_get_pivot_offset: - :ref:`Vector2` **get_pivot_offset** **(** **)** const .. _class_Control_get_position: - :ref:`Vector2` **get_position** **(** **)** const Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode. .. _class_Control_get_rect: - :ref:`Rect2` **get_rect** **(** **)** const Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see :ref:`get_position`, :ref:`get_size`). .. _class_Control_get_rotation: - :ref:`float` **get_rotation** **(** **)** const Return the rotation (in radians) .. _class_Control_get_rotation_deg: - :ref:`float` **get_rotation_deg** **(** **)** const Return the rotation (in degrees) .. _class_Control_get_scale: - :ref:`Vector2` **get_scale** **(** **)** const .. _class_Control_get_size: - :ref:`Vector2` **get_size** **(** **)** const Returns the size of the Control, computed from all margins, however the size returned will **never be smaller than the minimum size reported by** :ref:`get_minimum_size`. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, :ref:`get_minimum_size`, :ref:`set_margin`, :ref:`set_anchor`). .. _class_Control_get_stretch_ratio: - :ref:`float` **get_stretch_ratio** **(** **)** const Hint for containers, return the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big. .. _class_Control_get_stylebox: - :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_get_theme: - :ref:`Theme` **get_theme** **(** **)** const Return a :ref:`Theme` override, if one exists (see :ref:`set_theme`). .. _class_Control_get_tooltip: - :ref:`String` **get_tooltip** **(** :ref:`Vector2` atpos=Vector2( 0, 0 ) **)** const Return the tooltip, which will appear when the cursor is resting over this control. .. _class_Control_get_v_grow_direction: - :ref:`int` **get_v_grow_direction** **(** **)** const .. _class_Control_get_v_size_flags: - :ref:`int` **get_v_size_flags** **(** **)** const Hint for containers, return vertical positioning flags. .. _class_Control_grab_click_focus: - void **grab_click_focus** **(** **)** .. _class_Control_grab_focus: - void **grab_focus** **(** **)** Steal the focus from another control and become the focused control (see :ref:`set_focus_mode`). .. _class_Control_has_color: - :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_has_color_override: - :ref:`bool` **has_color_override** **(** :ref:`String` name **)** const .. _class_Control_has_constant: - :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_has_constant_override: - :ref:`bool` **has_constant_override** **(** :ref:`String` name **)** const .. _class_Control_has_focus: - :ref:`bool` **has_focus** **(** **)** const Return whether the Control is the current focused control (see :ref:`set_focus_mode`). .. _class_Control_has_font: - :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_has_font_override: - :ref:`bool` **has_font_override** **(** :ref:`String` name **)** const .. _class_Control_has_icon: - :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_has_icon_override: - :ref:`bool` **has_icon_override** **(** :ref:`String` name **)** const .. _class_Control_has_point: - void **has_point** **(** :ref:`Vector2` point **)** virtual .. _class_Control_has_stylebox: - :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` type=null **)** const .. _class_Control_has_stylebox_override: - :ref:`bool` **has_stylebox_override** **(** :ref:`String` name **)** const .. _class_Control_is_clipping_contents: - :ref:`bool` **is_clipping_contents** **(** **)** .. _class_Control_minimum_size_changed: - void **minimum_size_changed** **(** **)** .. _class_Control_release_focus: - void **release_focus** **(** **)** Give up the focus, no other control will be able to receive keyboard input. .. _class_Control_set_anchor: - void **set_anchor** **(** :ref:`int` margin, :ref:`float` anchor, :ref:`bool` keep_margin=null, :ref:`bool` push_opposite_anchor=null **)** .. _class_Control_set_anchor_and_margin: - void **set_anchor_and_margin** **(** :ref:`int` margin, :ref:`float` anchor, :ref:`float` offset, :ref:`bool` push_opposite_anchor=null **)** .. _class_Control_set_anchors_preset: - void **set_anchors_preset** **(** :ref:`int` preset, :ref:`bool` keep_margin=null **)** .. _class_Control_set_area_as_parent_rect: - void **set_area_as_parent_rect** **(** :ref:`int` margin=0 **)** Change all margins and anchors, so this Control always takes up the same area as the parent Control. This is a helper (see :ref:`set_anchor`, :ref:`set_margin`). .. _class_Control_set_begin: - void **set_begin** **(** :ref:`Vector2` pos **)** Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see :ref:`set_margin`). .. _class_Control_set_clip_contents: - void **set_clip_contents** **(** :ref:`bool` enable **)** .. _class_Control_set_custom_minimum_size: - void **set_custom_minimum_size** **(** :ref:`Vector2` size **)** .. _class_Control_set_default_cursor_shape: - void **set_default_cursor_shape** **(** :ref:`int` shape **)** Set the default cursor shape for this control. See enum CURSOR\_\* for the list of shapes. .. _class_Control_set_drag_forwarding: - void **set_drag_forwarding** **(** :ref:`Control` target **)** .. _class_Control_set_drag_preview: - void **set_drag_preview** **(** :ref:`Control` control **)** .. _class_Control_set_end: - void **set_end** **(** :ref:`Vector2` pos **)** Sets MARGIN_RIGHT and MARGIN_BOTTOM at the same time. This is a helper (see :ref:`set_margin`). .. _class_Control_set_focus_mode: - void **set_focus_mode** **(** :ref:`int` mode **)** Set the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL). Only one Control can be focused at the same time, and it will receive keyboard signals. .. _class_Control_set_focus_neighbour: - void **set_focus_neighbour** **(** :ref:`int` margin, :ref:`NodePath` neighbour **)** Force a neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function. .. _class_Control_set_global_position: - void **set_global_position** **(** :ref:`Vector2` pos **)** Move the Control to a new position, relative to the top-left corner of the *window* Control, and without changing current anchor mode. (see :ref:`set_margin`). .. _class_Control_set_h_grow_direction: - void **set_h_grow_direction** **(** :ref:`int` direction **)** .. _class_Control_set_h_size_flags: - void **set_h_size_flags** **(** :ref:`int` flags **)** Hint for containers, set horizontal positioning flags. .. _class_Control_set_margin: - void **set_margin** **(** :ref:`int` margin, :ref:`float` offset **)** Set a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being set depends on the anchor mode. .. _class_Control_set_mouse_filter: - void **set_mouse_filter** **(** :ref:`int` filter **)** Set when the control is ignoring mouse events (even touchpad events send mouse events). (see the MOUSE_FILTER\_\* constants) .. _class_Control_set_pivot_offset: - void **set_pivot_offset** **(** :ref:`Vector2` pivot_offset **)** .. _class_Control_set_position: - void **set_position** **(** :ref:`Vector2` pos **)** Move the Control to a new position, relative to the top-left corner of the parent Control, changing all margins if needed and without changing current anchor mode. This is a helper (see :ref:`set_margin`). .. _class_Control_set_rotation: - void **set_rotation** **(** :ref:`float` radians **)** Set the rotation (in radians). .. _class_Control_set_rotation_deg: - void **set_rotation_deg** **(** :ref:`float` degrees **)** Set the rotation (in degrees). .. _class_Control_set_scale: - void **set_scale** **(** :ref:`Vector2` scale **)** .. _class_Control_set_size: - void **set_size** **(** :ref:`Vector2` size **)** Changes MARGIN_RIGHT and MARGIN_BOTTOM to fit a given size. This is a helper (see :ref:`set_margin`). .. _class_Control_set_stretch_ratio: - void **set_stretch_ratio** **(** :ref:`float` ratio **)** Hint for containers, set the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big. .. _class_Control_set_theme: - void **set_theme** **(** :ref:`Theme` theme **)** Override whole the :ref:`Theme` for this Control and all its children controls. .. _class_Control_set_tooltip: - void **set_tooltip** **(** :ref:`String` tooltip **)** Set a tooltip, which will appear when the cursor is resting over this control. .. _class_Control_set_v_grow_direction: - void **set_v_grow_direction** **(** :ref:`int` direction **)** .. _class_Control_set_v_size_flags: - void **set_v_size_flags** **(** :ref:`int` flags **)** Hint for containers, set vertical positioning flags. .. _class_Control_show_modal: - void **show_modal** **(** :ref:`bool` exclusive=false **)** Display 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. .. _class_Control_warp_mouse: - void **warp_mouse** **(** :ref:`Vector2` to_pos **)**