Skip to content

Latest commit

Β 

History

History
4022 lines (2245 loc) Β· 253 KB

File metadata and controls

4022 lines (2245 loc) Β· 253 KB
github_url:hide

Control

Inherits: :ref:`CanvasItem<class_CanvasItem>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

Inherited By: :ref:`BaseButton<class_BaseButton>`, :ref:`ColorRect<class_ColorRect>`, :ref:`Container<class_Container>`, :ref:`GraphEdit<class_GraphEdit>`, :ref:`ItemList<class_ItemList>`, :ref:`Label<class_Label>`, :ref:`LineEdit<class_LineEdit>`, :ref:`MenuBar<class_MenuBar>`, :ref:`NinePatchRect<class_NinePatchRect>`, :ref:`Panel<class_Panel>`, :ref:`Range<class_Range>`, :ref:`ReferenceRect<class_ReferenceRect>`, :ref:`RichTextLabel<class_RichTextLabel>`, :ref:`Separator<class_Separator>`, :ref:`TabBar<class_TabBar>`, :ref:`TextEdit<class_TextEdit>`, :ref:`TextureRect<class_TextureRect>`, :ref:`Tree<class_Tree>`, :ref:`VideoStreamPlayer<class_VideoStreamPlayer>`, :ref:`VirtualJoystick<class_VirtualJoystick>`

Base class for all GUI controls. Adapts its position and size based on its parent control.

.. rst-class:: classref-introduction-group

Description

Base class for all UI-related nodes. Control features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change.

For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from Control and :ref:`Container<class_Container>` nodes.

Note: Since both :ref:`Node2D<class_Node2D>` and Control inherit from :ref:`CanvasItem<class_CanvasItem>`, they share several concepts from the class such as the :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` and :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` properties.

User Interface nodes and input

Godot propagates input events via viewports. Each :ref:`Viewport<class_Viewport>` is responsible for propagating :ref:`InputEvent<class_InputEvent>`s to their child nodes. As the :ref:`SceneTree.root<class_SceneTree_property_root>` is a :ref:`Window<class_Window>`, this already happens automatically for all UI elements in your game.

Input events are propagated through the :ref:`SceneTree<class_SceneTree>` from the root node to all child nodes by calling :ref:`Node._input()<class_Node_private_method__input>`. For UI elements specifically, it makes more sense to override the virtual method :ref:`_gui_input()<class_Control_private_method__gui_input>`, which filters out unrelated input events, such as by checking z-order, :ref:`mouse_filter<class_Control_property_mouse_filter>`, focus, or if the event was inside of the control's bounding box.

Call :ref:`accept_event()<class_Control_method_accept_event>` so no other node receives the event. Once you accept an input, it becomes handled so :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` will not process it.

Only one Control node can be in focus. Only the node in focus will receive events. To get the focus, call :ref:`grab_focus()<class_Control_method_grab_focus>`. Control nodes lose focus when another node grabs it, or if you hide the node in focus. Focus will not be represented visually if gained via mouse/touch input, only appearing with keyboard/gamepad input (for accessibility), or via :ref:`grab_focus()<class_Control_method_grab_focus>`.

Set :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_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.

:ref:`Theme<class_Theme>` resources change the control's appearance. The :ref:`theme<class_Control_property_theme>` of a Control node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the add_theme_*_override methods, like :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`. You can also override theme items in the Inspector.

Note: Theme items are not :ref:`Object<class_Object>` properties. This means you can't access their values using :ref:`Object.get()<class_Object_method_get>` and :ref:`Object.set()<class_Object_method_set>`. Instead, use the get_theme_* and add_theme_*_override methods provided by this class.

.. rst-class:: classref-introduction-group

Tutorials

.. rst-class:: classref-reftable-group

Properties

:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] :ref:`accessibility_controls_nodes<class_Control_property_accessibility_controls_nodes>` []
:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] :ref:`accessibility_described_by_nodes<class_Control_property_accessibility_described_by_nodes>` []
:ref:`String<class_String>` :ref:`accessibility_description<class_Control_property_accessibility_description>` ""
:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] :ref:`accessibility_flow_to_nodes<class_Control_property_accessibility_flow_to_nodes>` []
:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] :ref:`accessibility_labeled_by_nodes<class_Control_property_accessibility_labeled_by_nodes>` []
:ref:`AccessibilityLiveMode<enum_AccessibilityServer_AccessibilityLiveMode>` :ref:`accessibility_live<class_Control_property_accessibility_live>` 0
:ref:`String<class_String>` :ref:`accessibility_name<class_Control_property_accessibility_name>` ""
:ref:`float<class_float>` :ref:`anchor_bottom<class_Control_property_anchor_bottom>` 0.0
:ref:`float<class_float>` :ref:`anchor_left<class_Control_property_anchor_left>` 0.0
:ref:`float<class_float>` :ref:`anchor_right<class_Control_property_anchor_right>` 0.0
:ref:`float<class_float>` :ref:`anchor_top<class_Control_property_anchor_top>` 0.0
:ref:`bool<class_bool>` :ref:`auto_translate<class_Control_property_auto_translate>` Β 
:ref:`bool<class_bool>` :ref:`clip_contents<class_Control_property_clip_contents>` false
:ref:`Vector2<class_Vector2>` :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` Vector2(0, 0)
:ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` 0
:ref:`FocusMode<enum_Control_FocusMode>` :ref:`focus_mode<class_Control_property_focus_mode>` 0
:ref:`NodePath<class_NodePath>` :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>` NodePath("")
:ref:`NodePath<class_NodePath>` :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>` NodePath("")
:ref:`NodePath<class_NodePath>` :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` NodePath("")
:ref:`NodePath<class_NodePath>` :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>` NodePath("")
:ref:`NodePath<class_NodePath>` :ref:`focus_next<class_Control_property_focus_next>` NodePath("")
:ref:`NodePath<class_NodePath>` :ref:`focus_previous<class_Control_property_focus_previous>` NodePath("")
:ref:`Vector2<class_Vector2>` :ref:`global_position<class_Control_property_global_position>` Β 
:ref:`GrowDirection<enum_Control_GrowDirection>` :ref:`grow_horizontal<class_Control_property_grow_horizontal>` 1
:ref:`GrowDirection<enum_Control_GrowDirection>` :ref:`grow_vertical<class_Control_property_grow_vertical>` 1
:ref:`LayoutDirection<enum_Control_LayoutDirection>` :ref:`layout_direction<class_Control_property_layout_direction>` 0
:ref:`bool<class_bool>` :ref:`localize_numeral_system<class_Control_property_localize_numeral_system>` true
:ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` 0
:ref:`CursorShape<enum_Control_CursorShape>` :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>` 0
:ref:`MouseFilter<enum_Control_MouseFilter>` :ref:`mouse_filter<class_Control_property_mouse_filter>` 0
:ref:`bool<class_bool>` :ref:`mouse_force_pass_scroll_events<class_Control_property_mouse_force_pass_scroll_events>` true
:ref:`float<class_float>` :ref:`offset_bottom<class_Control_property_offset_bottom>` 0.0
:ref:`float<class_float>` :ref:`offset_left<class_Control_property_offset_left>` 0.0
:ref:`float<class_float>` :ref:`offset_right<class_Control_property_offset_right>` 0.0
:ref:`float<class_float>` :ref:`offset_top<class_Control_property_offset_top>` 0.0
:ref:`bool<class_bool>` :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` false
:ref:`Vector2<class_Vector2>` :ref:`offset_transform_pivot<class_Control_property_offset_transform_pivot>` Vector2(0, 0)
:ref:`Vector2<class_Vector2>` :ref:`offset_transform_pivot_ratio<class_Control_property_offset_transform_pivot_ratio>` Vector2(0.5, 0.5)
:ref:`Vector2<class_Vector2>` :ref:`offset_transform_position<class_Control_property_offset_transform_position>` Vector2(0, 0)
:ref:`Vector2<class_Vector2>` :ref:`offset_transform_position_ratio<class_Control_property_offset_transform_position_ratio>` Vector2(0, 0)
:ref:`float<class_float>` :ref:`offset_transform_rotation<class_Control_property_offset_transform_rotation>` 0.0
:ref:`Vector2<class_Vector2>` :ref:`offset_transform_scale<class_Control_property_offset_transform_scale>` Vector2(1, 1)
:ref:`bool<class_bool>` :ref:`offset_transform_visual_only<class_Control_property_offset_transform_visual_only>` true
:ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` physics_interpolation_mode 2 (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`)
:ref:`Vector2<class_Vector2>` :ref:`pivot_offset<class_Control_property_pivot_offset>` Vector2(0, 0)
:ref:`Vector2<class_Vector2>` :ref:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>` Vector2(0, 0)
:ref:`Vector2<class_Vector2>` :ref:`position<class_Control_property_position>` Vector2(0, 0)
:ref:`float<class_float>` :ref:`rotation<class_Control_property_rotation>` 0.0
:ref:`float<class_float>` :ref:`rotation_degrees<class_Control_property_rotation_degrees>` Β 
:ref:`Vector2<class_Vector2>` :ref:`scale<class_Control_property_scale>` Vector2(1, 1)
:ref:`Node<class_Node>` :ref:`shortcut_context<class_Control_property_shortcut_context>` Β 
:ref:`Vector2<class_Vector2>` :ref:`size<class_Control_property_size>` Vector2(0, 0)
|bitfield|[:ref:`SizeFlags<enum_Control_SizeFlags>`] :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` 1
:ref:`float<class_float>` :ref:`size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>` 1.0
|bitfield|[:ref:`SizeFlags<enum_Control_SizeFlags>`] :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>` 1
:ref:`Theme<class_Theme>` :ref:`theme<class_Control_property_theme>` Β 
:ref:`StringName<class_StringName>` :ref:`theme_type_variation<class_Control_property_theme_type_variation>` &""
:ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` :ref:`tooltip_auto_translate_mode<class_Control_property_tooltip_auto_translate_mode>` 0
:ref:`String<class_String>` :ref:`tooltip_text<class_Control_property_tooltip_text>` ""
.. rst-class:: classref-reftable-group

Methods

:ref:`String<class_String>` :ref:`_accessibility_get_contextual_info<class_Control_private_method__accessibility_get_contextual_info>`() |virtual| |const|
:ref:`bool<class_bool>` :ref:`_can_drop_data<class_Control_private_method__can_drop_data>`(at_position: :ref:`Vector2<class_Vector2>`, data: :ref:`Variant<class_Variant>`) |virtual| |const|
|void| :ref:`_drop_data<class_Control_private_method__drop_data>`(at_position: :ref:`Vector2<class_Vector2>`, data: :ref:`Variant<class_Variant>`) |virtual|
:ref:`String<class_String>` :ref:`_get_accessibility_container_name<class_Control_private_method__get_accessibility_container_name>`(node: :ref:`Node<class_Node>`) |virtual| |const|
:ref:`int<class_int>` :ref:`_get_cursor_shape<class_Control_private_method__get_cursor_shape>`(at_position: :ref:`Vector2<class_Vector2>`) |virtual| |const|
:ref:`Variant<class_Variant>` :ref:`_get_drag_data<class_Control_private_method__get_drag_data>`(at_position: :ref:`Vector2<class_Vector2>`) |virtual|
:ref:`Vector2<class_Vector2>` :ref:`_get_minimum_size<class_Control_private_method__get_minimum_size>`() |virtual| |const|
:ref:`String<class_String>` :ref:`_get_tooltip<class_Control_private_method__get_tooltip>`(at_position: :ref:`Vector2<class_Vector2>`) |virtual| |const|
|void| :ref:`_gui_input<class_Control_private_method__gui_input>`(event: :ref:`InputEvent<class_InputEvent>`) |virtual|
:ref:`bool<class_bool>` :ref:`_has_point<class_Control_private_method__has_point>`(point: :ref:`Vector2<class_Vector2>`) |virtual| |const|
:ref:`Object<class_Object>` :ref:`_make_custom_tooltip<class_Control_private_method__make_custom_tooltip>`(for_text: :ref:`String<class_String>`) |virtual| |const|
:ref:`Array<class_Array>`[:ref:`Vector3i<class_Vector3i>`] :ref:`_structured_text_parser<class_Control_private_method__structured_text_parser>`(args: :ref:`Array<class_Array>`, text: :ref:`String<class_String>`) |virtual| |const|
|void| :ref:`accept_event<class_Control_method_accept_event>`()
|void| :ref:`accessibility_drag<class_Control_method_accessibility_drag>`()
|void| :ref:`accessibility_drop<class_Control_method_accessibility_drop>`()
|void| :ref:`add_theme_color_override<class_Control_method_add_theme_color_override>`(name: :ref:`StringName<class_StringName>`, color: :ref:`Color<class_Color>`)
|void| :ref:`add_theme_constant_override<class_Control_method_add_theme_constant_override>`(name: :ref:`StringName<class_StringName>`, constant: :ref:`int<class_int>`)
|void| :ref:`add_theme_font_override<class_Control_method_add_theme_font_override>`(name: :ref:`StringName<class_StringName>`, font: :ref:`Font<class_Font>`)
|void| :ref:`add_theme_font_size_override<class_Control_method_add_theme_font_size_override>`(name: :ref:`StringName<class_StringName>`, font_size: :ref:`int<class_int>`)
|void| :ref:`add_theme_icon_override<class_Control_method_add_theme_icon_override>`(name: :ref:`StringName<class_StringName>`, texture: :ref:`Texture2D<class_Texture2D>`)
|void| :ref:`add_theme_stylebox_override<class_Control_method_add_theme_stylebox_override>`(name: :ref:`StringName<class_StringName>`, stylebox: :ref:`StyleBox<class_StyleBox>`)
|void| :ref:`begin_bulk_theme_override<class_Control_method_begin_bulk_theme_override>`()
|void| :ref:`end_bulk_theme_override<class_Control_method_end_bulk_theme_override>`()
:ref:`Control<class_Control>` :ref:`find_next_valid_focus<class_Control_method_find_next_valid_focus>`() |const|
:ref:`Control<class_Control>` :ref:`find_prev_valid_focus<class_Control_method_find_prev_valid_focus>`() |const|
:ref:`Control<class_Control>` :ref:`find_valid_focus_neighbor<class_Control_method_find_valid_focus_neighbor>`(side: :ref:`Side<enum_@GlobalScope_Side>`) |const|
|void| :ref:`force_drag<class_Control_method_force_drag>`(data: :ref:`Variant<class_Variant>`, preview: :ref:`Control<class_Control>`)
:ref:`float<class_float>` :ref:`get_anchor<class_Control_method_get_anchor>`(side: :ref:`Side<enum_@GlobalScope_Side>`) |const|
:ref:`Vector2<class_Vector2>` :ref:`get_begin<class_Control_method_get_begin>`() |const|
:ref:`Vector2<class_Vector2>` :ref:`get_combined_minimum_size<class_Control_method_get_combined_minimum_size>`() |const|
:ref:`Vector2<class_Vector2>` :ref:`get_combined_pivot_offset<class_Control_method_get_combined_pivot_offset>`() |const|
:ref:`CursorShape<enum_Control_CursorShape>` :ref:`get_cursor_shape<class_Control_method_get_cursor_shape>`(at_position: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)) |const|
:ref:`Vector2<class_Vector2>` :ref:`get_end<class_Control_method_get_end>`() |const|
:ref:`FocusMode<enum_Control_FocusMode>` :ref:`get_focus_mode_with_override<class_Control_method_get_focus_mode_with_override>`() |const|
:ref:`NodePath<class_NodePath>` :ref:`get_focus_neighbor<class_Control_method_get_focus_neighbor>`(side: :ref:`Side<enum_@GlobalScope_Side>`) |const|
:ref:`Rect2<class_Rect2>` :ref:`get_global_rect<class_Control_method_get_global_rect>`() |const|
:ref:`Vector2<class_Vector2>` :ref:`get_minimum_size<class_Control_method_get_minimum_size>`() |const|
:ref:`MouseFilter<enum_Control_MouseFilter>` :ref:`get_mouse_filter_with_override<class_Control_method_get_mouse_filter_with_override>`() |const|
:ref:`float<class_float>` :ref:`get_offset<class_Control_method_get_offset>`(offset: :ref:`Side<enum_@GlobalScope_Side>`) |const|
:ref:`Vector2<class_Vector2>` :ref:`get_parent_area_size<class_Control_method_get_parent_area_size>`() |const|
:ref:`Control<class_Control>` :ref:`get_parent_control<class_Control_method_get_parent_control>`() |const|
:ref:`Rect2<class_Rect2>` :ref:`get_rect<class_Control_method_get_rect>`() |const|
:ref:`Vector2<class_Vector2>` :ref:`get_screen_position<class_Control_method_get_screen_position>`() |const|
:ref:`Color<class_Color>` :ref:`get_theme_color<class_Control_method_get_theme_color>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`int<class_int>` :ref:`get_theme_constant<class_Control_method_get_theme_constant>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`float<class_float>` :ref:`get_theme_default_base_scale<class_Control_method_get_theme_default_base_scale>`() |const|
:ref:`Font<class_Font>` :ref:`get_theme_default_font<class_Control_method_get_theme_default_font>`() |const|
:ref:`int<class_int>` :ref:`get_theme_default_font_size<class_Control_method_get_theme_default_font_size>`() |const|
:ref:`Font<class_Font>` :ref:`get_theme_font<class_Control_method_get_theme_font>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`int<class_int>` :ref:`get_theme_font_size<class_Control_method_get_theme_font_size>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`Texture2D<class_Texture2D>` :ref:`get_theme_icon<class_Control_method_get_theme_icon>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`StyleBox<class_StyleBox>` :ref:`get_theme_stylebox<class_Control_method_get_theme_stylebox>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`String<class_String>` :ref:`get_tooltip<class_Control_method_get_tooltip>`(at_position: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)) |const|
|void| :ref:`grab_click_focus<class_Control_method_grab_click_focus>`()
|void| :ref:`grab_focus<class_Control_method_grab_focus>`(hide_focus: :ref:`bool<class_bool>` = false)
:ref:`bool<class_bool>` :ref:`has_focus<class_Control_method_has_focus>`(ignore_hidden_focus: :ref:`bool<class_bool>` = false) |const|
:ref:`bool<class_bool>` :ref:`has_theme_color<class_Control_method_has_theme_color>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_color_override<class_Control_method_has_theme_color_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`has_theme_constant<class_Control_method_has_theme_constant>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_constant_override<class_Control_method_has_theme_constant_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`has_theme_font<class_Control_method_has_theme_font>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_font_override<class_Control_method_has_theme_font_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`has_theme_font_size<class_Control_method_has_theme_font_size>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_font_size_override<class_Control_method_has_theme_font_size_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`has_theme_icon<class_Control_method_has_theme_icon>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_icon_override<class_Control_method_has_theme_icon_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`has_theme_stylebox<class_Control_method_has_theme_stylebox>`(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const|
:ref:`bool<class_bool>` :ref:`has_theme_stylebox_override<class_Control_method_has_theme_stylebox_override>`(name: :ref:`StringName<class_StringName>`) |const|
:ref:`bool<class_bool>` :ref:`is_drag_successful<class_Control_method_is_drag_successful>`() |const|
:ref:`bool<class_bool>` :ref:`is_layout_rtl<class_Control_method_is_layout_rtl>`() |const|
|void| :ref:`release_focus<class_Control_method_release_focus>`()
|void| :ref:`remove_theme_color_override<class_Control_method_remove_theme_color_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`remove_theme_constant_override<class_Control_method_remove_theme_constant_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`remove_theme_font_override<class_Control_method_remove_theme_font_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`remove_theme_font_size_override<class_Control_method_remove_theme_font_size_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`remove_theme_icon_override<class_Control_method_remove_theme_icon_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`remove_theme_stylebox_override<class_Control_method_remove_theme_stylebox_override>`(name: :ref:`StringName<class_StringName>`)
|void| :ref:`reset_size<class_Control_method_reset_size>`()
|void| :ref:`set_anchor<class_Control_method_set_anchor>`(side: :ref:`Side<enum_@GlobalScope_Side>`, anchor: :ref:`float<class_float>`, keep_offset: :ref:`bool<class_bool>` = false, push_opposite_anchor: :ref:`bool<class_bool>` = true)
|void| :ref:`set_anchor_and_offset<class_Control_method_set_anchor_and_offset>`(side: :ref:`Side<enum_@GlobalScope_Side>`, anchor: :ref:`float<class_float>`, offset: :ref:`float<class_float>`, push_opposite_anchor: :ref:`bool<class_bool>` = false)
|void| :ref:`set_anchors_and_offsets_preset<class_Control_method_set_anchors_and_offsets_preset>`(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin: :ref:`int<class_int>` = 0)
|void| :ref:`set_anchors_preset<class_Control_method_set_anchors_preset>`(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets: :ref:`bool<class_bool>` = false)
|void| :ref:`set_begin<class_Control_method_set_begin>`(position: :ref:`Vector2<class_Vector2>`)
|void| :ref:`set_drag_forwarding<class_Control_method_set_drag_forwarding>`(drag_func: :ref:`Callable<class_Callable>`, can_drop_func: :ref:`Callable<class_Callable>`, drop_func: :ref:`Callable<class_Callable>`)
|void| :ref:`set_drag_preview<class_Control_method_set_drag_preview>`(control: :ref:`Control<class_Control>`)
|void| :ref:`set_end<class_Control_method_set_end>`(position: :ref:`Vector2<class_Vector2>`)
|void| :ref:`set_focus_neighbor<class_Control_method_set_focus_neighbor>`(side: :ref:`Side<enum_@GlobalScope_Side>`, neighbor: :ref:`NodePath<class_NodePath>`)
|void| :ref:`set_global_position<class_Control_method_set_global_position>`(position: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false)
|void| :ref:`set_offset<class_Control_method_set_offset>`(side: :ref:`Side<enum_@GlobalScope_Side>`, offset: :ref:`float<class_float>`)
|void| :ref:`set_offsets_preset<class_Control_method_set_offsets_preset>`(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin: :ref:`int<class_int>` = 0)
|void| :ref:`set_position<class_Control_method_set_position>`(position: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false)
|void| :ref:`set_size<class_Control_method_set_size>`(size: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false)
|void| :ref:`update_minimum_size<class_Control_method_update_minimum_size>`()
|void| :ref:`warp_mouse<class_Control_method_warp_mouse>`(position: :ref:`Vector2<class_Vector2>`)
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Signals

.. rst-class:: classref-signal

focus_entered() :ref:`πŸ”—<class_Control_signal_focus_entered>`

Emitted when the node gains focus.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

focus_exited() :ref:`πŸ”—<class_Control_signal_focus_exited>`

Emitted when the node loses focus.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

gui_input(event: :ref:`InputEvent<class_InputEvent>`) :ref:`πŸ”—<class_Control_signal_gui_input>`

Emitted when the node receives an :ref:`InputEvent<class_InputEvent>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

minimum_size_changed() :ref:`πŸ”—<class_Control_signal_minimum_size_changed>`

Emitted when the node's minimum size changes.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

mouse_entered() :ref:`πŸ”—<class_Control_signal_mouse_entered>`

Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

mouse_exited() :ref:`πŸ”—<class_Control_signal_mouse_exited>`

Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.

Note: If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:

func _on_mouse_exited():
    if not Rect2(Vector2(), size).has_point(get_local_mouse_position()):
        # Not hovering over area.
.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

resized() :ref:`πŸ”—<class_Control_signal_resized>`

Emitted when the control changes size.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

size_flags_changed() :ref:`πŸ”—<class_Control_signal_size_flags_changed>`

Emitted when one of the size flags changes. See :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

theme_changed() :ref:`πŸ”—<class_Control_signal_theme_changed>`

Emitted when the :ref:`NOTIFICATION_THEME_CHANGED<class_Control_constant_NOTIFICATION_THEME_CHANGED>` notification is sent.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Enumerations

.. rst-class:: classref-enumeration

enum FocusMode: :ref:`πŸ”—<enum_Control_FocusMode>`

.. rst-class:: classref-enumeration-constant

:ref:`FocusMode<enum_Control_FocusMode>` FOCUS_NONE = 0

The node cannot grab focus. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.

.. rst-class:: classref-enumeration-constant

:ref:`FocusMode<enum_Control_FocusMode>` FOCUS_CLICK = 1

The node can only grab focus on mouse clicks. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.

.. rst-class:: classref-enumeration-constant

:ref:`FocusMode<enum_Control_FocusMode>` FOCUS_ALL = 2

The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.

.. rst-class:: classref-enumeration-constant

:ref:`FocusMode<enum_Control_FocusMode>` FOCUS_ACCESSIBILITY = 3

The node can grab focus only when screen reader is active. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum FocusBehaviorRecursive: :ref:`πŸ”—<enum_Control_FocusBehaviorRecursive>`

.. rst-class:: classref-enumeration-constant

:ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` FOCUS_BEHAVIOR_INHERITED = 0

Inherits the :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` from the parent control. If there is no parent control, this is the same as :ref:`FOCUS_BEHAVIOR_ENABLED<class_Control_constant_FOCUS_BEHAVIOR_ENABLED>`.

.. rst-class:: classref-enumeration-constant

:ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` FOCUS_BEHAVIOR_DISABLED = 1

Prevents the control from getting focused. :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` will return :ref:`FOCUS_NONE<class_Control_constant_FOCUS_NONE>`.

.. rst-class:: classref-enumeration-constant

:ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` FOCUS_BEHAVIOR_ENABLED = 2

Allows the control to be focused, depending on the :ref:`focus_mode<class_Control_property_focus_mode>`. This can be used to ignore the parent's :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>`. :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` will return the :ref:`focus_mode<class_Control_property_focus_mode>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum MouseBehaviorRecursive: :ref:`πŸ”—<enum_Control_MouseBehaviorRecursive>`

.. rst-class:: classref-enumeration-constant

:ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` MOUSE_BEHAVIOR_INHERITED = 0

Inherits the :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` from the parent control. If there is no parent control, this is the same as :ref:`MOUSE_BEHAVIOR_ENABLED<class_Control_constant_MOUSE_BEHAVIOR_ENABLED>`.

.. rst-class:: classref-enumeration-constant

:ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` MOUSE_BEHAVIOR_DISABLED = 1

Prevents the control from receiving mouse input. :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` will return :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`.

.. rst-class:: classref-enumeration-constant

:ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` MOUSE_BEHAVIOR_ENABLED = 2

Allows the control to receive mouse input, depending on the :ref:`mouse_filter<class_Control_property_mouse_filter>`. This can be used to ignore the parent's :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>`. :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` will return the :ref:`mouse_filter<class_Control_property_mouse_filter>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum CursorShape: :ref:`πŸ”—<enum_Control_CursorShape>`

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_ARROW = 0

Show the system's arrow mouse cursor when the user hovers the node. Use with :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>`.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_IBEAM = 1

Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_POINTING_HAND = 2

Show the system's pointing hand mouse cursor when the user hovers the node.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_CROSS = 3

Show the system's cross mouse cursor when the user hovers the node.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_WAIT = 4

Show the system's wait mouse cursor when the user hovers the node. Often an hourglass.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_BUSY = 5

Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_DRAG = 6

Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_CAN_DROP = 7

Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_FORBIDDEN = 8

Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_VSIZE = 9

Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_HSIZE = 10

Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_BDIAGSIZE = 11

Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_FDIAGSIZE = 12

Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of :ref:`CURSOR_BDIAGSIZE<class_Control_constant_CURSOR_BDIAGSIZE>`. It tells the user they can resize the window or the panel both horizontally and vertically.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_MOVE = 13

Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_VSPLIT = 14

Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_VSIZE<class_Control_constant_CURSOR_VSIZE>`.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_HSPLIT = 15

Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_HSIZE<class_Control_constant_CURSOR_HSIZE>`.

.. rst-class:: classref-enumeration-constant

:ref:`CursorShape<enum_Control_CursorShape>` CURSOR_HELP = 16

Show the system's help mouse cursor when the user hovers the node, a question mark.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum LayoutPreset: :ref:`πŸ”—<enum_Control_LayoutPreset>`

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_TOP_LEFT = 0

Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_TOP_RIGHT = 1

Snap all 4 anchors to the top-right of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_BOTTOM_LEFT = 2

Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_BOTTOM_RIGHT = 3

Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_CENTER_LEFT = 4

Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_CENTER_TOP = 5

Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_CENTER_RIGHT = 6

Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_CENTER_BOTTOM = 7

Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_CENTER = 8

Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_LEFT_WIDE = 9

Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_TOP_WIDE = 10

Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_RIGHT_WIDE = 11

Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_BOTTOM_WIDE = 12

Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_VCENTER_WIDE = 13

Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_HCENTER_WIDE = 14

Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPreset<enum_Control_LayoutPreset>` PRESET_FULL_RECT = 15

Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the Control will fit its parent control. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum LayoutPresetMode: :ref:`πŸ”—<enum_Control_LayoutPresetMode>`

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` PRESET_MODE_MINSIZE = 0

The control will be resized to its minimum size.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` PRESET_MODE_KEEP_WIDTH = 1

The control's width will not change.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` PRESET_MODE_KEEP_HEIGHT = 2

The control's height will not change.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` PRESET_MODE_KEEP_SIZE = 3

The control's size will not change.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

flags SizeFlags: :ref:`πŸ”—<enum_Control_SizeFlags>`

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_SHRINK_BEGIN = 0

Tells the parent :ref:`Container<class_Container>` to align the node with its start, either the top or the left edge. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

Note: Setting this flag is equal to not having any size flags.

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_FILL = 1

Tells the parent :ref:`Container<class_Container>` to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_EXPAND = 2

Tells the parent :ref:`Container<class_Container>` to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See :ref:`size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>`. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_EXPAND_FILL = 3

Sets the node's size flags to both fill and expand. See :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` for more information.

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_SHRINK_CENTER = 4

Tells the parent :ref:`Container<class_Container>` to center the node in the available space. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

.. rst-class:: classref-enumeration-constant

:ref:`SizeFlags<enum_Control_SizeFlags>` SIZE_SHRINK_END = 8

Tells the parent :ref:`Container<class_Container>` to align the node with its end, either the bottom or the right edge. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum MouseFilter: :ref:`πŸ”—<enum_Control_MouseFilter>`

.. rst-class:: classref-enumeration-constant

:ref:`MouseFilter<enum_Control_MouseFilter>` MOUSE_FILTER_STOP = 0

The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.

.. rst-class:: classref-enumeration-constant

:ref:`MouseFilter<enum_Control_MouseFilter>` MOUSE_FILTER_PASS = 1

The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals.

If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-:ref:`CanvasItem<class_CanvasItem>`, a control with :ref:`MOUSE_FILTER_STOP<class_Control_constant_MOUSE_FILTER_STOP>`, or a :ref:`CanvasItem<class_CanvasItem>` with :ref:`CanvasItem.top_level<class_CanvasItem_property_top_level>` enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to :ref:`Node._shortcut_input()<class_Node_private_method__shortcut_input>` for further processing.

.. rst-class:: classref-enumeration-constant

:ref:`MouseFilter<enum_Control_MouseFilter>` MOUSE_FILTER_IGNORE = 2

The control will not receive any mouse movement input events nor mouse button input events through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also not receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` nor :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. If a child has :ref:`MOUSE_FILTER_PASS<class_Control_constant_MOUSE_FILTER_PASS>` and an event was passed to this control, the event will further propagate up to the control's parent.

Note: If the control has received :ref:`mouse_entered<class_Control_signal_mouse_entered>` but not :ref:`mouse_exited<class_Control_signal_mouse_exited>`, changing the :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>` will cause :ref:`mouse_exited<class_Control_signal_mouse_exited>` to be emitted.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum GrowDirection: :ref:`πŸ”—<enum_Control_GrowDirection>`

.. rst-class:: classref-enumeration-constant

:ref:`GrowDirection<enum_Control_GrowDirection>` GROW_DIRECTION_BEGIN = 0

The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis.

.. rst-class:: classref-enumeration-constant

:ref:`GrowDirection<enum_Control_GrowDirection>` GROW_DIRECTION_END = 1

The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis.

.. rst-class:: classref-enumeration-constant

:ref:`GrowDirection<enum_Control_GrowDirection>` GROW_DIRECTION_BOTH = 2

The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum Anchor: :ref:`πŸ”—<enum_Control_Anchor>`

.. rst-class:: classref-enumeration-constant

:ref:`Anchor<enum_Control_Anchor>` ANCHOR_BEGIN = 0

Snaps one of the 4 anchor's sides to the origin of the node's Rect, in the top left. Use it with one of the anchor_* member variables, like :ref:`anchor_left<class_Control_property_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-enumeration-constant

:ref:`Anchor<enum_Control_Anchor>` ANCHOR_END = 1

Snaps one of the 4 anchor's sides to the end of the node's Rect, in the bottom right. Use it with one of the anchor_* member variables, like :ref:`anchor_left<class_Control_property_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum LayoutDirection: :ref:`πŸ”—<enum_Control_LayoutDirection>`

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_INHERITED = 0

Automatic layout direction, determined from the parent control layout direction.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_APPLICATION_LOCALE = 1

Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in :ref:`ProjectSettings.internationalization/locale/fallback<class_ProjectSettings_property_internationalization/locale/fallback>`). For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using :ref:`TextServerFallback<class_TextServerFallback>` (:ref:`ProjectSettings.internationalization/rendering/text_driver<class_ProjectSettings_property_internationalization/rendering/text_driver>`), left-to-right layout direction is always used regardless of the language. Right-to-left layout direction can also be forced using :ref:`ProjectSettings.internationalization/rendering/force_right_to_left_layout_direction<class_ProjectSettings_property_internationalization/rendering/force_right_to_left_layout_direction>`.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_LTR = 2

Left-to-right layout direction.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_RTL = 3

Right-to-left layout direction.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_SYSTEM_LOCALE = 4

Automatic layout direction, determined from the system locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language. For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using :ref:`TextServerFallback<class_TextServerFallback>` (:ref:`ProjectSettings.internationalization/rendering/text_driver<class_ProjectSettings_property_internationalization/rendering/text_driver>`), left-to-right layout direction is always used regardless of the language.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_MAX = 5

Represents the size of the :ref:`LayoutDirection<enum_Control_LayoutDirection>` enum.

.. rst-class:: classref-enumeration-constant

:ref:`LayoutDirection<enum_Control_LayoutDirection>` LAYOUT_DIRECTION_LOCALE = 1

Deprecated: Use :ref:`LAYOUT_DIRECTION_APPLICATION_LOCALE<class_Control_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE>` instead.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum TextDirection: :ref:`πŸ”—<enum_Control_TextDirection>`

.. rst-class:: classref-enumeration-constant

:ref:`TextDirection<enum_Control_TextDirection>` TEXT_DIRECTION_INHERITED = 3

Text writing direction is the same as layout direction.

.. rst-class:: classref-enumeration-constant

:ref:`TextDirection<enum_Control_TextDirection>` TEXT_DIRECTION_AUTO = 0

Automatic text writing direction, determined from the current locale and text content.

.. rst-class:: classref-enumeration-constant

:ref:`TextDirection<enum_Control_TextDirection>` TEXT_DIRECTION_LTR = 1

Left-to-right text writing direction.

.. rst-class:: classref-enumeration-constant

:ref:`TextDirection<enum_Control_TextDirection>` TEXT_DIRECTION_RTL = 2

Right-to-left text writing direction.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Constants

.. rst-class:: classref-constant

NOTIFICATION_RESIZED = 40 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_RESIZED>`

Sent when the node changes size. Use :ref:`size<class_Control_property_size>` to get the new size.

.. rst-class:: classref-constant

NOTIFICATION_MOUSE_ENTER = 41 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`

Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.

See also :ref:`NOTIFICATION_MOUSE_ENTER_SELF<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`.

.. rst-class:: classref-constant

NOTIFICATION_MOUSE_EXIT = 42 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`

Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.

See also :ref:`NOTIFICATION_MOUSE_EXIT_SELF<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`.

.. rst-class:: classref-constant

NOTIFICATION_MOUSE_ENTER_SELF = 60 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`

Experimental: The reason this notification is sent may change in the future.

Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.

See also :ref:`NOTIFICATION_MOUSE_ENTER<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`.

.. rst-class:: classref-constant

NOTIFICATION_MOUSE_EXIT_SELF = 61 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`

Experimental: The reason this notification is sent may change in the future.

Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.

Note: :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.

See also :ref:`NOTIFICATION_MOUSE_EXIT<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`.

.. rst-class:: classref-constant

NOTIFICATION_FOCUS_ENTER = 43 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_FOCUS_ENTER>`

Sent when the node grabs focus.

.. rst-class:: classref-constant

NOTIFICATION_FOCUS_EXIT = 44 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_FOCUS_EXIT>`

Sent when the node loses focus.

This notification is sent in reversed order.

.. rst-class:: classref-constant

NOTIFICATION_THEME_CHANGED = 45 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_THEME_CHANGED>`

Sent when the node needs to refresh its theme items. This happens in one of the following cases:

Note: As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.

Note: This notification is received alongside :ref:`Node.NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>`, so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using :ref:`Node.is_node_ready()<class_Node_method_is_node_ready>`.

func _notification(what):
    if what == NOTIFICATION_THEME_CHANGED:
        if not is_node_ready():
            await ready # Wait until ready signal.
        $Label.add_theme_color_override("font_color", Color.YELLOW)
.. rst-class:: classref-constant

NOTIFICATION_SCROLL_BEGIN = 47 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_SCROLL_BEGIN>`

Sent when this node is inside a :ref:`ScrollContainer<class_ScrollContainer>` which has begun being scrolled when dragging the scrollable area with a touch event. This notification is not sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.

Note: This signal is only emitted on Android or iOS, or on desktop/web platforms when :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is enabled.

.. rst-class:: classref-constant

NOTIFICATION_SCROLL_END = 48 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_SCROLL_END>`

Sent when this node is inside a :ref:`ScrollContainer<class_ScrollContainer>` which has stopped being scrolled when dragging the scrollable area with a touch event. This notification is not sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.

Note: This signal is only emitted on Android or iOS, or on desktop/web platforms when :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is enabled.

.. rst-class:: classref-constant

NOTIFICATION_LAYOUT_DIRECTION_CHANGED = 49 :ref:`πŸ”—<class_Control_constant_NOTIFICATION_LAYOUT_DIRECTION_CHANGED>`

Sent when the control layout direction is changed from LTR or RTL or vice versa. This notification is propagated to child Control nodes as result of a change to :ref:`layout_direction<class_Control_property_layout_direction>`.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Property Descriptions

.. rst-class:: classref-property

:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] accessibility_controls_nodes = [] :ref:`πŸ”—<class_Control_property_accessibility_controls_nodes>`

.. rst-class:: classref-property-setget

The paths to the nodes which are controlled by this node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] accessibility_described_by_nodes = [] :ref:`πŸ”—<class_Control_property_accessibility_described_by_nodes>`

.. rst-class:: classref-property-setget

The paths to the nodes which are describing this node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`String<class_String>` accessibility_description = "" :ref:`πŸ”—<class_Control_property_accessibility_description>`

.. rst-class:: classref-property-setget

The human-readable node description that is reported to assistive apps.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] accessibility_flow_to_nodes = [] :ref:`πŸ”—<class_Control_property_accessibility_flow_to_nodes>`

.. rst-class:: classref-property-setget

The paths to the nodes which this node flows into.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Array<class_Array>`[:ref:`NodePath<class_NodePath>`] accessibility_labeled_by_nodes = [] :ref:`πŸ”—<class_Control_property_accessibility_labeled_by_nodes>`

.. rst-class:: classref-property-setget

The paths to the nodes which label this node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`AccessibilityLiveMode<enum_AccessibilityServer_AccessibilityLiveMode>` accessibility_live = 0 :ref:`πŸ”—<class_Control_property_accessibility_live>`

.. rst-class:: classref-property-setget

The mode with which a live region updates. A live region is a :ref:`Node<class_Node>` that is updated as a result of an external event when the user's focus may be elsewhere.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`String<class_String>` accessibility_name = "" :ref:`πŸ”—<class_Control_property_accessibility_name>`

.. rst-class:: classref-property-setget

The human-readable node name that is reported to assistive apps.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` anchor_bottom = 0.0 :ref:`πŸ”—<class_Control_property_anchor_bottom>`

