feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="Control" inherits="CanvasItem" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<class name="Control" inherits="CanvasItem" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<brief_description>
|
||||
Base class for all GUI controls. Adapts its position and size based on its parent control.
|
||||
</brief_description>
|
||||
|
|
@ -92,6 +92,14 @@
|
|||
Override this method to return a human-readable description of the position of the child [param node] in the custom container, added to the [member accessibility_name].
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_cursor_shape" qualifiers="virtual const">
|
||||
<return type="int" />
|
||||
<param index="0" name="at_position" type="Vector2" />
|
||||
<description>
|
||||
Virtual method to be implemented by the user. Returns the cursor shape for the position [param at_position] in the control's local coordinates, which will typically be used while hovering over this control. See [method get_cursor_shape].
|
||||
If not overridden, defaults to [member mouse_default_cursor_shape].
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_drag_data" qualifiers="virtual">
|
||||
<return type="Variant" />
|
||||
<param index="0" name="at_position" type="Vector2" />
|
||||
|
|
@ -117,6 +125,15 @@
|
|||
[/codeblocks]
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_maximum_size" qualifiers="virtual const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
Virtual method to be implemented by the user. Returns the maximum size for this control. Alternative to [member custom_maximum_size] for controlling maximum size via code. The actual maximum size will be the max value of these two (in each axis separately).
|
||||
If not overridden, defaults to [constant Vector2.ZERO].
|
||||
[b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its maximum size (e.g. [ScrollContainer]).
|
||||
[b]Note:[/b] It is recommended to use [method get_bound_minimum_size] instead of [method get_combined_minimum_size] when implementing this method, as the former respects maximum size limits when calculating the minimum size, while the latter does not.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_minimum_size" qualifiers="virtual const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
|
|
@ -129,10 +146,17 @@
|
|||
<return type="String" />
|
||||
<param index="0" name="at_position" type="Vector2" />
|
||||
<description>
|
||||
Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip].
|
||||
Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in the control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip].
|
||||
[b]Note:[/b] If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_tooltip_auto_translate_mode_at" qualifiers="virtual const">
|
||||
<return type="int" enum="Node.AutoTranslateMode" />
|
||||
<param index="0" name="at_position" type="Vector2" />
|
||||
<description>
|
||||
Return the auto-translation mode at the given [param at_position]. If not implemented, the [member tooltip_auto_translate_mode] property will be used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_gui_input" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<param index="0" name="event" type="InputEvent" />
|
||||
|
|
@ -173,7 +197,7 @@
|
|||
<param index="0" name="point" type="Vector2" />
|
||||
<description>
|
||||
Virtual method to be implemented by the user. Returns whether the given [param point] is inside this control.
|
||||
If not overridden, default behavior is checking if the point is within control's Rect.
|
||||
If not overridden, default behavior is checking if the point is within the control's Rect.
|
||||
[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]Rect2(Vector2.ZERO, size).has_point(point)[/code].
|
||||
</description>
|
||||
</method>
|
||||
|
|
@ -403,10 +427,24 @@
|
|||
Returns [member offset_left] and [member offset_top]. See also [member position].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_bound_minimum_size" qualifiers="const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
Returns the bound value of [method get_combined_minimum_size] by [method get_combined_maximum_size].
|
||||
This value is the true minimum size of the container, as the maximum size has priority over the minimum size.
|
||||
For example, if the combined minimum size is (100, 100) and the combined maximum size is (50, 150), the bound minimum size will be (50, 100).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_combined_maximum_size" qualifiers="const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
Returns the combined maximum size from [member custom_maximum_size] and [method get_maximum_size], as well as the [member custom_maximum_size] of this node's parent if it is a Control node with [member propagate_maximum_size] set to [code]true[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_combined_minimum_size" qualifiers="const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
Returns combined minimum size from [member custom_minimum_size] and [method get_minimum_size].
|
||||
Returns the combined minimum size from [member custom_minimum_size] and [method get_minimum_size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_combined_pivot_offset" qualifiers="const">
|
||||
|
|
@ -417,9 +455,10 @@
|
|||
</method>
|
||||
<method name="get_cursor_shape" qualifiers="const">
|
||||
<return type="int" enum="Control.CursorShape" />
|
||||
<param index="0" name="position" type="Vector2" default="Vector2(0, 0)" />
|
||||
<param index="0" name="at_position" type="Vector2" default="Vector2(0, 0)" />
|
||||
<description>
|
||||
Returns the mouse cursor shape for this control when hovered over [param position] in local coordinates. For most controls, this is the same as [member mouse_default_cursor_shape], but some built-in controls implement more complex logic.
|
||||
Returns the mouse cursor shape for this control when hovered over [param at_position] in local coordinates. For most controls, this is the same as [member mouse_default_cursor_shape], but some built-in controls implement more complex logic.
|
||||
You can override [method _get_cursor_shape] to implement custom behavior for this method.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_end" qualifiers="const">
|
||||
|
|
@ -450,6 +489,12 @@
|
|||
[b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_maximum_size" qualifiers="const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
Returns the maximum size for this control. See [member custom_maximum_size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_minimum_size" qualifiers="const">
|
||||
<return type="Vector2" />
|
||||
<description>
|
||||
|
|
@ -603,8 +648,8 @@
|
|||
<return type="String" />
|
||||
<param index="0" name="at_position" type="Vector2" default="Vector2(0, 0)" />
|
||||
<description>
|
||||
Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text].
|
||||
This method can be overridden to customize its behavior. See [method _get_tooltip].
|
||||
Returns the tooltip text for the position [param at_position] in the control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text].
|
||||
You can override [method _get_tooltip] to implement custom behavior for this method.
|
||||
[b]Note:[/b] If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed.
|
||||
</description>
|
||||
</method>
|
||||
|
|
@ -631,7 +676,7 @@
|
|||
<param index="0" name="hide_focus" type="bool" default="false" />
|
||||
<description>
|
||||
Steal the focus from another control and become the focused control (see [member focus_mode]).
|
||||
If [param hide_focus] is [code]true[/code], the control will not visually show its focused state. Has no effect for [LineEdit] and [TextEdit] when [member ProjectSettings.gui/common/show_focus_state_on_pointer_event] is set to [code]Control Supports Keyboard Input[/code], or for any control when it is set to [code]Always[/code].
|
||||
If [param hide_focus] is [code]true[/code], the control will not visually show its focused state. Has no effect for [LineEdit] and [TextEdit] when [member ProjectSettings.gui/common/show_focus_state_on_pointer_event] is set to [code]Text Input Controls[/code], or for any control when it is set to [code]Always[/code].
|
||||
[b]Note:[/b] Using this method together with [method Callable.call_deferred] makes it more reliable, especially when called inside [method Node._ready].
|
||||
</description>
|
||||
</method>
|
||||
|
|
@ -967,10 +1012,17 @@
|
|||
If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets.
|
||||
</description>
|
||||
</method>
|
||||
<method name="update_maximum_size">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Invalidates the maximum size cache in this node and in parent nodes up to top level. Intended to be used with [method get_maximum_size] when the return value is changed. Setting [member custom_maximum_size] directly calls this method automatically.
|
||||
[b]Note:[/b] Calling this method also calls [method update_minimum_size] since the combined minimum size may be affected by the maximum size change.
|
||||
</description>
|
||||
</method>
|
||||
<method name="update_minimum_size">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically.
|
||||
Invalidates the minimum size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically.
|
||||
</description>
|
||||
</method>
|
||||
<method name="warp_mouse">
|
||||
|
|
@ -998,7 +1050,7 @@
|
|||
<member name="accessibility_labeled_by_nodes" type="NodePath[]" setter="set_accessibility_labeled_by_nodes" getter="get_accessibility_labeled_by_nodes" default="[]">
|
||||
The paths to the nodes which label this node.
|
||||
</member>
|
||||
<member name="accessibility_live" type="int" setter="set_accessibility_live" getter="get_accessibility_live" enum="DisplayServer.AccessibilityLiveMode" default="0">
|
||||
<member name="accessibility_live" type="int" setter="set_accessibility_live" getter="get_accessibility_live" enum="AccessibilityServer.AccessibilityLiveMode" default="0">
|
||||
The mode with which a live region updates. A live region is a [Node] that is updated as a result of an external event when the user's focus may be elsewhere.
|
||||
</member>
|
||||
<member name="accessibility_name" type="String" setter="set_accessibility_name" getter="get_accessibility_name" default="""">
|
||||
|
|
@ -1022,8 +1074,16 @@
|
|||
<member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false">
|
||||
Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input.
|
||||
</member>
|
||||
<member name="custom_maximum_size" type="Vector2" setter="set_custom_maximum_size" getter="get_custom_maximum_size" default="Vector2(-1, -1)">
|
||||
The maximum size of this Control's bounding rectangle. If set to a value greater than or equal to [code](0, 0)[/code], the node's bounding rectangle will never exceed this size. A value below [code](0, 0)[/code] means there is no maximum size.
|
||||
[b]Note:[/b] The final effective maximum size may be subject to parent Container sizing and propagated maximum sizes. See also: [method get_combined_maximum_size].
|
||||
[b]Note:[/b] Not all [Control] subtypes handle a custom maximum size gracefully, which may lead to unexpected behavior if the control's contents exceed this size.
|
||||
[b]Note:[/b] This value has priority over [member custom_minimum_size]. For example, if you set [member custom_maximum_size] to [code](100, 100)[/code] and [member custom_minimum_size] to [code](200, 200)[/code], the resulting size will be [code](100, 100)[/code].
|
||||
[b]Note:[/b] It is recommended to use [method get_bound_minimum_size] instead of [method get_combined_minimum_size] when using this property, as the former respects maximum size limits when calculating the minimum size, while the latter does not.
|
||||
</member>
|
||||
<member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)">
|
||||
The minimum size of the node's bounding rectangle. If you set it to a value greater than [code](0, 0)[/code], the node's bounding rectangle will always have at least this size. Note that [Control] nodes have their internal minimum size returned by [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 [method get_combined_minimum_size]).
|
||||
[b]Note:[/b] [member custom_maximum_size] has priority over this property. For example, if you set [member custom_minimum_size] to [code](200, 200)[/code] and [member custom_maximum_size] to [code](100, 100)[/code], the resulting size will be [code](100, 100)[/code].
|
||||
</member>
|
||||
<member name="focus_behavior_recursive" type="int" setter="set_focus_behavior_recursive" getter="get_focus_behavior_recursive" enum="Control.FocusBehaviorRecursive" default="0">
|
||||
Determines which controls can be focused together with [member focus_mode]. See [method get_focus_mode_with_override]. Since the default behavior is [constant FOCUS_BEHAVIOR_INHERITED], this can be used to prevent all children controls from getting focused.
|
||||
|
|
@ -1055,10 +1115,10 @@
|
|||
The node's global position, relative to the world (usually to the [CanvasLayer]).
|
||||
</member>
|
||||
<member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1">
|
||||
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.
|
||||
Controls the direction on the horizontal axis in which the control should grow or shrink if its horizontal size is changed.
|
||||
</member>
|
||||
<member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" enum="Control.GrowDirection" default="1">
|
||||
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.
|
||||
Controls the direction on the vertical axis in which the control should grow or shrink if its vertical size is changed.
|
||||
</member>
|
||||
<member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0">
|
||||
Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also [method is_layout_rtl].
|
||||
|
|
@ -1098,6 +1158,41 @@
|
|||
Distance between the node's top edge and its parent control, based on [member anchor_top].
|
||||
Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node.
|
||||
</member>
|
||||
<member name="offset_transform_enabled" type="bool" setter="set_offset_transform_enabled" getter="is_offset_transform_enabled" default="false">
|
||||
If [code]true[/code], applies all offset transform properties. Otherwise, no offset transform is applied and the properties have no effect.
|
||||
</member>
|
||||
<member name="offset_transform_pivot" type="Vector2" setter="set_offset_transform_pivot" getter="get_offset_transform_pivot" default="Vector2(0, 0)">
|
||||
Pivot used by [member offset_transform_rotation] and [member offset_transform_scale] in absolute units.
|
||||
The final pivot position is the combined value of this property and [member offset_transform_pivot_ratio].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_pivot_ratio" type="Vector2" setter="set_offset_transform_pivot_ratio" getter="get_offset_transform_pivot_ratio" default="Vector2(0.5, 0.5)">
|
||||
Same as [member offset_transform_pivot] but expressed in units relative to the [Control] [member size] where [code]Vector2(0, 0)[/code] is the top-left corner of this control, and [code]Vector2(1, 1)[/code] is its bottom-right corner.
|
||||
The final pivot position is the combined value of this property and [member offset_transform_pivot].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_position" type="Vector2" setter="set_offset_transform_position" getter="get_offset_transform_position" default="Vector2(0, 0)">
|
||||
Position offset in absolute units. The final offset is the combined value of this property and [member offset_transform_position_ratio].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_position_ratio" type="Vector2" setter="set_offset_transform_position_ratio" getter="get_offset_transform_position_ratio" default="Vector2(0, 0)">
|
||||
Same as [member offset_transform_position] but expressed in units relative to the [Control] [member size] where [code]Vector2(0, 0)[/code] is the top-left corner of this control, and [code]Vector2(1, 1)[/code] is its bottom-right corner.
|
||||
The final offset is the combined value of this property and [member offset_transform_position].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_rotation" type="float" setter="set_offset_transform_rotation" getter="get_offset_transform_rotation" default="0.0">
|
||||
Rotation offset. The rotation pivot is defined by [member offset_transform_pivot] and [member offset_transform_pivot_ratio].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_scale" type="Vector2" setter="set_offset_transform_scale" getter="get_offset_transform_scale" default="Vector2(1, 1)">
|
||||
Scale offset. The scale pivot is defined by [member offset_transform_pivot] and [member offset_transform_pivot_ratio].
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="offset_transform_visual_only" type="bool" setter="set_offset_transform_visual_only" getter="is_offset_transform_visual_only" default="true">
|
||||
If [code]true[/code], 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 [code]false[/code], the entire transform of this Control is affected and input events will register where the Control is visually.
|
||||
Has no effect unless [member offset_transform_enabled] is [code]true[/code].
|
||||
</member>
|
||||
<member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" />
|
||||
<member name="pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)">
|
||||
By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot.
|
||||
|
|
@ -1110,6 +1205,9 @@
|
|||
<member name="position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)">
|
||||
The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset].
|
||||
</member>
|
||||
<member name="propagate_maximum_size" type="bool" setter="set_propagate_maximum_size" getter="is_propagating_maximum_size" default="false">
|
||||
If [code]true[/code], this Control's children will use the value returned by [method get_combined_maximum_size] in their own size calculations.
|
||||
</member>
|
||||
<member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0">
|
||||
The node's rotation around its pivot, in radians. See [member pivot_offset] to change the pivot's position.
|
||||
[b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees].
|
||||
|
|
@ -1175,6 +1273,9 @@
|
|||
[/csharp]
|
||||
[/codeblocks]
|
||||
</member>
|
||||
<member name="translation_context" type="StringName" setter="set_translation_context" getter="get_translation_context" default="&""">
|
||||
The translation context used when translating this control's displayed text, if it has any. Also used when generating translation templates.
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="focus_entered">
|
||||
|
|
@ -1193,6 +1294,11 @@
|
|||
Emitted when the node receives an [InputEvent].
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="maximum_size_changed">
|
||||
<description>
|
||||
Emitted when the node's maximum size changes.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="minimum_size_changed">
|
||||
<description>
|
||||
Emitted when the node's minimum size changes.
|
||||
|
|
@ -1462,13 +1568,13 @@
|
|||
[b]Note:[/b] If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted.
|
||||
</constant>
|
||||
<constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection">
|
||||
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.
|
||||
The control will grow/shrink to the left or top if its size is changed to be larger/smaller than its current size on the respective axis.
|
||||
</constant>
|
||||
<constant name="GROW_DIRECTION_END" value="1" enum="GrowDirection">
|
||||
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.
|
||||
The control will grow/shrink to the right or bottom if its size is changed to be larger/smaller than its current size on the respective axis.
|
||||
</constant>
|
||||
<constant name="GROW_DIRECTION_BOTH" value="2" enum="GrowDirection">
|
||||
The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.
|
||||
The control will grow/shrink in both directions equally if its size is changed to be larger/smaller than its current size.
|
||||
</constant>
|
||||
<constant name="ANCHOR_BEGIN" value="0" enum="Anchor">
|
||||
Snaps one of the 4 anchor's sides to the origin of the node's [code]Rect[/code], in the top left. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue