|
@@ -222,91 +222,190 @@ Member Functions
|
|
|
Signals
|
|
|
-------
|
|
|
|
|
|
+.. _class_Control_focus_entered:
|
|
|
+
|
|
|
- **focus_entered** **(** **)**
|
|
|
|
|
|
Emitted when the node gains keyboard focus.
|
|
|
|
|
|
+.. _class_Control_focus_exited:
|
|
|
+
|
|
|
- **focus_exited** **(** **)**
|
|
|
|
|
|
Emitted when the node loses keyboard focus.
|
|
|
|
|
|
+.. _class_Control_gui_input:
|
|
|
+
|
|
|
- **gui_input** **(** :ref:`Object<class_object>` ev **)**
|
|
|
|
|
|
Emitted when the node receives an :ref:`InputEvent<class_inputevent>`.
|
|
|
|
|
|
+.. _class_Control_minimum_size_changed:
|
|
|
+
|
|
|
- **minimum_size_changed** **(** **)**
|
|
|
|
|
|
Emitted when the node's minimum size changes.
|
|
|
|
|
|
+.. _class_Control_modal_closed:
|
|
|
+
|
|
|
- **modal_closed** **(** **)**
|
|
|
|
|
|
Emitted when a modal ``Control`` is closed. See :ref:`show_modal<class_Control_show_modal>`.
|
|
|
|
|
|
+.. _class_Control_mouse_entered:
|
|
|
+
|
|
|
- **mouse_entered** **(** **)**
|
|
|
|
|
|
Emitted when the mouse enters the control's ``Rect`` area.
|
|
|
|
|
|
+.. _class_Control_mouse_exited:
|
|
|
+
|
|
|
- **mouse_exited** **(** **)**
|
|
|
|
|
|
Emitted when the mouse leaves the control's ``Rect`` area.
|
|
|
|
|
|
+.. _class_Control_resized:
|
|
|
+
|
|
|
- **resized** **(** **)**
|
|
|
|
|
|
Emitted when the control changes size.
|
|
|
|
|
|
+.. _class_Control_size_flags_changed:
|
|
|
+
|
|
|
- **size_flags_changed** **(** **)**
|
|
|
|
|
|
-Emitted when one of the size flags changes. See member size_flags_horizontal and member size_flags_vertical.
|
|
|
+Emitted when one of the size flags changes. See :ref:`size_flags_horizontal<class_Control_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_size_flags_vertical>`.
|
|
|
|
|
|
|
|
|
Member Variables
|
|
|
----------------
|
|
|
|
|
|
+ .. _class_Control_anchor_bottom:
|
|
|
+
|
|
|
- :ref:`float<class_float>` **anchor_bottom** - Anchors the bottom edge of the node to the origin, the center, or the end of its parent container. It changes how the bottom margin updates when the node moves or changes size. Use one of the ``ANCHOR\_\*`` constants. Default value: ``ANCHOR_BEGIN``.
|
|
|
+
|
|
|
+ .. _class_Control_anchor_left:
|
|
|
+
|
|
|
- :ref:`float<class_float>` **anchor_left** - Anchors the left edge of the node to the origin, the center or the end of its parent container. It changes how the left margin updates when the node moves or changes size. Use one of the ``ANCHOR\_\*`` constants. Default value: ``ANCHOR_BEGIN``.
|
|
|
+
|
|
|
+ .. _class_Control_anchor_right:
|
|
|
+
|
|
|
- :ref:`float<class_float>` **anchor_right** - Anchors the right edge of the node to the origin, the center or the end of its parent container. It changes how the right margin updates when the node moves or changes size. Use one of the ``ANCHOR\_\*`` constants. Default value: ``ANCHOR_BEGIN``.
|
|
|
+
|
|
|
+ .. _class_Control_anchor_top:
|
|
|
+
|
|
|
- :ref:`float<class_float>` **anchor_top** - Anchors the top edge of the node to the origin, the center or the end of its parent container. It changes how the top margin updates when the node moves or changes size. Use one of the ``ANCHOR\_\*`` constants. Default value: ``ANCHOR_BEGIN``.
|
|
|
+
|
|
|
+ .. _class_Control_focus_neighbour_bottom:
|
|
|
+
|
|
|
- :ref:`NodePath<class_nodepath>` **focus_neighbour_bottom** - Tells Godot which node it should give keyboard focus to if the user presses Tab, the down arrow on the keyboard, or down on a gamepad. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one.
|
|
|
|
|
|
If the user presses Tab, Godot will give focus to the closest node to the right first, then to the bottom. If the user presses Shift+Tab, Godot will look to the left of the node, then above it.
|
|
|
+
|
|
|
+ .. _class_Control_focus_neighbour_left:
|
|
|
+
|
|
|
- :ref:`NodePath<class_nodepath>` **focus_neighbour_left** - Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the left arrow on the keyboard or left on a gamepad. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the left of this one.
|
|
|
+
|
|
|
+ .. _class_Control_focus_neighbour_right:
|
|
|
+
|
|
|
- :ref:`NodePath<class_nodepath>` **focus_neighbour_right** - Tells Godot which node it should give keyboard focus to if the user presses Tab, the right arrow on the keyboard or right on a gamepad. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one.
|
|
|
+
|
|
|
+ .. _class_Control_focus_neighbour_top:
|
|
|
+
|
|
|
- :ref:`NodePath<class_nodepath>` **focus_neighbour_top** - Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the top arrow on the keyboard or top on a gamepad. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one.
|
|
|
+
|
|
|
+ .. _class_Control_grow_horizontal:
|
|
|
+
|
|
|
- :ref:`int<class_int>` **grow_horizontal**
|
|
|
+
|
|
|
+ .. _class_Control_grow_vertical:
|
|
|
+
|
|
|
- :ref:`int<class_int>` **grow_vertical**
|
|
|
+
|
|
|
+ .. _class_Control_hint_tooltip:
|
|
|
+
|
|
|
- :ref:`String<class_string>` **hint_tooltip** - Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments.
|
|
|
-- :ref:`float<class_float>` **margin_bottom** - Distance between the node's bottom edge and its parent container, based on member anchor_bottom.
|
|
|
+
|
|
|
+ .. _class_Control_margin_bottom:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **margin_bottom** - Distance between the node's bottom edge and its parent container, based on :ref:`anchor_bottom<class_Control_anchor_bottom>`.
|
|
|
|
|
|
Margins are often controlled by one or multiple parent :ref:`Container<class_container>` nodes. Margins update automatically when you move or resize the node.
|
|
|
-- :ref:`float<class_float>` **margin_left** - Distance between the node's left edge and its parent container, based on member anchor_left.
|
|
|
-- :ref:`float<class_float>` **margin_right** - Distance between the node's right edge and its parent container, based on member anchor_right.
|
|
|
-- :ref:`float<class_float>` **margin_top** - Distance between the node's top edge and its parent container, based on member anchor_top.
|
|
|
+
|
|
|
+ .. _class_Control_margin_left:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **margin_left** - Distance between the node's left edge and its parent container, based on :ref:`anchor_left<class_Control_anchor_left>`.
|
|
|
+
|
|
|
+ .. _class_Control_margin_right:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **margin_right** - Distance between the node's right edge and its parent container, based on :ref:`anchor_right<class_Control_anchor_right>`.
|
|
|
+
|
|
|
+ .. _class_Control_margin_top:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **margin_top** - Distance between the node's top edge and its parent container, based on :ref:`anchor_top<class_Control_anchor_top>`.
|
|
|
+
|
|
|
+ .. _class_Control_mouse_filter:
|
|
|
+
|
|
|
- :ref:`int<class_int>` **mouse_filter**
|
|
|
+
|
|
|
+ .. _class_Control_rect_clip_content:
|
|
|
+
|
|
|
- :ref:`bool<class_bool>` **rect_clip_content**
|
|
|
+
|
|
|
+ .. _class_Control_rect_min_size:
|
|
|
+
|
|
|
- :ref:`Vector2<class_vector2>` **rect_min_size** - The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.
|
|
|
-- :ref:`Vector2<class_vector2>` **rect_pivot_offset** - By default, the node's pivot is its top-left corner. When you change its member rect_scale, it will scale around this pivot. Set this property to member rect_size / 2 to center the pivot in the node's rectangle.
|
|
|
-- :ref:`Vector2<class_vector2>` **rect_position** - The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by member rect_pivot_offset.
|
|
|
-- :ref:`float<class_float>` **rect_rotation** - The node's rotation around its pivot, in degrees. See member rect_pivot_offset to change the pivot's position.
|
|
|
-- :ref:`Vector2<class_vector2>` **rect_scale** - The node's scale, relative to its member rect_size. Change this property to scale the node around its member rect_pivot_offset.
|
|
|
+
|
|
|
+ .. _class_Control_rect_pivot_offset:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_vector2>` **rect_pivot_offset** - By default, the node's pivot is its top-left corner. When you change its :ref:`rect_scale<class_Control_rect_scale>`, it will scale around this pivot. Set this property to :ref:`rect_size<class_Control_rect_size>` / 2 to center the pivot in the node's rectangle.
|
|
|
+
|
|
|
+ .. _class_Control_rect_position:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_vector2>` **rect_position** - The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`rect_pivot_offset<class_Control_rect_pivot_offset>`.
|
|
|
+
|
|
|
+ .. _class_Control_rect_rotation:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **rect_rotation** - The node's rotation around its pivot, in degrees. See :ref:`rect_pivot_offset<class_Control_rect_pivot_offset>` to change the pivot's position.
|
|
|
+
|
|
|
+ .. _class_Control_rect_scale:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_vector2>` **rect_scale** - The node's scale, relative to its :ref:`rect_size<class_Control_rect_size>`. Change this property to scale the node around its :ref:`rect_pivot_offset<class_Control_rect_pivot_offset>`.
|
|
|
+
|
|
|
+ .. _class_Control_rect_size:
|
|
|
+
|
|
|
- :ref:`Vector2<class_vector2>` **rect_size** - The size of the node's bounding rectangle, in pixels. :ref:`Container<class_container>` nodes update this property automatically.
|
|
|
+
|
|
|
+ .. _class_Control_size_flags_horizontal:
|
|
|
+
|
|
|
- :ref:`int<class_int>` **size_flags_horizontal** - Tells the parent :ref:`Container<class_container>` nodes how they should resize and place the node on the X axis. Use one of the ``SIZE\_\*`` constants to change the flags. See the constants to learn what each does.
|
|
|
+
|
|
|
+ .. _class_Control_size_flags_stretch_ratio:
|
|
|
+
|
|
|
- :ref:`float<class_float>` **size_flags_stretch_ratio** - If the node and at least one of its neighbours uses the ``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 neighbour a ratio of 1, this node will take two thirds of the available space.
|
|
|
+
|
|
|
+ .. _class_Control_size_flags_vertical:
|
|
|
+
|
|
|
- :ref:`int<class_int>` **size_flags_vertical** - Tells the parent :ref:`Container<class_container>` nodes how they should resize and place the node on the Y axis. Use one of the ``SIZE\_\*`` constants to change the flags. See the constants to learn what each does.
|
|
|
+
|
|
|
+ .. _class_Control_theme:
|
|
|
+
|
|
|
- :ref:`Theme<class_theme>` **theme** - Changing this property replaces the current :ref:`Theme<class_theme>` resource this node and all its ``Control`` children use.
|
|
|
|
|
|
+
|
|
|
Numeric Constants
|
|
|
-----------------
|
|
|
|
|
|
-- **FOCUS_NONE** = **0** --- The node cannot grab focus. Use with member set_focus_mode.
|
|
|
-- **FOCUS_CLICK** = **1** --- The node can only grab focus on mouse clicks. Use with member set_focus_mode.
|
|
|
-- **FOCUS_ALL** = **2** --- The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with member set_focus_mode.
|
|
|
-- **NOTIFICATION_RESIZED** = **40** --- Sent when the node changes size. Use member rect_size to get the new size.
|
|
|
+- **FOCUS_NONE** = **0** --- The node cannot grab focus. Use with :ref:`set_focus_mode<class_Control_set_focus_mode>`.
|
|
|
+- **FOCUS_CLICK** = **1** --- The node can only grab focus on mouse clicks. Use with :ref:`set_focus_mode<class_Control_set_focus_mode>`.
|
|
|
+- **FOCUS_ALL** = **2** --- The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with :ref:`set_focus_mode<class_Control_set_focus_mode>`.
|
|
|
+- **NOTIFICATION_RESIZED** = **40** --- Sent when the node changes size. Use :ref:`rect_size<class_Control_rect_size>` to get the new size.
|
|
|
- **NOTIFICATION_MOUSE_ENTER** = **41** --- Sent when the mouse pointer enters the node's ``Rect`` area.
|
|
|
- **NOTIFICATION_MOUSE_EXIT** = **42** --- Sent when the mouse pointer exits the node's ``Rect`` area.
|
|
|
- **NOTIFICATION_FOCUS_ENTER** = **43** --- Sent when the node grabs focus.
|
|
|
- **NOTIFICATION_FOCUS_EXIT** = **44** --- Sent when the node loses focus.
|
|
|
-- **NOTIFICATION_THEME_CHANGED** = **45** --- Sent when the node's member theme changes, right before Godot redraws the ``Control``. Happens when you call one of the ``add\_\*_override``
|
|
|
-- **NOTIFICATION_MODAL_CLOSE** = **46** --- Sent when an open modal dialog closes. See member show_modal.
|
|
|
+- **NOTIFICATION_THEME_CHANGED** = **45** --- Sent when the node's :ref:`theme<class_Control_theme>` changes, right before Godot redraws the ``Control``. Happens when you call one of the ``add\_\*_override``
|
|
|
+- **NOTIFICATION_MODAL_CLOSE** = **46** --- Sent when an open modal dialog closes. See :ref:`show_modal<class_Control_show_modal>`.
|
|
|
- **CURSOR_ARROW** = **0** --- Show the system's arrow mouse cursor when the user hovers the node. Use with :ref:`set_default_cursor_shape<class_Control_set_default_cursor_shape>`.
|
|
|
- **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.
|
|
|
- **CURSOR_POINTING_HAND** = **2** --- Show the system's pointing hand mouse cursor when the user hovers the node.
|
|
@@ -344,18 +443,18 @@ Numeric Constants
|
|
|
- **PRESET_MODE_KEEP_HEIGHT** = **2**
|
|
|
- **PRESET_MODE_KEEP_WIDTH** = **1**
|
|
|
- **PRESET_MODE_KEEP_SIZE** = **3**
|
|
|
-- **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 member size_flags_stretch_ratio. Use with member size_flags_horizontal and member size_flags_vertical.
|
|
|
-- **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. Use with member size_flags_horizontal and member size_flags_vertical.
|
|
|
+- **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_size_flags_stretch_ratio>`. Use with :ref:`size_flags_horizontal<class_Control_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_size_flags_vertical>`.
|
|
|
+- **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. Use with :ref:`size_flags_horizontal<class_Control_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_size_flags_vertical>`.
|
|
|
- **SIZE_EXPAND_FILL** = **3** --- Sets the node's size flags to both fill and expand. See the 2 constants above for more information.
|
|
|
-- **SIZE_SHRINK_CENTER** = **4** --- Tells the parent :ref:`Container<class_container>` to center the node in itself. It centers the ``Control`` based on its bounding box, so it doesn't work with the fill or expand size flags. Use with member size_flags_horizontal and member size_flags_vertical.
|
|
|
-- **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 doesn't work with the fill or expand size flags. Use with member size_flags_horizontal and member size_flags_vertical.
|
|
|
+- **SIZE_SHRINK_CENTER** = **4** --- Tells the parent :ref:`Container<class_container>` to center the node in itself. It centers the ``Control`` based on its bounding box, so it doesn't work with the fill or expand size flags. Use with :ref:`size_flags_horizontal<class_Control_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_size_flags_vertical>`.
|
|
|
+- **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 doesn't work with the fill or expand size flags. Use with :ref:`size_flags_horizontal<class_Control_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_size_flags_vertical>`.
|
|
|
- **MOUSE_FILTER_STOP** = **0**
|
|
|
- **MOUSE_FILTER_PASS** = **1**
|
|
|
- **MOUSE_FILTER_IGNORE** = **2**
|
|
|
- **GROW_DIRECTION_BEGIN** = **0**
|
|
|
- **GROW_DIRECTION_END** = **1**
|
|
|
-- **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 member anchor_left. To change all 4 anchors at once, use :ref:`set_anchors_preset<class_Control_set_anchors_preset>`.
|
|
|
-- **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 member anchor_left. To change all 4 anchors at once, use :ref:`set_anchors_preset<class_Control_set_anchors_preset>`.
|
|
|
+- **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_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset<class_Control_set_anchors_preset>`.
|
|
|
+- **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_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset<class_Control_set_anchors_preset>`.
|
|
|
|
|
|
Description
|
|
|
-----------
|