.. rst-class:: classref-property-setget

Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` anchor_left = 0.0 :ref:`πŸ”—<class_Control_property_anchor_left>`

.. rst-class:: classref-property-setget

Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` anchor_right = 0.0 :ref:`πŸ”—<class_Control_property_anchor_right>`

.. rst-class:: classref-property-setget

Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` anchor_top = 0.0 :ref:`πŸ”—<class_Control_property_anchor_top>`

.. rst-class:: classref-property-setget

Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` auto_translate :ref:`πŸ”—<class_Control_property_auto_translate>`

.. rst-class:: classref-property-setget

Deprecated: Use :ref:`Node.auto_translate_mode<class_Node_property_auto_translate_mode>` and :ref:`Node.can_auto_translate()<class_Node_method_can_auto_translate>` instead.

Toggles if any text should automatically change to its translated version depending on the current locale.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` clip_contents = false :ref:`πŸ”—<class_Control_property_clip_contents>`

.. rst-class:: classref-property-setget

Enables whether rendering of :ref:`CanvasItem<class_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 and won't receive input.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` custom_minimum_size = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_custom_minimum_size>`

.. rst-class:: classref-property-setget

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. Note that Control nodes have their internal minimum size returned by :ref:`get_minimum_size()<class_Control_method_get_minimum_size>`. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see :ref:`get_combined_minimum_size()<class_Control_method_get_combined_minimum_size>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` focus_behavior_recursive = 0 :ref:`πŸ”—<class_Control_property_focus_behavior_recursive>`

.. rst-class:: classref-property-setget

Determines which controls can be focused together with :ref:`focus_mode<class_Control_property_focus_mode>`. See :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>`. Since the default behavior is :ref:`FOCUS_BEHAVIOR_INHERITED<class_Control_constant_FOCUS_BEHAVIOR_INHERITED>`, this can be used to prevent all children controls from getting focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`FocusMode<enum_Control_FocusMode>` focus_mode = 0 :ref:`πŸ”—<class_Control_property_focus_mode>`

.. rst-class:: classref-property-setget

Determines which controls can be focused. Only one control can be focused at a time, and the focused control will receive keyboard, gamepad, and mouse events in :ref:`_gui_input()<class_Control_private_method__gui_input>`. Use :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` to determine if a control can grab focus, since :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` also affects it. See also :ref:`grab_focus()<class_Control_method_grab_focus>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_neighbor_bottom = NodePath("") :ref:`πŸ”—<class_Control_property_focus_neighbor_bottom>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give 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 :ref:`ProjectSettings.input/ui_down<class_ProjectSettings_property_input/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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_neighbor_left = NodePath("") :ref:`πŸ”—<class_Control_property_focus_neighbor_left>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give 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 :ref:`ProjectSettings.input/ui_left<class_ProjectSettings_property_input/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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_neighbor_right = NodePath("") :ref:`πŸ”—<class_Control_property_focus_neighbor_right>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give 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 :ref:`ProjectSettings.input/ui_right<class_ProjectSettings_property_input/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 right of this one.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_neighbor_top = NodePath("") :ref:`πŸ”—<class_Control_property_focus_neighbor_top>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give 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 :ref:`ProjectSettings.input/ui_up<class_ProjectSettings_property_input/ui_up>` input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the top of this one.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_next = NodePath("") :ref:`πŸ”—<class_Control_property_focus_next>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give focus to if the user presses Tab on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_next<class_ProjectSettings_property_input/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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`NodePath<class_NodePath>` focus_previous = NodePath("") :ref:`πŸ”—<class_Control_property_focus_previous>`

.. rst-class:: classref-property-setget

Tells Godot which node it should give focus to if the user presses Shift + Tab on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_prev<class_ProjectSettings_property_input/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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` global_position :ref:`πŸ”—<class_Control_property_global_position>`

.. rst-class:: classref-property-setget

The node's global position, relative to the world (usually to the :ref:`CanvasLayer<class_CanvasLayer>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`GrowDirection<enum_Control_GrowDirection>` grow_horizontal = 1 :ref:`πŸ”—<class_Control_property_grow_horizontal>`

.. rst-class:: classref-property-setget

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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`GrowDirection<enum_Control_GrowDirection>` grow_vertical = 1 :ref:`πŸ”—<class_Control_property_grow_vertical>`

.. rst-class:: classref-property-setget

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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`LayoutDirection<enum_Control_LayoutDirection>` layout_direction = 0 :ref:`πŸ”—<class_Control_property_layout_direction>`

.. rst-class:: classref-property-setget

Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also :ref:`is_layout_rtl()<class_Control_method_is_layout_rtl>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` localize_numeral_system = true :ref:`πŸ”—<class_Control_property_localize_numeral_system>`

.. rst-class:: classref-property-setget

If true, automatically converts code line numbers, list indices, :ref:`SpinBox<class_SpinBox>` and :ref:`ProgressBar<class_ProgressBar>` values from the Western Arabic (0..9) to the numeral systems used in current locale.

Note: Numbers within the text are not automatically converted, it can be done manually, using :ref:`TextServer.format_number()<class_TextServer_method_format_number>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` mouse_behavior_recursive = 0 :ref:`πŸ”—<class_Control_property_mouse_behavior_recursive>`

.. rst-class:: classref-property-setget

Determines which controls can receive mouse input together with :ref:`mouse_filter<class_Control_property_mouse_filter>`. See :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>`. Since the default behavior is :ref:`MOUSE_BEHAVIOR_INHERITED<class_Control_constant_MOUSE_BEHAVIOR_INHERITED>`, this can be used to prevent all children controls from receiving mouse input.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`CursorShape<enum_Control_CursorShape>` mouse_default_cursor_shape = 0 :ref:`πŸ”—<class_Control_property_mouse_default_cursor_shape>`

.. rst-class:: classref-property-setget

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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`MouseFilter<enum_Control_MouseFilter>` mouse_filter = 0 :ref:`πŸ”—<class_Control_property_mouse_filter>`

.. rst-class:: classref-property-setget

Determines which controls will be able to receive mouse button input events through :ref:`_gui_input()<class_Control_private_method__gui_input>` and the :ref:`mouse_entered<class_Control_signal_mouse_entered>`, and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. Also determines how these events should be propagated. See the constants to learn what each does. Use :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` to determine if a control can receive mouse input, since :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` also affects it.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` mouse_force_pass_scroll_events = true :ref:`πŸ”—<class_Control_property_mouse_force_pass_scroll_events>`

.. rst-class:: classref-property-setget

When enabled, scroll wheel events processed by :ref:`_gui_input()<class_Control_private_method__gui_input>` will be passed to the parent control even if :ref:`mouse_filter<class_Control_property_mouse_filter>` is set to :ref:`MOUSE_FILTER_STOP<class_Control_constant_MOUSE_FILTER_STOP>`.

You should disable it on the root of your UI if you do not want scroll events to go to the :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` processing.

Note: Because this property defaults to true, this allows nested scrollable containers to work out of the box.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` offset_bottom = 0.0 :ref:`πŸ”—<class_Control_property_offset_bottom>`

.. rst-class:: classref-property-setget

Distance between the node's bottom edge and its parent control, based on :ref:`anchor_bottom<class_Control_property_anchor_bottom>`.

Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` offset_left = 0.0 :ref:`πŸ”—<class_Control_property_offset_left>`

.. rst-class:: classref-property-setget

Distance between the node's left edge and its parent control, based on :ref:`anchor_left<class_Control_property_anchor_left>`.

Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` offset_right = 0.0 :ref:`πŸ”—<class_Control_property_offset_right>`

.. rst-class:: classref-property-setget

Distance between the node's right edge and its parent control, based on :ref:`anchor_right<class_Control_property_anchor_right>`.

Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` offset_top = 0.0 :ref:`πŸ”—<class_Control_property_offset_top>`

.. rst-class:: classref-property-setget

Distance between the node's top edge and its parent control, based on :ref:`anchor_top<class_Control_property_anchor_top>`.

Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` offset_transform_enabled = false :ref:`πŸ”—<class_Control_property_offset_transform_enabled>`

.. rst-class:: classref-property-setget

If true, applies all offset transform properties. Otherwise, no offset transform is applied and the properties have no effect.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` offset_transform_pivot = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_offset_transform_pivot>`

.. rst-class:: classref-property-setget

Pivot used by :ref:`offset_transform_rotation<class_Control_property_offset_transform_rotation>` and :ref:`offset_transform_scale<class_Control_property_offset_transform_scale>` in absolute units.

The final pivot position is the combined value of this property and :ref:`offset_transform_pivot_ratio<class_Control_property_offset_transform_pivot_ratio>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` offset_transform_pivot_ratio = Vector2(0.5, 0.5) :ref:`πŸ”—<class_Control_property_offset_transform_pivot_ratio>`

.. rst-class:: classref-property-setget

Same as :ref:`offset_transform_pivot<class_Control_property_offset_transform_pivot>` but expressed in units relative to the Control :ref:`size<class_Control_property_size>` where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner.

The final pivot position is the combined value of this property and :ref:`offset_transform_pivot<class_Control_property_offset_transform_pivot>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` offset_transform_position = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_offset_transform_position>`

.. rst-class:: classref-property-setget

Position offset in absolute units. The final offset is the combined value of this property and :ref:`offset_transform_position_ratio<class_Control_property_offset_transform_position_ratio>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` offset_transform_position_ratio = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_offset_transform_position_ratio>`

.. rst-class:: classref-property-setget

Same as :ref:`offset_transform_position<class_Control_property_offset_transform_position>` but expressed in units relative to the Control :ref:`size<class_Control_property_size>` where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner.

The final offset is the combined value of this property and :ref:`offset_transform_position<class_Control_property_offset_transform_position>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` offset_transform_rotation = 0.0 :ref:`πŸ”—<class_Control_property_offset_transform_rotation>`

.. rst-class:: classref-property-setget

Rotation offset. The rotation pivot is defined by :ref:`offset_transform_pivot<class_Control_property_offset_transform_pivot>` and :ref:`offset_transform_pivot_ratio<class_Control_property_offset_transform_pivot_ratio>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` offset_transform_scale = Vector2(1, 1) :ref:`πŸ”—<class_Control_property_offset_transform_scale>`

.. rst-class:: classref-property-setget

Scale offset. The scale pivot is defined by :ref:`offset_transform_pivot<class_Control_property_offset_transform_pivot>` and :ref:`offset_transform_pivot_ratio<class_Control_property_offset_transform_pivot_ratio>`.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` offset_transform_visual_only = true :ref:`πŸ”—<class_Control_property_offset_transform_visual_only>`

.. rst-class:: classref-property-setget

If true, the offset transforms is only applied visually and does not affect input. In other words, this Control will still receive input events at its original location before the offset transform is applied.

If false, the entire transform of this Control is affected and input events will register where the Control is visually.

Has no effect unless :ref:`offset_transform_enabled<class_Control_property_offset_transform_enabled>` is true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` pivot_offset = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_pivot_offset>`

.. rst-class:: classref-property-setget

By default, the node's pivot is its top-left corner. When you change its :ref:`rotation<class_Control_property_rotation>` or :ref:`scale<class_Control_property_scale>`, it will rotate or scale around this pivot.

The actual offset is the combined value of this property and :ref:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` pivot_offset_ratio = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_pivot_offset_ratio>`

.. rst-class:: classref-property-setget

Same as :ref:`pivot_offset<class_Control_property_pivot_offset>`, but expressed as uniform vector, where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner. Set this property to Vector2(0.5, 0.5) to pivot around this control's center.

The actual offset is the combined value of this property and :ref:`pivot_offset<class_Control_property_pivot_offset>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` position = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_position>`

.. rst-class:: classref-property-setget

The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`pivot_offset<class_Control_property_pivot_offset>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` rotation = 0.0 :ref:`πŸ”—<class_Control_property_rotation>`

.. rst-class:: classref-property-setget

The node's rotation around its pivot, in radians. See :ref:`pivot_offset<class_Control_property_pivot_offset>` to change the pivot's position.

Note: This property is edited in the inspector in degrees. If you want to use degrees in a script, use :ref:`rotation_degrees<class_Control_property_rotation_degrees>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` rotation_degrees :ref:`πŸ”—<class_Control_property_rotation_degrees>`

.. rst-class:: classref-property-setget

Helper property to access :ref:`rotation<class_Control_property_rotation>` in degrees instead of radians.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` scale = Vector2(1, 1) :ref:`πŸ”—<class_Control_property_scale>`

.. rst-class:: classref-property-setget

The node's scale, relative to its :ref:`size<class_Control_property_size>`. Change this property to scale the node around its :ref:`pivot_offset<class_Control_property_pivot_offset>`. The Control's tooltip will also scale according to this value.

Note: This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the :doc:`documentation <../tutorials/rendering/multiple_resolutions>` instead of scaling Controls individually.

Note: :ref:`FontFile.oversampling<class_FontFile_property_oversampling>` does not take Control :ref:`scale<class_Control_property_scale>` into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling :ref:`ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field<class_ProjectSettings_property_gui/theme/default_font_multichannel_signed_distance_field>` (applies to the default project font only), or enabling Multichannel Signed Distance Field in the import options of a DynamicFont for custom fonts. On system fonts, :ref:`SystemFont.multichannel_signed_distance_field<class_SystemFont_property_multichannel_signed_distance_field>` can be enabled in the inspector.

Note: If the Control node is a child of a :ref:`Container<class_Container>` node, the scale will be reset to Vector2(1, 1) when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using await get_tree().process_frame then set its :ref:`scale<class_Control_property_scale>` property.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Node<class_Node>` shortcut_context :ref:`πŸ”—<class_Control_property_shortcut_context>`

.. rst-class:: classref-property-setget

The :ref:`Node<class_Node>` which must be a parent of the focused Control for the shortcut to be activated. If null, the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector2<class_Vector2>` size = Vector2(0, 0) :ref:`πŸ”—<class_Control_property_size>`

.. rst-class:: classref-property-setget

The size of the node's bounding rectangle, in the node's coordinate system. :ref:`Container<class_Container>` nodes update this property automatically.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

|bitfield|[:ref:`SizeFlags<enum_Control_SizeFlags>`] size_flags_horizontal = 1 :ref:`πŸ”—<class_Control_property_size_flags_horizontal>`

.. rst-class:: classref-property-setget

Tells the parent :ref:`Container<class_Container>` nodes how they should resize and place the node on the X axis. Use a combination of the :ref:`SizeFlags<enum_Control_SizeFlags>` constants to change the flags. See the constants to learn what each does.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` size_flags_stretch_ratio = 1.0 :ref:`πŸ”—<class_Control_property_size_flags_stretch_ratio>`

.. rst-class:: classref-property-setget

If the node and at least one of its neighbors uses the :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` size flag, the parent :ref:`Container<class_Container>` will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

|bitfield|[:ref:`SizeFlags<enum_Control_SizeFlags>`] size_flags_vertical = 1 :ref:`πŸ”—<class_Control_property_size_flags_vertical>`

.. rst-class:: classref-property-setget

Tells the parent :ref:`Container<class_Container>` nodes how they should resize and place the node on the Y axis. Use a combination of the :ref:`SizeFlags<enum_Control_SizeFlags>` constants to change the flags. See the constants to learn what each does.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Theme<class_Theme>` theme :ref:`πŸ”—<class_Control_property_theme>`

.. rst-class:: classref-property-setget

The :ref:`Theme<class_Theme>` resource this node and all its Control and :ref:`Window<class_Window>` children use. If a child node has its own :ref:`Theme<class_Theme>` resource set, theme items are merged with child's definitions having higher priority.

Note: :ref:`Window<class_Window>` styles will have no effect unless the window is embedded.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`StringName<class_StringName>` theme_type_variation = &"" :ref:`πŸ”—<class_Control_property_theme_type_variation>`

.. rst-class:: classref-property-setget

The name of a theme type variation used by this Control to look up its own theme items. When empty, the class name of the node is used (e.g. Button for the :ref:`Button<class_Button>` control), as well as the class names of all parent classes (in order of inheritance).

When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See :ref:`Theme.set_type_variation()<class_Theme_method_set_type_variation>`. If the theme item cannot be found using this type or its base types, lookup falls back on the class names.

Note: To look up Control's own items use various get_theme_* methods without specifying theme_type.

Note: Theme items are looked for in the tree order, from branch to root, where each Control node is checked for its :ref:`theme<class_Control_property_theme>` property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` tooltip_auto_translate_mode = 0 :ref:`πŸ”—<class_Control_property_tooltip_auto_translate_mode>`

.. rst-class:: classref-property-setget

Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to :ref:`Node.AUTO_TRANSLATE_MODE_INHERIT<class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT>`.

Note: Tooltips customized using :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` do not use this auto translate mode automatically.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`String<class_String>` tooltip_text = "" :ref:`πŸ”—<class_Control_property_tooltip_text>`

.. rst-class:: classref-property-setget

The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter<class_Control_property_mouse_filter>` property is not :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`. The time required for the tooltip to appear can be changed with the :ref:`ProjectSettings.gui/timers/tooltip_delay_sec<class_ProjectSettings_property_gui/timers/tooltip_delay_sec>` setting.

This string is the default return value of :ref:`get_tooltip()<class_Control_method_get_tooltip>`. Override :ref:`_get_tooltip()<class_Control_private_method__get_tooltip>` to generate tooltip text dynamically. Override :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` to customize the tooltip interface and behavior.

The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>`. The default tooltip includes a :ref:`PopupPanel<class_PopupPanel>` and :ref:`Label<class_Label>` whose theme properties can be customized using :ref:`Theme<class_Theme>` methods with the "TooltipPanel" and "TooltipLabel" respectively. For example:

.. tabs::

 .. code-tab:: gdscript

    var style_box = StyleBoxFlat.new()
    style_box.set_bg_color(Color(1, 1, 0))
    style_box.set_border_width_all(2)
    # We assume here that the `theme` property has been assigned a custom Theme beforehand.
    theme.set_stylebox("panel", "TooltipPanel", style_box)
    theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1))

 .. code-tab:: csharp

    var styleBox = new StyleBoxFlat();
    styleBox.SetBgColor(new Color(1, 1, 0));
    styleBox.SetBorderWidthAll(2);
    // We assume here that the `Theme` property has been assigned a custom Theme beforehand.
    Theme.SetStyleBox("panel", "TooltipPanel", styleBox);
    Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));



.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Method Descriptions

.. rst-class:: classref-method

:ref:`String<class_String>` _accessibility_get_contextual_info() |virtual| |const| :ref:`πŸ”—<class_Control_private_method__accessibility_get_contextual_info>`

Return the description of the keyboard shortcuts and other contextual help for this control.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` _can_drop_data(at_position: :ref:`Vector2<class_Vector2>`, data: :ref:`Variant<class_Variant>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__can_drop_data>`

Godot calls this method to test if data from a control's :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` can be dropped at at_position. at_position is local to this control.

This method should only be used to test the data. Process the data in :ref:`_drop_data()<class_Control_private_method__drop_data>`.

Note: If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, at_position is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drop position.

.. tabs::

 .. code-tab:: gdscript

    func _can_drop_data(position, data):
        # Check position if it is relevant to you
        # Otherwise, just check data
        return typeof(data) == TYPE_DICTIONARY and data.has("expected")

 .. code-tab:: csharp

    public override bool _CanDropData(Vector2 atPosition, Variant data)
    {
        // Check position if it is relevant to you
        // Otherwise, just check data
        return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("expected");
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| _drop_data(at_position: :ref:`Vector2<class_Vector2>`, data: :ref:`Variant<class_Variant>`) |virtual| :ref:`πŸ”—<class_Control_private_method__drop_data>`

Godot calls this method to pass you the data from a control's :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` result. Godot first calls :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` to test if data is allowed to drop at at_position where at_position is local to this control.

Note: If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, at_position is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drop position.

.. tabs::

 .. code-tab:: gdscript

    func _can_drop_data(position, data):
        return typeof(data) == TYPE_DICTIONARY and data.has("color")

    func _drop_data(position, data):
        var color = data["color"]

 .. code-tab:: csharp

    public override bool _CanDropData(Vector2 atPosition, Variant data)
    {
        return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("color");
    }

    public override void _DropData(Vector2 atPosition, Variant data)
    {
        Color color = data.AsGodotDictionary()["color"].AsColor();
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`String<class_String>` _get_accessibility_container_name(node: :ref:`Node<class_Node>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__get_accessibility_container_name>`

Override this method to return a human-readable description of the position of the child node in the custom container, added to the :ref:`accessibility_name<class_Control_property_accessibility_name>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` _get_cursor_shape(at_position: :ref:`Vector2<class_Vector2>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__get_cursor_shape>`

Virtual method to be implemented by the user. Returns the cursor shape for the position at_position in the control's local coordinates, which will typically be used while hovering over this control. See :ref:`get_cursor_shape()<class_Control_method_get_cursor_shape>`.

If not overridden, defaults to :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Variant<class_Variant>` _get_drag_data(at_position: :ref:`Vector2<class_Vector2>`) |virtual| :ref:`πŸ”—<class_Control_private_method__get_drag_data>`

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 :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` and :ref:`_drop_data()<class_Control_private_method__drop_data>`. at_position is local to this control. Drag may be forced with :ref:`force_drag()<class_Control_method_force_drag>`.

A preview that will follow the mouse that should represent the data can be set with :ref:`set_drag_preview()<class_Control_method_set_drag_preview>`. A good time to set the preview is in this method.

Note: If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, at_position is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drag position.

.. tabs::

 .. code-tab:: gdscript

    func _get_drag_data(position):
        var mydata = make_data() # This is your custom method generating the drag data.
        set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
        return mydata

 .. code-tab:: csharp

    public override Variant _GetDragData(Vector2 atPosition)
    {
        var myData = MakeData(); // This is your custom method generating the drag data.
        SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data.
        return myData;
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` _get_minimum_size() |virtual| |const| :ref:`πŸ”—<class_Control_private_method__get_minimum_size>`

Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).

If not overridden, defaults to :ref:`Vector2.ZERO<class_Vector2_constant_ZERO>`.

Note: This method will not be called when the script is attached to a Control node that already overrides its minimum size (e.g. :ref:`Label<class_Label>`, :ref:`Button<class_Button>`, :ref:`PanelContainer<class_PanelContainer>` etc.). It can only be used with most basic GUI nodes, like Control, :ref:`Container<class_Container>`, :ref:`Panel<class_Panel>` etc.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`String<class_String>` _get_tooltip(at_position: :ref:`Vector2<class_Vector2>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__get_tooltip>`

Virtual method to be implemented by the user. Returns the tooltip text for the position at_position in the control's local coordinates, which will typically appear when the cursor is resting over this control. See :ref:`get_tooltip()<class_Control_method_get_tooltip>`.

Note: If this method returns an empty :ref:`String<class_String>` and :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` is not overridden, no tooltip is displayed.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| _gui_input(event: :ref:`InputEvent<class_InputEvent>`) |virtual| :ref:`πŸ”—<class_Control_private_method__gui_input>`

Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also :ref:`accept_event()<class_Control_method_accept_event>`.

Example: Click on the control to print a message:

.. tabs::

 .. code-tab:: gdscript

    func _gui_input(event):
        if event is InputEventMouseButton:
            if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
                print("I've been clicked D:")

 .. code-tab:: csharp

    public override void _GuiInput(InputEvent @event)
    {
        if (@event is InputEventMouseButton mb)
        {
            if (mb.ButtonIndex == MouseButton.Left && mb.Pressed)
            {
                GD.Print("I've been clicked D:");
            }
        }
    }



If the event inherits :ref:`InputEventMouse<class_InputEventMouse>`, this method will not be called when:

Note: The event's position is relative to this control's origin.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` _has_point(point: :ref:`Vector2<class_Vector2>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__has_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 the control's Rect.

Note: If you want to check if a point is inside the control, you can use Rect2(Vector2.ZERO, size).has_point(point).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Object<class_Object>` _make_custom_tooltip(for_text: :ref:`String<class_String>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__make_custom_tooltip>`

Virtual method to be implemented by the user. Returns a Control node that should be used as a tooltip instead of the default one. for_text is the return value of :ref:`get_tooltip()<class_Control_method_get_tooltip>`.

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 :ref:`PopupPanel<class_PopupPanel>`, so you should only provide the contents of that panel. That :ref:`PopupPanel<class_PopupPanel>` can be themed using :ref:`Theme.set_stylebox()<class_Theme_method_set_stylebox>` for the type "TooltipPanel" (see :ref:`tooltip_text<class_Control_property_tooltip_text>` 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 :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` to some non-zero value.

Note: The node (and any relevant children) should have their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` set to true when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.

Note: If overridden, this method is called even if :ref:`get_tooltip()<class_Control_method_get_tooltip>` returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return null in this method when for_text is empty.

Example: Use a constructed node as a tooltip:

.. tabs::

 .. code-tab:: gdscript

    func _make_custom_tooltip(for_text):
        var label = Label.new()
        label.text = for_text
        return label

 .. code-tab:: csharp

    public override Control _MakeCustomTooltip(string forText)
    {
        var label = new Label();
        label.Text = forText;
        return label;
    }



Example: Use a scene instance as a tooltip:

.. tabs::

 .. code-tab:: gdscript

    func _make_custom_tooltip(for_text):
        var tooltip = preload("res://some_tooltip_scene.tscn").instantiate()
        tooltip.get_node("Label").text = for_text
        return tooltip

 .. code-tab:: csharp

    public override Control _MakeCustomTooltip(string forText)
    {
        Node tooltip = ResourceLoader.Load<PackedScene>("res://some_tooltip_scene.tscn").Instantiate();
        tooltip.GetNode<Label>("Label").Text = forText;
        return tooltip;
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Array<class_Array>`[:ref:`Vector3i<class_Vector3i>`] _structured_text_parser(args: :ref:`Array<class_Array>`, text: :ref:`String<class_String>`) |virtual| |const| :ref:`πŸ”—<class_Control_private_method__structured_text_parser>`

User defined BiDi algorithm override function.

Returns an :ref:`Array<class_Array>` of :ref:`Vector3i<class_Vector3i>` text ranges and text base directions, in the left-to-right order. Ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| accept_event() :ref:`πŸ”—<class_Control_method_accept_event>`

Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` or :ref:`Node._unhandled_key_input()<class_Node_private_method__unhandled_key_input>`.

Note: This does not affect the methods in :ref:`Input<class_Input>`, only the way events are propagated.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| accessibility_drag() :ref:`πŸ”—<class_Control_method_accessibility_drag>`

Starts drag-and-drop operation without using a mouse.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| accessibility_drop() :ref:`πŸ”—<class_Control_method_accessibility_drop>`

Ends drag-and-drop operation without using a mouse.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_color_override(name: :ref:`StringName<class_StringName>`, color: :ref:`Color<class_Color>`) :ref:`πŸ”—<class_Control_method_add_theme_color_override>`

Creates a local override for a theme :ref:`Color<class_Color>` with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override()<class_Control_method_remove_theme_color_override>`.

See also :ref:`get_theme_color()<class_Control_method_get_theme_color>`.

Example: Override a :ref:`Label<class_Label>`'s color and reset it later:

.. tabs::

 .. code-tab:: gdscript

    # Given the child Label node "MyLabel", override its font color with a custom value.
    $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
    # Reset the font color of the child label.
    $MyLabel.remove_theme_color_override("font_color")
    # Alternatively it can be overridden with the default value from the Label type.
    $MyLabel.add_theme_color_override("font_color", get_theme_color("font_color", "Label"))

 .. code-tab:: csharp

    // Given the child Label node "MyLabel", override its font color with a custom value.
    GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
    // Reset the font color of the child label.
    GetNode<Label>("MyLabel").RemoveThemeColorOverride("font_color");
    // Alternatively it can be overridden with the default value from the Label type.
    GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", GetThemeColor("font_color", "Label"));



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_constant_override(name: :ref:`StringName<class_StringName>`, constant: :ref:`int<class_int>`) :ref:`πŸ”—<class_Control_method_add_theme_constant_override>`

Creates a local override for a theme constant with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override()<class_Control_method_remove_theme_constant_override>`.

See also :ref:`get_theme_constant()<class_Control_method_get_theme_constant>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_font_override(name: :ref:`StringName<class_StringName>`, font: :ref:`Font<class_Font>`) :ref:`πŸ”—<class_Control_method_add_theme_font_override>`

Creates a local override for a theme :ref:`Font<class_Font>` with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override()<class_Control_method_remove_theme_font_override>`.

See also :ref:`get_theme_font()<class_Control_method_get_theme_font>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_font_size_override(name: :ref:`StringName<class_StringName>`, font_size: :ref:`int<class_int>`) :ref:`πŸ”—<class_Control_method_add_theme_font_size_override>`

Creates a local override for a theme font size with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override()<class_Control_method_remove_theme_font_size_override>`.

See also :ref:`get_theme_font_size()<class_Control_method_get_theme_font_size>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_icon_override(name: :ref:`StringName<class_StringName>`, texture: :ref:`Texture2D<class_Texture2D>`) :ref:`πŸ”—<class_Control_method_add_theme_icon_override>`

Creates a local override for a theme icon with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override()<class_Control_method_remove_theme_icon_override>`.

See also :ref:`get_theme_icon()<class_Control_method_get_theme_icon>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| add_theme_stylebox_override(name: :ref:`StringName<class_StringName>`, stylebox: :ref:`StyleBox<class_StyleBox>`) :ref:`πŸ”—<class_Control_method_add_theme_stylebox_override>`

Creates a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override()<class_Control_method_remove_theme_stylebox_override>`.

See also :ref:`get_theme_stylebox()<class_Control_method_get_theme_stylebox>`.

Example: Modify a property in a :ref:`StyleBox<class_StyleBox>` by duplicating it:

.. tabs::

 .. code-tab:: gdscript

    # The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
    # Resources are shared across instances, so we need to duplicate it
    # to avoid modifying the appearance of all other buttons.
    var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate()
    new_stylebox_normal.border_width_top = 3
    new_stylebox_normal.border_color = Color(0, 1, 0.5)
    $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal)
    # Remove the stylebox override.
    $MyButton.remove_theme_stylebox_override("normal")

 .. code-tab:: csharp

    // The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
    // Resources are shared across instances, so we need to duplicate it
    // to avoid modifying the appearance of all other buttons.
    StyleBoxFlat newStyleboxNormal = GetNode<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
    newStyleboxNormal.BorderWidthTop = 3;
    newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
    GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
    // Remove the stylebox override.
    GetNode<Button>("MyButton").RemoveThemeStyleboxOverride("normal");



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| begin_bulk_theme_override() :ref:`πŸ”—<class_Control_method_begin_bulk_theme_override>`

Prevents *_theme_*_override methods from emitting :ref:`NOTIFICATION_THEME_CHANGED<class_Control_constant_NOTIFICATION_THEME_CHANGED>` until :ref:`end_bulk_theme_override()<class_Control_method_end_bulk_theme_override>` is called.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| end_bulk_theme_override() :ref:`πŸ”—<class_Control_method_end_bulk_theme_override>`

Ends a bulk theme override update. See :ref:`begin_bulk_theme_override()<class_Control_method_begin_bulk_theme_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Control<class_Control>` find_next_valid_focus() |const| :ref:`πŸ”—<class_Control_method_find_next_valid_focus>`

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

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Control<class_Control>` find_prev_valid_focus() |const| :ref:`πŸ”—<class_Control_method_find_prev_valid_focus>`

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

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Control<class_Control>` find_valid_focus_neighbor(side: :ref:`Side<enum_@GlobalScope_Side>`) |const| :ref:`πŸ”—<class_Control_method_find_valid_focus_neighbor>`

Finds the next Control that can receive the focus on the specified :ref:`Side<enum_@GlobalScope_Side>`.

Note: This is different from :ref:`get_focus_neighbor()<class_Control_method_get_focus_neighbor>`, which returns the path of a specified focus neighbor.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| force_drag(data: :ref:`Variant<class_Variant>`, preview: :ref:`Control<class_Control>`) :ref:`πŸ”—<class_Control_method_force_drag>`

Forces drag and bypasses :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` and :ref:`set_drag_preview()<class_Control_method_set_drag_preview>` by passing data and preview. Drag will start even if the mouse is neither over nor pressed on this control.

The methods :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` and :ref:`_drop_data()<class_Control_private_method__drop_data>` must be implemented on controls that want to receive drop data.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`float<class_float>` get_anchor(side: :ref:`Side<enum_@GlobalScope_Side>`) |const| :ref:`πŸ”—<class_Control_method_get_anchor>`

Returns the anchor for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`anchor_bottom<class_Control_property_anchor_bottom>`, :ref:`anchor_left<class_Control_property_anchor_left>`, :ref:`anchor_right<class_Control_property_anchor_right>` and :ref:`anchor_top<class_Control_property_anchor_top>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_begin() |const| :ref:`πŸ”—<class_Control_method_get_begin>`

Returns :ref:`offset_left<class_Control_property_offset_left>` and :ref:`offset_top<class_Control_property_offset_top>`. See also :ref:`position<class_Control_property_position>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_combined_minimum_size() |const| :ref:`πŸ”—<class_Control_method_get_combined_minimum_size>`

Returns combined minimum size from :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` and :ref:`get_minimum_size()<class_Control_method_get_minimum_size>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_combined_pivot_offset() |const| :ref:`πŸ”—<class_Control_method_get_combined_pivot_offset>`

Returns the combined value of :ref:`pivot_offset<class_Control_property_pivot_offset>` and :ref:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>`, in pixels. The ratio is multiplied by the control's size.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`CursorShape<enum_Control_CursorShape>` get_cursor_shape(at_position: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)) |const| :ref:`πŸ”—<class_Control_method_get_cursor_shape>`

Returns the mouse cursor shape for this control when hovered over at_position in local coordinates. For most controls, this is the same as :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>`, but some built-in controls implement more complex logic.

You can override :ref:`_get_cursor_shape()<class_Control_private_method__get_cursor_shape>` to implement custom behavior for this method.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_end() |const| :ref:`πŸ”—<class_Control_method_get_end>`

Returns :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`FocusMode<enum_Control_FocusMode>` get_focus_mode_with_override() |const| :ref:`πŸ”—<class_Control_method_get_focus_mode_with_override>`

Returns the :ref:`focus_mode<class_Control_property_focus_mode>`, but takes the :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` into account. If :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` is set to :ref:`FOCUS_BEHAVIOR_DISABLED<class_Control_constant_FOCUS_BEHAVIOR_DISABLED>`, or it is set to :ref:`FOCUS_BEHAVIOR_INHERITED<class_Control_constant_FOCUS_BEHAVIOR_INHERITED>` and its ancestor is set to :ref:`FOCUS_BEHAVIOR_DISABLED<class_Control_constant_FOCUS_BEHAVIOR_DISABLED>`, then this returns :ref:`FOCUS_NONE<class_Control_constant_FOCUS_NONE>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`NodePath<class_NodePath>` get_focus_neighbor(side: :ref:`Side<enum_@GlobalScope_Side>`) |const| :ref:`πŸ”—<class_Control_method_get_focus_neighbor>`

Returns the focus neighbor for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>`, :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>`, :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` and :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>`.

Note: To find the next Control on the specific :ref:`Side<enum_@GlobalScope_Side>`, even if a neighbor is not assigned, use :ref:`find_valid_focus_neighbor()<class_Control_method_find_valid_focus_neighbor>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Rect2<class_Rect2>` get_global_rect() |const| :ref:`πŸ”—<class_Control_method_get_global_rect>`

Returns the position and size of the control relative to the containing canvas. See :ref:`global_position<class_Control_property_global_position>` and :ref:`size<class_Control_property_size>`.

Note: If the node itself or any parent :ref:`CanvasItem<class_CanvasItem>` between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.

Note: Setting :ref:`Viewport.gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` to true can lead to rounding inaccuracies between the displayed control and the returned :ref:`Rect2<class_Rect2>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_minimum_size() |const| :ref:`πŸ”—<class_Control_method_get_minimum_size>`

Returns the minimum size for this control. See :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`MouseFilter<enum_Control_MouseFilter>` get_mouse_filter_with_override() |const| :ref:`πŸ”—<class_Control_method_get_mouse_filter_with_override>`

Returns the :ref:`mouse_filter<class_Control_property_mouse_filter>`, but takes the :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` into account. If :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` is set to :ref:`MOUSE_BEHAVIOR_DISABLED<class_Control_constant_MOUSE_BEHAVIOR_DISABLED>`, or it is set to :ref:`MOUSE_BEHAVIOR_INHERITED<class_Control_constant_MOUSE_BEHAVIOR_INHERITED>` and its ancestor is set to :ref:`MOUSE_BEHAVIOR_DISABLED<class_Control_constant_MOUSE_BEHAVIOR_DISABLED>`, then this returns :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`float<class_float>` get_offset(offset: :ref:`Side<enum_@GlobalScope_Side>`) |const| :ref:`πŸ”—<class_Control_method_get_offset>`

Returns the offset for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`offset_bottom<class_Control_property_offset_bottom>`, :ref:`offset_left<class_Control_property_offset_left>`, :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_top<class_Control_property_offset_top>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_parent_area_size() |const| :ref:`πŸ”—<class_Control_method_get_parent_area_size>`

Returns the width/height occupied in the parent control.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Control<class_Control>` get_parent_control() |const| :ref:`πŸ”—<class_Control_method_get_parent_control>`

Returns the parent control node.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Rect2<class_Rect2>` get_rect() |const| :ref:`πŸ”—<class_Control_method_get_rect>`

Returns the position and size of the control in the coordinate system of the containing node. See :ref:`position<class_Control_property_position>`, :ref:`scale<class_Control_property_scale>` and :ref:`size<class_Control_property_size>`.

Note: If :ref:`rotation<class_Control_property_rotation>` is not the default rotation, the resulting size is not meaningful.

Note: Setting :ref:`Viewport.gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` to true can lead to rounding inaccuracies between the displayed control and the returned :ref:`Rect2<class_Rect2>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_screen_position() |const| :ref:`πŸ”—<class_Control_method_get_screen_position>`

Returns the position of this Control in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.

Equivalent to get_screen_transform().origin (see :ref:`CanvasItem.get_screen_transform()<class_CanvasItem_method_get_screen_transform>`).

Example: Show a popup at the mouse position:

popup_menu.position = get_screen_position() + get_screen_transform().basis_xform(get_local_mouse_position())

# The above code is equivalent to:
popup_menu.position = get_screen_transform() * get_local_mouse_position()

popup_menu.reset_size()
popup_menu.popup()
.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Color<class_Color>` get_theme_color(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_color>`

Returns a :ref:`Color<class_Color>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a color item with the specified name and theme_type. If theme_type is omitted the class name of the current control is used as the type, or :ref:`theme_type_variation<class_Control_property_theme_type_variation>` if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked.

For the current control its local overrides are considered first (see :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>`), then its assigned :ref:`theme<class_Control_property_theme>`. After the current control, each parent control and its assigned :ref:`theme<class_Control_property_theme>` are considered; controls without a :ref:`theme<class_Control_property_theme>` assigned are skipped. If no matching :ref:`Theme<class_Theme>` is found in the tree, the custom project :ref:`Theme<class_Theme>` (see :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`) and the default :ref:`Theme<class_Theme>` are used (see :ref:`ThemeDB<class_ThemeDB>`).

.. tabs::

 .. code-tab:: gdscript

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

 .. code-tab:: csharp

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



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_theme_constant(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_constant>`

Returns a constant from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a constant item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`float<class_float>` get_theme_default_base_scale() |const| :ref:`πŸ”—<class_Control_method_get_theme_default_base_scale>`

Returns the default base scale value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_base_scale<class_Theme_property_default_base_scale>` value.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Font<class_Font>` get_theme_default_font() |const| :ref:`πŸ”—<class_Control_method_get_theme_default_font>`

Returns the default font from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font<class_Theme_property_default_font>` value.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_theme_default_font_size() |const| :ref:`πŸ”—<class_Control_method_get_theme_default_font_size>`

Returns the default font size value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font_size<class_Theme_property_default_font_size>` value.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Font<class_Font>` get_theme_font(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_font>`

Returns a :ref:`Font<class_Font>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_theme_font_size(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_font_size>`

Returns a font size from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font size item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Texture2D<class_Texture2D>` get_theme_icon(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_icon>`

Returns an icon from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has an icon item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`StyleBox<class_StyleBox>` get_theme_stylebox(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_get_theme_stylebox>`

Returns a :ref:`StyleBox<class_StyleBox>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a stylebox item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`String<class_String>` get_tooltip(at_position: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)) |const| :ref:`πŸ”—<class_Control_method_get_tooltip>`

Returns the tooltip text for the position at_position in the control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns :ref:`tooltip_text<class_Control_property_tooltip_text>`.

You can override :ref:`_get_tooltip()<class_Control_private_method__get_tooltip>` to implement custom behavior for this method.

Note: If this method returns an empty :ref:`String<class_String>` and :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` is not overridden, no tooltip is displayed.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| grab_click_focus() :ref:`πŸ”—<class_Control_method_grab_click_focus>`

Creates an :ref:`InputEventMouseButton<class_InputEventMouseButton>` that attempts to click the control. If the event is received, the control gains focus.

.. tabs::

 .. code-tab:: gdscript

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

 .. code-tab:: csharp

    public override void _Process(double delta)
    {
        GrabClickFocus(); // When clicking another Control node, this node will be clicked instead.
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| grab_focus(hide_focus: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_grab_focus>`

Steal the focus from another control and become the focused control (see :ref:`focus_mode<class_Control_property_focus_mode>`).

If hide_focus is true, the control will not visually show its focused state. Has no effect for :ref:`LineEdit<class_LineEdit>` and :ref:`TextEdit<class_TextEdit>` when :ref:`ProjectSettings.gui/common/show_focus_state_on_pointer_event<class_ProjectSettings_property_gui/common/show_focus_state_on_pointer_event>` is set to Control Supports Keyboard Input, or for any control when it is set to Always.

Note: Using this method together with :ref:`Callable.call_deferred()<class_Callable_method_call_deferred>` makes it more reliable, especially when called inside :ref:`Node._ready()<class_Node_private_method__ready>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_focus(ignore_hidden_focus: :ref:`bool<class_bool>` = false) |const| :ref:`πŸ”—<class_Control_method_has_focus>`

Returns true if this is the current focused control. See :ref:`focus_mode<class_Control_property_focus_mode>`.

If ignore_hidden_focus is true, controls that have their focus hidden will always return false. Hidden focus happens automatically when controls gain focus via mouse input, or manually using :ref:`grab_focus()<class_Control_method_grab_focus>` with hide_focus set to true.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_color(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_color>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has a color item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_color_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_color_override>`

Returns true if there is a local override for a theme :ref:`Color<class_Color>` with the specified name in this Control node.

See :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_constant(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_constant>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has a constant item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_constant_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_constant_override>`

Returns true if there is a local override for a theme constant with the specified name in this Control node.

See :ref:`add_theme_constant_override()<class_Control_method_add_theme_constant_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_font(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_font>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_font_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_font_override>`

Returns true if there is a local override for a theme :ref:`Font<class_Font>` with the specified name in this Control node.

See :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_font_size(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_font_size>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font size item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_font_size_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_font_size_override>`

Returns true if there is a local override for a theme font size with the specified name in this Control node.

See :ref:`add_theme_font_size_override()<class_Control_method_add_theme_font_size_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_icon(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_icon>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has an icon item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_icon_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_icon_override>`

Returns true if there is a local override for a theme icon with the specified name in this Control node.

See :ref:`add_theme_icon_override()<class_Control_method_add_theme_icon_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_stylebox(name: :ref:`StringName<class_StringName>`, theme_type: :ref:`StringName<class_StringName>` = &"") |const| :ref:`πŸ”—<class_Control_method_has_theme_stylebox>`

Returns true if there is a matching :ref:`Theme<class_Theme>` in the tree that has a stylebox item with the specified name and theme_type.

See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_theme_stylebox_override(name: :ref:`StringName<class_StringName>`) |const| :ref:`πŸ”—<class_Control_method_has_theme_stylebox_override>`

Returns true if there is a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified name in this Control node.

See :ref:`add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` is_drag_successful() |const| :ref:`πŸ”—<class_Control_method_is_drag_successful>`

Returns true if a drag operation is successful. Alternative to :ref:`Viewport.gui_is_drag_successful()<class_Viewport_method_gui_is_drag_successful>`.

Best used with :ref:`Node.NOTIFICATION_DRAG_END<class_Node_constant_NOTIFICATION_DRAG_END>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` is_layout_rtl() |const| :ref:`πŸ”—<class_Control_method_is_layout_rtl>`

Returns true if the layout is right-to-left. See also :ref:`layout_direction<class_Control_property_layout_direction>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| release_focus() :ref:`πŸ”—<class_Control_method_release_focus>`

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

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_color_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_color_override>`

Removes a local override for a theme :ref:`Color<class_Color>` with the specified name previously added by :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_constant_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_constant_override>`

Removes a local override for a theme constant with the specified name previously added by :ref:`add_theme_constant_override()<class_Control_method_add_theme_constant_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_font_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_font_override>`

Removes a local override for a theme :ref:`Font<class_Font>` with the specified name previously added by :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_font_size_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_font_size_override>`

Removes a local override for a theme font size with the specified name previously added by :ref:`add_theme_font_size_override()<class_Control_method_add_theme_font_size_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_icon_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_icon_override>`

Removes a local override for a theme icon with the specified name previously added by :ref:`add_theme_icon_override()<class_Control_method_add_theme_icon_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| remove_theme_stylebox_override(name: :ref:`StringName<class_StringName>`) :ref:`πŸ”—<class_Control_method_remove_theme_stylebox_override>`

Removes a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified name previously added by :ref:`add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>` or via the Inspector dock.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| reset_size() :ref:`πŸ”—<class_Control_method_reset_size>`

Resets the size to :ref:`get_combined_minimum_size()<class_Control_method_get_combined_minimum_size>`. This is equivalent to calling set_size(Vector2()) (or any size below the minimum).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_anchor(side: :ref:`Side<enum_@GlobalScope_Side>`, anchor: :ref:`float<class_float>`, keep_offset: :ref:`bool<class_bool>` = false, push_opposite_anchor: :ref:`bool<class_bool>` = true) :ref:`πŸ”—<class_Control_method_set_anchor>`

Sets the anchor for the specified :ref:`Side<enum_@GlobalScope_Side>` to anchor. A setter method for :ref:`anchor_bottom<class_Control_property_anchor_bottom>`, :ref:`anchor_left<class_Control_property_anchor_left>`, :ref:`anchor_right<class_Control_property_anchor_right>` and :ref:`anchor_top<class_Control_property_anchor_top>`.

If keep_offset is true, offsets 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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_anchor_and_offset(side: :ref:`Side<enum_@GlobalScope_Side>`, anchor: :ref:`float<class_float>`, offset: :ref:`float<class_float>`, push_opposite_anchor: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_set_anchor_and_offset>`

Works the same as :ref:`set_anchor()<class_Control_method_set_anchor>`, but instead of keep_offset argument and automatic update of offset, it allows to set the offset yourself (see :ref:`set_offset()<class_Control_method_set_offset>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_anchors_and_offsets_preset(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin: :ref:`int<class_int>` = 0) :ref:`πŸ”—<class_Control_method_set_anchors_and_offsets_preset>`

Sets both anchor preset and offset preset. See :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>` and :ref:`set_offsets_preset()<class_Control_method_set_offsets_preset>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_anchors_preset(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_set_anchors_preset>`

Sets the anchors to a preset from :ref:`LayoutPreset<enum_Control_LayoutPreset>` enum. This is the code equivalent to using the Layout menu in the 2D editor.

If keep_offsets is true, control's position will also be updated.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_begin(position: :ref:`Vector2<class_Vector2>`) :ref:`πŸ”—<class_Control_method_set_begin>`

Sets :ref:`offset_left<class_Control_property_offset_left>` and :ref:`offset_top<class_Control_property_offset_top>` at the same time. Equivalent of changing :ref:`position<class_Control_property_position>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_drag_forwarding(drag_func: :ref:`Callable<class_Callable>`, can_drop_func: :ref:`Callable<class_Callable>`, drop_func: :ref:`Callable<class_Callable>`) :ref:`πŸ”—<class_Control_method_set_drag_forwarding>`

Sets the given callables to be used instead of the control's own drag-and-drop virtual methods. If a callable is empty, its respective virtual method is used as normal.

The arguments for each callable should be exactly the same as their respective virtual methods, which would be:

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_drag_preview(control: :ref:`Control<class_Control>`) :ref:`πŸ”—<class_Control_method_set_drag_preview>`

Shows the given control at the mouse pointer. A good time to call this method is in :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>`. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended.

.. tabs::

 .. code-tab:: gdscript

    @export var color = Color(1, 0, 0, 1)

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

 .. code-tab:: csharp

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

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



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_end(position: :ref:`Vector2<class_Vector2>`) :ref:`πŸ”—<class_Control_method_set_end>`

Sets :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>` at the same time.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_focus_neighbor(side: :ref:`Side<enum_@GlobalScope_Side>`, neighbor: :ref:`NodePath<class_NodePath>`) :ref:`πŸ”—<class_Control_method_set_focus_neighbor>`

Sets the focus neighbor for the specified :ref:`Side<enum_@GlobalScope_Side>` to the Control at neighbor node path. A setter method for :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>`, :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>`, :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` and :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_global_position(position: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_set_global_position>`

Sets the :ref:`global_position<class_Control_property_global_position>` to given position.

If keep_offsets is true, control's anchors will be updated instead of offsets.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_offset(side: :ref:`Side<enum_@GlobalScope_Side>`, offset: :ref:`float<class_float>`) :ref:`πŸ”—<class_Control_method_set_offset>`

Sets the offset for the specified :ref:`Side<enum_@GlobalScope_Side>` to offset. A setter method for :ref:`offset_bottom<class_Control_property_offset_bottom>`, :ref:`offset_left<class_Control_property_offset_left>`, :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_top<class_Control_property_offset_top>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_offsets_preset(preset: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin: :ref:`int<class_int>` = 0) :ref:`πŸ”—<class_Control_method_set_offsets_preset>`

Sets the offsets to a preset from :ref:`LayoutPreset<enum_Control_LayoutPreset>` enum. This is the code equivalent to using the Layout menu in the 2D editor.

Use parameter resize_mode with constants from :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` to better determine the resulting size of the Control. Constant size will be ignored if used with presets that change size, e.g. :ref:`PRESET_LEFT_WIDE<class_Control_constant_PRESET_LEFT_WIDE>`.

Use parameter margin to determine the gap between the Control and the edges.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_position(position: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_set_position>`

Sets the :ref:`position<class_Control_property_position>` to given position.

If keep_offsets is true, control's anchors will be updated instead of offsets.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_size(size: :ref:`Vector2<class_Vector2>`, keep_offsets: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Control_method_set_size>`

Sets the size (see :ref:`size<class_Control_property_size>`).

If keep_offsets is true, control's anchors will be updated instead of offsets.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| update_minimum_size() :ref:`πŸ”—<class_Control_method_update_minimum_size>`

Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with :ref:`get_minimum_size()<class_Control_method_get_minimum_size>` when the return value is changed. Setting :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` directly calls this method automatically.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| warp_mouse(position: :ref:`Vector2<class_Vector2>`) :ref:`πŸ”—<class_Control_method_warp_mouse>`

Moves the mouse cursor to position, relative to :ref:`position<class_Control_property_position>` of this Control.

Note: :ref:`warp_mouse()<class_Control_method_warp_mouse>` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.