2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "Control" inherits= "CanvasItem" version= "4.0" >
2017-09-13 04:42:36 +08:00
<brief_description >
2020-12-23 00:24:29 +08:00
All user interface nodes inherit from Control. A control's anchors and offsets adapt its position and size relative to its parent.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2020-12-23 00:24:29 +08:00
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 [Container] nodes.
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
[b]User Interface nodes and input[/b]
2020-03-31 17:56:58 +08:00
Godot sends input events to the scene's root node first, by calling [method Node._input]. [method Node._input] forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls [code]MainLoop._input_event[/code].
[b]FIXME:[/b] No longer valid after DisplayServer split and Input refactoring.
Call [method accept_event] so no other node receives the event. Once you accepted an input, it becomes handled so [method Node._unhandled_input] will not process it.
2019-03-30 06:37:35 +08:00
Only one [Control] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus.
2019-06-22 07:04:47 +08:00
Sets [member mouse_filter] to [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.
2020-03-31 17:56:58 +08:00
[Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the inspector.
2020-08-04 18:55:12 +08:00
[b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
2021-01-13 02:56:04 +08:00
<link title= "GUI tutorial index" > https://docs.godotengine.org/en/latest/tutorials/ui/index.html</link>
2020-08-05 20:43:40 +08:00
<link title= "Custom drawing in 2D" > https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
2021-01-13 02:56:04 +08:00
<link title= "Control node gallery" > https://docs.godotengine.org/en/latest/tutorials/ui/control_node_gallery.html</link>
2020-10-01 16:34:47 +08:00
<link title= "All GUI Demos" > https://github.com/godotengine/godot-demo-projects/tree/master/gui</link>
2017-09-13 04:42:36 +08:00
</tutorials>
<methods >
2021-05-16 05:48:59 +08:00
<method name= "_can_drop_data" qualifiers= "virtual" >
<return type= "bool" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
<argument index= "1" name= "data" type= "Variant" >
</argument>
<description >
Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control.
This method should only be used to test the data. Process the data in [method _drop_data].
[codeblocks]
[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")
[/gdscript]
[csharp]
public override bool CanDropData(Vector2 position, object data)
{
// Check position if it is relevant to you
// Otherwise, just check data
return data is Godot.Collections.Dictionary & & (data as Godot.Collections.Dictionary).Contains("expected");
}
[/csharp]
[/codeblocks]
</description>
</method>
<method name= "_drop_data" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
<argument index= "1" name= "data" type= "Variant" >
</argument>
<description >
Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control.
[codeblocks]
[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"]
[/gdscript]
[csharp]
public override bool CanDropData(Vector2 position, object data)
{
return data is Godot.Collections.Dictionary & & (data as Godot.Collections.Dictionary).Contains("color");
}
public override void DropData(Vector2 position, object data)
{
Color color = (Color)(data as Godot.Collections.Dictionary)["color"];
}
[/csharp]
[/codeblocks]
</description>
</method>
<method name= "_get_drag_data" qualifiers= "virtual" >
<return type= "Variant" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
<description >
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag].
A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
[codeblocks]
[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
[/gdscript]
[csharp]
public override object GetDragData(Vector2 position)
{
object 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;
}
[/csharp]
[/codeblocks]
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "_get_minimum_size" qualifiers= "virtual" >
<return type= "Vector2" >
</return>
<description >
2019-08-04 03:19:47 +08:00
Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).
Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-20 02:36:39 +08:00
If not overridden, defaults to [constant Vector2.ZERO].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "_gui_input" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "event" type= "InputEvent" >
</argument>
<description >
2019-08-04 03:19:47 +08:00
Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
Example: clicking a control.
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2019-08-04 03:19:47 +08:00
func _gui_input(event):
if event is InputEventMouseButton:
2021-01-08 11:37:37 +08:00
if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
2019-08-04 03:19:47 +08:00
print("I've been clicked D:")
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
public override void _GuiInput(InputEvent @event)
{
if (@event is InputEventMouseButton)
{
var mb = @event as InputEventMouseButton;
if (mb.ButtonIndex == (int)ButtonList.Left & & mb.Pressed)
{
GD.Print("I've been clicked D:");
}
}
}
[/csharp]
[/codeblocks]
2019-08-04 03:19:47 +08:00
The event won't trigger if:
2021-05-16 05:48:59 +08:00
* clicking outside the control (see [method _has_point]);
2019-08-22 20:49:30 +08:00
* control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
* control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
* control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event;
2021-06-25 21:46:37 +08:00
* it happens outside parent's rectangle and the parent has either [member rect_clip_content] enabled.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-05-16 05:48:59 +08:00
<method name= "_has_point" qualifiers= "virtual" >
<return type= "bool" >
</return>
<argument index= "0" name= "point" type= "Vector2" >
</argument>
<description >
Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control.
If not overridden, default behavior is checking if the point is within control's Rect.
[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code].
</description>
</method>
2018-07-26 17:56:21 +08:00
<method name= "_make_custom_tooltip" qualifiers= "virtual" >
2020-11-03 00:18:29 +08:00
<return type= "Control" >
2018-07-26 17:56:21 +08:00
</return>
<argument index= "0" name= "for_text" type= "String" >
</argument>
<description >
2020-11-03 00:18:29 +08:00
Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property.
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 [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead.
The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member hint_tooltip] for an example).
2019-08-22 20:49:30 +08:00
[b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value.
2020-11-03 00:18:29 +08:00
[b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise the viewport that instantiates it will not be able to calculate its minimum size reliably.
Example of usage with a custom-constructed node:
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2019-08-04 03:19:47 +08:00
func _make_custom_tooltip(for_text):
var label = Label.new()
label.text = for_text
return label
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
2020-11-03 00:18:29 +08:00
public override Godot.Control _MakeCustomTooltip(String forText)
2020-09-12 23:06:13 +08:00
{
var label = new Label();
label.Text = forText;
return label;
}
[/csharp]
[/codeblocks]
2020-11-03 00:18:29 +08:00
Example of usage with a custom scene instance:
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2019-08-04 03:19:47 +08:00
func _make_custom_tooltip(for_text):
2021-06-18 06:03:09 +08:00
var tooltip = preload("res://SomeTooltipScene.tscn").instantiate()
2019-08-04 03:19:47 +08:00
tooltip.get_node("Label").text = for_text
return tooltip
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
2020-11-03 00:18:29 +08:00
public override Godot.Control _MakeCustomTooltip(String forText)
2020-09-12 23:06:13 +08:00
{
2021-06-18 06:03:09 +08:00
Node tooltip = ResourceLoader.Load< PackedScene> ("res://SomeTooltipScene.tscn").Instantiate();
2020-09-12 23:06:13 +08:00
tooltip.GetNode< Label> ("Label").Text = forText;
return tooltip;
}
[/csharp]
[/codeblocks]
2018-07-26 17:56:21 +08:00
</description>
</method>
2020-08-12 19:49:10 +08:00
<method name= "_structured_text_parser" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "args" type= "Array" >
</argument>
<argument index= "1" name= "text" type= "String" >
</argument>
<description >
User defined BiDi algorithm override function.
Return [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately.
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "accept_event" >
<return type= "void" >
</return>
<description >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "add_theme_color_override" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<description >
2020-08-04 18:55:12 +08:00
Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses.
[b]Example of overriding a label's color and resetting it later:[/b]
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2020-08-04 18:55:12 +08:00
# Override the child node "MyLabel"'s font color to orange.
$MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
# Reset the color by creating a new node to get the default value:
var default_label_color = Label.new().get_theme_color("font_color")
$MyLabel.add_theme_color_override("font_color", default_label_color)
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
// Override the child node "MyLabel"'s font color to orange.
GetNode< Label> ("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
// Reset the color by creating a new node to get the default value:
var defaultLabelColor = new Label().GetThemeColor("font_color");
GetNode< Label> ("MyLabel").AddThemeColorOverride("font_color", defaultLabelColor);
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "add_theme_constant_override" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "constant" type= "int" >
</argument>
<description >
2021-03-23 07:55:02 +08:00
Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "add_theme_font_override" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "font" type= "Font" >
</argument>
<description >
2021-03-23 07:55:02 +08:00
Overrides the font with given [code]name[/code] in the [member theme] resource the control uses.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-08-12 19:49:10 +08:00
<method name= "add_theme_font_size_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<argument index= "1" name= "font_size" type= "int" >
</argument>
<description >
2021-03-23 07:55:02 +08:00
Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses.
2020-08-12 19:49:10 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "add_theme_icon_override" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2020-02-12 16:59:06 +08:00
<argument index= "1" name= "texture" type= "Texture2D" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-23 07:55:02 +08:00
Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "add_theme_stylebox_override" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "stylebox" type= "StyleBox" >
</argument>
<description >
2021-03-23 07:55:02 +08:00
Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses.
2020-08-04 18:55:12 +08:00
[b]Example of modifying a property in a StyleBox by duplicating it:[/b]
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2020-08-04 18:55:12 +08:00
# 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.add_theme_stylebox_override("normal", null)
2020-09-12 23:06:13 +08:00
[/gdscript]
[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").AddThemeStyleboxOverride("normal", null);
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-01-24 06:34:44 +08:00
<method name= "find_next_valid_focus" qualifiers= "const" >
<return type= "Control" >
</return>
<description >
Finds the next (below in the tree) [Control] that can receive the focus.
</description>
</method>
<method name= "find_prev_valid_focus" qualifiers= "const" >
<return type= "Control" >
</return>
<description >
Finds the previous (above in the tree) [Control] that can receive the focus.
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "force_drag" >
<return type= "void" >
</return>
<argument index= "0" name= "data" type= "Variant" >
</argument>
<argument index= "1" name= "preview" type= "Control" >
</argument>
<description >
2021-05-16 05:48:59 +08:00
Forces drag and bypasses [method _get_drag_data] and [method set_drag_preview] by passing [code]data[/code] and [code]preview[/code]. Drag will start even if the mouse is neither over nor pressed on this control.
The methods [method _can_drop_data] and [method _drop_data] must be implemented on controls that want to receive drop data.
2017-09-13 04:42:36 +08:00
</description>
</method>
2019-06-27 22:10:09 +08:00
<method name= "get_anchor" qualifiers= "const" >
<return type= "float" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2019-06-27 22:10:09 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Returns the anchor for the specified [enum Side]. A getter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
2019-06-27 22:10:09 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_begin" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2020-12-23 00:24:29 +08:00
Returns [member offset_left] and [member offset_top]. See also [member rect_position].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_combined_minimum_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2019-08-04 03:19:47 +08:00
Returns combined minimum size from [member rect_min_size] and [method get_minimum_size].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_cursor_shape" qualifiers= "const" >
<return type= "int" enum= "Control.CursorShape" >
</return>
2019-09-25 01:45:03 +08:00
<argument index= "0" name= "position" type= "Vector2" default= "Vector2(0, 0)" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2018-08-18 05:55:19 +08:00
Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_end" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2020-12-23 00:24:29 +08:00
Returns [member offset_right] and [member offset_bottom].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-12-16 06:42:21 +08:00
<method name= "get_focus_neighbor" qualifiers= "const" >
2019-06-27 22:10:09 +08:00
<return type= "NodePath" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2019-06-27 22:10:09 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Returns the focus neighbor for the specified [enum Side]. A getter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
2019-06-27 22:10:09 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_focus_owner" qualifiers= "const" >
<return type= "Control" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Returns the control that has the keyboard focus or [code]null[/code] if none.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_global_rect" qualifiers= "const" >
<return type= "Rect2" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Returns the position and size of the control relative to the top-left corner of the screen. See [member rect_position] and [member rect_size].
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-01-04 21:33:44 +08:00
<method name= "get_minimum_size" qualifiers= "const" >
<return type= "Vector2" >
2019-06-27 22:10:09 +08:00
</return>
<description >
2021-01-04 21:33:44 +08:00
Returns the minimum size for this control. See [member rect_min_size].
2019-06-27 22:10:09 +08:00
</description>
</method>
2021-01-04 21:33:44 +08:00
<method name= "get_offset" qualifiers= "const" >
<return type= "float" >
2017-09-13 04:42:36 +08:00
</return>
2021-01-04 21:33:44 +08:00
<argument index= "0" name= "offset" type= "int" enum= "Side" >
</argument>
2017-09-13 04:42:36 +08:00
<description >
2021-01-04 21:33:44 +08:00
Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_parent_area_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Returns the width/height occupied in the parent control.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_parent_control" qualifiers= "const" >
<return type= "Control" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Returns the parent control node.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_rect" qualifiers= "const" >
<return type= "Rect2" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Returns the position and size of the control relative to the top-left corner of the parent Control. See [member rect_position] and [member rect_size].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "get_theme_color" qualifiers= "const" >
<return type= "Color" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-03-31 17:56:58 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2020-03-31 17:56:58 +08:00
func _ready():
modulate = get_theme_color("font_color", "Button") #get the color defined for button fonts
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
public override void _Ready()
{
Modulate = GetThemeColor("font_color", "Button"); //get the color defined for button fonts
}
[/csharp]
[/codeblocks]
2020-03-31 17:56:58 +08:00
</description>
</method>
<method name= "get_theme_constant" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-03-31 17:56:58 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2020-03-31 17:56:58 +08:00
</description>
</method>
<method name= "get_theme_font" qualifiers= "const" >
<return type= "Font" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-03-31 17:56:58 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2020-03-31 17:56:58 +08:00
</description>
</method>
2020-08-12 19:49:10 +08:00
<method name= "get_theme_font_size" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-08-12 19:49:10 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2020-08-12 19:49:10 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "get_theme_icon" qualifiers= "const" >
<return type= "Texture2D" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-03-31 17:56:58 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2020-03-31 17:56:58 +08:00
</description>
</method>
<method name= "get_theme_stylebox" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "StyleBox" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_tooltip" qualifiers= "const" >
<return type= "String" >
</return>
2019-09-25 01:45:03 +08:00
<argument index= "0" name= "at_position" type= "Vector2" default= "Vector2(0, 0)" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-22 20:49:30 +08:00
Returns the tooltip, which will appear when the cursor is resting over this control. See [member hint_tooltip].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "grab_click_focus" >
<return type= "void" >
</return>
<description >
Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-20 02:36:39 +08:00
Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus.
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2019-08-04 03:19:47 +08:00
func _process(delta):
grab_click_focus() #when clicking another Control node, this node will be clicked instead
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
public override void _Process(float delta)
{
GrabClickFocus(); //when clicking another Control node, this node will be clicked instead
}
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "grab_focus" >
<return type= "void" >
</return>
<description >
2018-12-29 07:17:09 +08:00
Steal the focus from another control and become the focused control (see [member focus_mode]).
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_focus" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
Returns [code]true[/code] if this is the current focused control. See [member focus_mode].
</description>
</method>
<method name= "has_theme_color" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_color_override" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Returns [code]true[/code] if [Color] with given [code]name[/code] has a valid override in this [Control] node.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_constant" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_constant_override" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Returns [code]true[/code] if constant with given [code]name[/code] has a valid override in this [Control] node.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_font" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_font_override" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-08-12 19:49:10 +08:00
<method name= "has_theme_font_size" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2020-08-12 19:49:10 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2020-08-12 19:49:10 +08:00
</description>
</method>
<method name= "has_theme_font_size_override" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Returns [code]true[/code] if font size with given [code]name[/code] has a valid override in this [Control] node.
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_icon" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_icon_override" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Returns [code]true[/code] if icon with given [code]name[/code] has a valid override in this [Control] node.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_stylebox" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
2021-03-31 01:16:33 +08:00
<argument index= "1" name= "theme_type" type= "StringName" default= """" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2021-03-31 01:16:33 +08:00
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-03-31 17:56:58 +08:00
<method name= "has_theme_stylebox_override" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
2020-02-22 21:59:09 +08:00
<argument index= "0" name= "name" type= "StringName" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-08-12 19:49:10 +08:00
<method name= "is_layout_rtl" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
Returns [code]true[/code] if layout is right-to-left.
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "minimum_size_changed" >
<return type= "void" >
</return>
<description >
2020-10-03 05:03:52 +08:00
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 rect_min_size] directly calls this method automatically.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "release_focus" >
<return type= "void" >
</return>
<description >
2018-08-18 05:55:19 +08:00
Give up the focus. No other control will be able to receive keyboard input.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-22 09:43:01 +08:00
<method name= "remove_theme_color_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for a [Color] with the given [code]name[/code].
</description>
</method>
<method name= "remove_theme_constant_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for a constant with the given [code]name[/code].
</description>
</method>
<method name= "remove_theme_font_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for a [Font] with the given [code]name[/code].
</description>
</method>
<method name= "remove_theme_font_size_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for a font size with the given [code]name[/code].
</description>
</method>
<method name= "remove_theme_icon_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for an icon with the given [code]name[/code].
</description>
</method>
<method name= "remove_theme_stylebox_override" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "StringName" >
</argument>
<description >
Removes a theme override for a [StyleBox] with the given [code]name[/code].
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "set_anchor" >
<return type= "void" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "anchor" type= "float" >
</argument>
2020-12-23 00:24:29 +08:00
<argument index= "2" name= "keep_offset" type= "bool" default= "false" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "3" name= "push_opposite_anchor" type= "bool" default= "true" >
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets the anchor for the specified [enum Side] to [code]anchor[/code]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
If [code]keep_offset[/code] is [code]true[/code], offsets aren't updated after this operation.
Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-20 02:36:39 +08:00
If [code]push_opposite_anchor[/code] is [code]true[/code] 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 [code]push_opposite_anchor[/code] was [code]false[/code], the left anchor would get value 0.5.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-12-23 00:24:29 +08:00
<method name= "set_anchor_and_offset" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2017-09-13 04:42:36 +08:00
</argument>
<argument index= "1" name= "anchor" type= "float" >
</argument>
<argument index= "2" name= "offset" type= "float" >
</argument>
<argument index= "3" name= "push_opposite_anchor" type= "bool" default= "false" >
</argument>
<description >
2020-12-23 00:24:29 +08:00
Works the same as [method set_anchor], but instead of [code]keep_offset[/code] argument and automatic update of offset, it allows to set the offset yourself (see [method set_offset]).
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-12-23 00:24:29 +08:00
<method name= "set_anchors_and_offsets_preset" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
<argument index= "0" name= "preset" type= "int" enum= "Control.LayoutPreset" >
</argument>
2017-10-12 05:54:43 +08:00
<argument index= "1" name= "resize_mode" type= "int" enum= "Control.LayoutPresetMode" default= "0" >
</argument>
<argument index= "2" name= "margin" type= "int" default= "0" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets both anchor preset and offset preset. See [method set_anchors_preset] and [method set_offsets_preset].
2017-09-13 04:42:36 +08:00
</description>
</method>
2017-10-12 05:54:43 +08:00
<method name= "set_anchors_preset" >
2017-09-13 04:42:36 +08:00
<return type= "void" >
</return>
2017-10-12 05:54:43 +08:00
<argument index= "0" name= "preset" type= "int" enum= "Control.LayoutPreset" >
</argument>
2020-12-23 00:24:29 +08:00
<argument index= "1" name= "keep_offsets" type= "bool" default= "false" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Sets the anchors to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor.
2020-12-23 00:24:29 +08:00
If [code]keep_offsets[/code] is [code]true[/code], control's position will also be updated.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_begin" >
<return type= "void" >
</return>
2017-09-10 21:37:49 +08:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member rect_position].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_drag_forwarding" >
<return type= "void" >
</return>
<argument index= "0" name= "target" type= "Control" >
</argument>
<description >
2018-02-26 12:09:04 +08:00
Forwards the handling of this control's drag and drop to [code]target[/code] control.
2021-05-16 05:48:59 +08:00
Forwarding can be implemented in the target control similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences:
2018-02-26 12:09:04 +08:00
1. The function name must be suffixed with [b]_fw[/b]
2. The function must take an extra argument that is the control doing the forwarding
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2018-02-26 12:09:04 +08:00
# ThisControl.gd
extends Control
2020-09-12 23:06:13 +08:00
export(Control) var target_control
2018-02-26 12:09:04 +08:00
func _ready():
set_drag_forwarding(target_control)
2018-08-18 05:55:19 +08:00
2018-02-26 12:09:04 +08:00
# TargetControl.gd
extends Control
2020-09-12 23:06:13 +08:00
2021-05-16 05:48:59 +08:00
func _can_drop_data_fw(position, data, from_control):
2018-02-26 12:09:04 +08:00
return true
2018-08-18 05:55:19 +08:00
2021-05-16 05:48:59 +08:00
func _drop_data_fw(position, data, from_control):
2020-09-12 23:06:13 +08:00
my_handle_data(data) # Your handler method.
2018-08-18 05:55:19 +08:00
2021-05-16 05:48:59 +08:00
func _get_drag_data_fw(position, from_control):
2018-02-26 12:09:04 +08:00
set_drag_preview(my_preview)
return my_data()
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
// ThisControl.cs
public class ThisControl : Control
{
[Export]
public Control TargetControl { get; set; }
public override void _Ready()
{
SetDragForwarding(TargetControl);
}
}
// TargetControl.cs
public class TargetControl : Control
{
public void CanDropDataFw(Vector2 position, object data, Control fromControl)
{
return true;
}
public void DropDataFw(Vector2 position, object data, Control fromControl)
{
MyHandleData(data); // Your handler method.
}
public void GetDragDataFw(Vector2 position, Control fromControl)
{
SetDragPreview(MyPreview);
return MyData();
}
}
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_drag_preview" >
<return type= "void" >
</return>
<argument index= "0" name= "control" type= "Control" >
</argument>
<description >
2021-05-16 05:48:59 +08:00
Shows the given control at the mouse pointer. A good time to call this method is in [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.
2020-09-12 23:06:13 +08:00
[codeblocks]
[gdscript]
2019-08-09 00:56:37 +08:00
export (Color, RGBA) var color = Color(1, 0, 0, 1)
2021-05-16 05:48:59 +08:00
func _get_drag_data(position):
2019-08-09 00:56:37 +08:00
# Use a control that is not in the tree
var cpb = ColorPickerButton.new()
cpb.color = color
cpb.rect_size = Vector2(50, 50)
set_drag_preview(cpb)
return color
2020-09-12 23:06:13 +08:00
[/gdscript]
[csharp]
[Export]
public Color Color = new Color(1, 0, 0, 1);
public override object GetDragData(Vector2 position)
{
// Use a control that is not in the tree
var cpb = new ColorPickerButton();
cpb.Color = Color;
cpb.RectSize = new Vector2(50, 50);
SetDragPreview(cpb);
return Color;
}
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_end" >
<return type= "void" >
</return>
2017-09-10 21:37:49 +08:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets [member offset_right] and [member offset_bottom] at the same time.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-12-16 06:42:21 +08:00
<method name= "set_focus_neighbor" >
2019-06-27 22:10:09 +08:00
<return type= "void" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2019-06-27 22:10:09 +08:00
</argument>
2020-12-16 06:42:21 +08:00
<argument index= "1" name= "neighbor" type= "NodePath" >
2019-06-27 22:10:09 +08:00
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets the anchor for the specified [enum Side] to the [Control] at [code]neighbor[/code] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
2019-06-27 22:10:09 +08:00
</description>
</method>
2019-05-21 19:26:37 +08:00
<method name= "set_global_position" >
<return type= "void" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
2020-12-23 00:24:29 +08:00
<argument index= "1" name= "keep_offsets" type= "bool" default= "false" >
2019-05-21 19:26:37 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Sets the [member rect_global_position] to given [code]position[/code].
2020-12-23 00:24:29 +08:00
If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets.
2019-05-21 19:26:37 +08:00
</description>
</method>
2020-12-23 00:24:29 +08:00
<method name= "set_offset" >
2019-06-27 22:10:09 +08:00
<return type= "void" >
</return>
2020-12-23 00:24:29 +08:00
<argument index= "0" name= "side" type= "int" enum= "Side" >
2019-06-27 22:10:09 +08:00
</argument>
<argument index= "1" name= "offset" type= "float" >
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets the offset for the specified [enum Side] to [code]offset[/code]. A setter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
2019-06-27 22:10:09 +08:00
</description>
</method>
2020-12-23 00:24:29 +08:00
<method name= "set_offsets_preset" >
2017-10-12 05:54:43 +08:00
<return type= "void" >
</return>
<argument index= "0" name= "preset" type= "int" enum= "Control.LayoutPreset" >
</argument>
<argument index= "1" name= "resize_mode" type= "int" enum= "Control.LayoutPresetMode" default= "0" >
</argument>
<argument index= "2" name= "margin" type= "int" default= "0" >
</argument>
<description >
2020-12-23 00:24:29 +08:00
Sets the offsets to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor.
2019-08-04 03:19:47 +08:00
Use parameter [code]resize_mode[/code] with constants from [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. [code]PRESET_LEFT_WIDE[/code].
Use parameter [code]margin[/code] to determine the gap between the [Control] and the edges.
2017-10-12 05:54:43 +08:00
</description>
</method>
2019-05-21 19:26:37 +08:00
<method name= "set_position" >
<return type= "void" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
2020-12-23 00:24:29 +08:00
<argument index= "1" name= "keep_offsets" type= "bool" default= "false" >
2019-05-21 19:26:37 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Sets the [member rect_position] to given [code]position[/code].
2020-12-23 00:24:29 +08:00
If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets.
2019-05-21 19:26:37 +08:00
</description>
</method>
<method name= "set_size" >
<return type= "void" >
</return>
<argument index= "0" name= "size" type= "Vector2" >
</argument>
2020-12-23 00:24:29 +08:00
<argument index= "1" name= "keep_offsets" type= "bool" default= "false" >
2019-05-21 19:26:37 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Sets the size (see [member rect_size]).
2020-12-23 00:24:29 +08:00
If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets.
2019-05-21 19:26:37 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "warp_mouse" >
<return type= "void" >
</return>
2017-09-10 21:37:49 +08:00
<argument index= "0" name= "to_position" type= "Vector2" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2019-08-04 03:19:47 +08:00
Moves the mouse cursor to [code]to_position[/code], relative to [member rect_position] of this [Control].
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
<members >
2019-06-29 18:38:01 +08:00
<member name= "anchor_bottom" type= "float" setter= "_set_anchor" getter= "get_anchor" default= "0.0" >
2020-12-23 00:24:29 +08:00
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 [enum Anchor] constants for convenience.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "anchor_left" type= "float" setter= "_set_anchor" getter= "get_anchor" default= "0.0" >
2020-12-23 00:24:29 +08:00
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 [enum Anchor] constants for convenience.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "anchor_right" type= "float" setter= "_set_anchor" getter= "get_anchor" default= "0.0" >
2020-12-23 00:24:29 +08:00
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 [enum Anchor] constants for convenience.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "anchor_top" type= "float" setter= "_set_anchor" getter= "get_anchor" default= "0.0" >
2021-06-07 16:17:32 +08:00
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 [enum Anchor] constants for convenience.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "focus_mode" type= "int" setter= "set_focus_mode" getter= "get_focus_mode" enum= "Control.FocusMode" default= "0" >
2018-01-12 06:38:35 +08:00
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
</member>
2020-12-16 06:42:21 +08:00
<member name= "focus_neighbor_bottom" type= "NodePath" setter= "set_focus_neighbor" getter= "get_focus_neighbor" default= "NodePath("")" >
2019-03-30 06:37:35 +08:00
Tells Godot which node it should give keyboard 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 [code]ui_down[/code] 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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-16 06:42:21 +08:00
<member name= "focus_neighbor_left" type= "NodePath" setter= "set_focus_neighbor" getter= "get_focus_neighbor" default= "NodePath("")" >
2019-03-30 06:37:35 +08:00
Tells Godot which node it should give keyboard 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 [code]ui_left[/code] 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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-16 06:42:21 +08:00
<member name= "focus_neighbor_right" type= "NodePath" setter= "set_focus_neighbor" getter= "get_focus_neighbor" default= "NodePath("")" >
2021-06-07 16:17:32 +08:00
Tells Godot which node it should give keyboard 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 [code]ui_right[/code] 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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-16 06:42:21 +08:00
<member name= "focus_neighbor_top" type= "NodePath" setter= "set_focus_neighbor" getter= "get_focus_neighbor" default= "NodePath("")" >
2019-03-30 06:37:35 +08:00
Tells Godot which node it should give keyboard 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 [code]ui_top[/code] 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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "focus_next" type= "NodePath" setter= "set_focus_next" getter= "get_focus_next" default= "NodePath("")" >
2020-03-10 18:41:36 +08:00
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
2018-12-26 23:20:31 +08:00
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
2017-11-24 16:16:27 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "focus_previous" type= "NodePath" setter= "set_focus_previous" getter= "get_focus_previous" default= "NodePath("")" >
2020-03-10 18:41:36 +08:00
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
2018-12-26 23:20:31 +08:00
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
2017-11-24 16:16:27 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "grow_horizontal" type= "int" setter= "set_h_grow_direction" getter= "get_h_grow_direction" enum= "Control.GrowDirection" default= "1" >
2018-12-26 23:20:31 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "grow_vertical" type= "int" setter= "set_v_grow_direction" getter= "get_v_grow_direction" enum= "Control.GrowDirection" default= "1" >
2018-12-26 23:20:31 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "hint_tooltip" type= "String" setter= "set_tooltip" getter= "_get_tooltip" default= """" >
2019-08-04 03:19:47 +08:00
Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. You can change the time required for the tooltip to appear with [code]gui/timers/tooltip_delay_sec[/code] option in Project Settings.
2020-11-03 00:18:29 +08:00
The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the [code]"TooltipPanel"[/code] and [code]"TooltipLabel"[/code] respectively. For example:
[codeblocks]
[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))
[/gdscript]
[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));
[/csharp]
[/codeblocks]
2017-09-13 04:42:36 +08:00
</member>
2020-08-12 19:49:10 +08:00
<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).
</member>
2021-01-04 21:33:44 +08:00
<member name= "mouse_default_cursor_shape" type= "int" setter= "set_default_cursor_shape" getter= "get_default_cursor_shape" enum= "Control.CursorShape" default= "0" >
The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
[b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system.
</member>
<member name= "mouse_filter" type= "int" setter= "set_mouse_filter" getter= "get_mouse_filter" enum= "Control.MouseFilter" default= "0" >
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
</member>
2020-12-23 00:24:29 +08:00
<member name= "offset_bottom" type= "float" setter= "set_offset" getter= "get_offset" default= "0.0" >
2018-12-26 23:20:31 +08:00
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
2020-12-28 17:11:58 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-23 00:24:29 +08:00
<member name= "offset_left" type= "float" setter= "set_offset" getter= "get_offset" default= "0.0" >
2018-12-26 23:20:31 +08:00
Distance between the node's left edge and its parent control, based on [member anchor_left].
2020-12-28 17:11:58 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-23 00:24:29 +08:00
<member name= "offset_right" type= "float" setter= "set_offset" getter= "get_offset" default= "0.0" >
2018-12-26 23:20:31 +08:00
Distance between the node's right edge and its parent control, based on [member anchor_right].
2020-12-28 17:11:58 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2020-12-23 00:24:29 +08:00
<member name= "offset_top" type= "float" setter= "set_offset" getter= "get_offset" default= "0.0" >
2018-12-26 23:20:31 +08:00
Distance between the node's top edge and its parent control, based on [member anchor_top].
2020-12-28 17:11:58 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "rect_clip_content" type= "bool" setter= "set_clip_contents" getter= "is_clipping_contents" default= "false" >
2021-06-25 21:46:37 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-06-30 03:22:15 +08:00
<member name= "rect_global_position" type= "Vector2" setter= "_set_global_position" getter= "get_global_position" >
2018-01-12 06:38:35 +08:00
The node's global position, relative to the world (usually to the top-left corner of the window).
</member>
2019-09-25 01:45:03 +08:00
<member name= "rect_min_size" type= "Vector2" setter= "set_custom_minimum_size" getter= "get_custom_minimum_size" default= "Vector2(0, 0)" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-09-25 01:45:03 +08:00
<member name= "rect_pivot_offset" type= "Vector2" setter= "set_pivot_offset" getter= "get_pivot_offset" default= "Vector2(0, 0)" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</member>
2019-09-25 01:45:03 +08:00
<member name= "rect_position" type= "Vector2" setter= "_set_position" getter= "get_position" default= "Vector2(0, 0)" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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].
2017-09-13 04:42:36 +08:00
</member>
2020-12-23 15:06:30 +08:00
<member name= "rect_rotation" type= "float" setter= "set_rotation" getter= "get_rotation" default= "0.0" >
The node's rotation around its pivot, in radians. See [member rect_pivot_offset] to change the pivot's position.
</member>
<member name= "rect_rotation_degrees" type= "float" setter= "set_rotation_degrees" getter= "get_rotation_degrees" default= "0.0" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
The node's rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot's position.
2017-09-13 04:42:36 +08:00
</member>
2019-09-25 01:45:03 +08:00
<member name= "rect_scale" type= "Vector2" setter= "set_scale" getter= "get_scale" default= "Vector2(1, 1)" >
2020-07-15 16:34:47 +08:00
The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value.
[b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
2021-06-18 06:03:09 +08:00
[b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property.
2017-09-13 04:42:36 +08:00
</member>
2019-09-25 01:45:03 +08:00
<member name= "rect_size" type= "Vector2" setter= "_set_size" getter= "get_size" default= "Vector2(0, 0)" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "size_flags_horizontal" type= "int" setter= "set_h_size_flags" getter= "get_h_size_flags" default= "1" >
2019-08-04 03:19:47 +08:00
Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "size_flags_stretch_ratio" type= "float" setter= "set_stretch_ratio" getter= "get_stretch_ratio" default= "1.0" >
2020-12-16 06:42:21 +08:00
If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "size_flags_vertical" type= "int" setter= "set_v_size_flags" getter= "get_v_size_flags" default= "1" >
2019-08-04 03:19:47 +08:00
Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
2017-09-13 04:42:36 +08:00
</member>
2019-07-16 02:42:47 +08:00
<member name= "theme" type= "Theme" setter= "set_theme" getter= "get_theme" >
2021-03-31 01:16:33 +08:00
The [Theme] resource this node and all its [Control] children use. If a child node has its own [Theme] resource set, theme items are merged with child's definitions having higher priority.
</member>
2021-06-06 03:24:24 +08:00
<member name= "theme_custom_type" type= "StringName" setter= "set_theme_custom_type" getter= "get_theme_custom_type" default= "&""" >
2021-03-31 01:16:33 +08:00
The type name used by this [Control] to look up its own theme items. By default, the class name of the node is used (e.g. [code]Button[/code] for the [Button] control), as well as the class names of all parent classes (in order of inheritance). Setting this property gives the highest priority to the type of the specified name, then falls back on the class names.
[b]Note:[/b] To look up [Control]'s own items use various [code]get_theme_*[/code] methods without specifying [code]theme_type[/code].
[b]Note:[/b] Theme items are looked for in the tree order, from branch to root, where each [Control] node is checked for its [member theme] property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
2017-09-13 04:42:36 +08:00
</member>
</members>
<signals >
<signal name= "focus_entered" >
<description >
Emitted when the node gains keyboard focus.
</description>
</signal>
<signal name= "focus_exited" >
<description >
Emitted when the node loses keyboard focus.
</description>
</signal>
<signal name= "gui_input" >
2018-09-11 06:18:05 +08:00
<argument index= "0" name= "event" type= "InputEvent" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Emitted when the node receives an [InputEvent].
2017-09-13 04:42:36 +08:00
</description>
</signal>
<signal name= "minimum_size_changed" >
<description >
Emitted when the node's minimum size changes.
</description>
</signal>
<signal name= "mouse_entered" >
<description >
2018-01-10 00:40:19 +08:00
Emitted when the mouse enters the control's [code]Rect[/code] area, provided its [member mouse_filter] lets the event reach it.
2017-09-13 04:42:36 +08:00
</description>
</signal>
<signal name= "mouse_exited" >
<description >
2018-01-10 00:40:19 +08:00
Emitted when the mouse leaves the control's [code]Rect[/code] area, provided its [member mouse_filter] lets the event reach it.
2017-09-13 04:42:36 +08:00
</description>
</signal>
<signal name= "resized" >
<description >
Emitted when the control changes size.
</description>
</signal>
<signal name= "size_flags_changed" >
<description >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Emitted when one of the size flags changes. See [member size_flags_horizontal] and [member size_flags_vertical].
2017-09-13 04:42:36 +08:00
</description>
</signal>
2020-03-31 17:56:58 +08:00
<signal name= "theme_changed" >
<description >
</description>
</signal>
2017-09-13 04:42:36 +08:00
</signals>
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "FOCUS_NONE" value= "0" enum= "FocusMode" >
2018-08-18 05:55:19 +08:00
The node cannot grab focus. Use with [member focus_mode].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "FOCUS_CLICK" value= "1" enum= "FocusMode" >
2018-08-18 05:55:19 +08:00
The node can only grab focus on mouse clicks. Use with [member focus_mode].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "FOCUS_ALL" value= "2" enum= "FocusMode" >
2018-08-18 05:55:19 +08:00
The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with [member focus_mode].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_RESIZED" value= "40" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Sent when the node changes size. Use [member rect_size] to get the new size.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_MOUSE_ENTER" value= "41" >
2018-08-18 05:55:19 +08:00
Sent when the mouse pointer enters the node.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_MOUSE_EXIT" value= "42" >
2018-08-18 05:55:19 +08:00
Sent when the mouse pointer exits the node.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_FOCUS_ENTER" value= "43" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Sent when the node grabs focus.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_FOCUS_EXIT" value= "44" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Sent when the node loses focus.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "NOTIFICATION_THEME_CHANGED" value= "45" >
2020-03-31 17:56:58 +08:00
Sent when the node's [member theme] changes, right before Godot redraws the control. Happens when you call one of the [code]add_theme_*_override[/code] methods.
2017-09-13 04:42:36 +08:00
</constant>
2018-04-10 16:12:42 +08:00
<constant name= "NOTIFICATION_SCROLL_BEGIN" value= "47" >
2018-12-26 23:20:31 +08:00
Sent when this node is inside a [ScrollContainer] which has begun being scrolled.
2018-04-10 16:12:42 +08:00
</constant>
<constant name= "NOTIFICATION_SCROLL_END" value= "48" >
2018-12-26 23:20:31 +08:00
Sent when this node is inside a [ScrollContainer] which has stopped being scrolled.
2018-04-10 16:12:42 +08:00
</constant>
2020-08-12 19:49:10 +08:00
<constant name= "NOTIFICATION_LAYOUT_DIRECTION_CHANGED" value= "49" >
Sent when control layout direction is changed.
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_ARROW" value= "0" enum= "CursorShape" >
2018-12-29 07:17:09 +08:00
Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_IBEAM" value= "1" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_POINTING_HAND" value= "2" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's pointing hand mouse cursor when the user hovers the node.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_CROSS" value= "3" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's cross mouse cursor when the user hovers the node.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_WAIT" value= "4" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's wait mouse cursor, often an hourglass, when the user hovers the node.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_BUSY" value= "5" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's busy mouse cursor when the user hovers the node. Often an hourglass.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_DRAG" value= "6" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_CAN_DROP" value= "7" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_FORBIDDEN" value= "8" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_VSIZE" value= "9" enum= "CursorShape" >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_HSIZE" value= "10" enum= "CursorShape" >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_BDIAGSIZE" value= "11" enum= "CursorShape" >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_FDIAGSIZE" value= "12" enum= "CursorShape" >
2019-06-22 07:04:47 +08:00
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 [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_MOVE" value= "13" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_VSPLIT" value= "14" enum= "CursorShape" >
2019-06-27 18:34:26 +08:00
Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_VSIZE].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_HSPLIT" value= "15" enum= "CursorShape" >
2019-06-27 18:34:26 +08:00
Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_HSIZE].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "CURSOR_HELP" value= "16" enum= "CursorShape" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Show the system's help mouse cursor when the user hovers the node, a question mark.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_TOP_LEFT" value= "0" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the top-left of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_TOP_RIGHT" value= "1" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the top-right of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_BOTTOM_LEFT" value= "2" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_BOTTOM_RIGHT" value= "3" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_CENTER_LEFT" value= "4" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_CENTER_TOP" value= "5" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_CENTER_RIGHT" value= "6" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_CENTER_BOTTOM" value= "7" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_CENTER" value= "8" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to the center of the parent control's bounds. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_LEFT_WIDE" value= "9" enum= "LayoutPreset" >
2020-12-23 00:24:29 +08:00
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 [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_TOP_WIDE" value= "10" enum= "LayoutPreset" >
2020-12-23 00:24:29 +08:00
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 [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_RIGHT_WIDE" value= "11" enum= "LayoutPreset" >
2020-12-23 00:24:29 +08:00
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 [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_BOTTOM_WIDE" value= "12" enum= "LayoutPreset" >
2020-12-23 00:24:29 +08:00
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 [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_VCENTER_WIDE" value= "13" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_HCENTER_WIDE" value= "14" enum= "LayoutPreset" >
2018-12-26 23:20:31 +08:00
Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_WIDE" value= "15" enum= "LayoutPreset" >
2020-12-23 00:24:29 +08:00
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. This is equivalent to the "Full Rect" layout option in the editor. Use with [method set_anchors_preset].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_MODE_MINSIZE" value= "0" enum= "LayoutPresetMode" >
2019-08-04 03:19:47 +08:00
The control will be resized to its minimum size.
2017-10-12 05:54:43 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_MODE_KEEP_WIDTH" value= "1" enum= "LayoutPresetMode" >
2019-08-04 03:19:47 +08:00
The control's width will not change.
2017-10-12 05:54:43 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_MODE_KEEP_HEIGHT" value= "2" enum= "LayoutPresetMode" >
2019-08-04 03:19:47 +08:00
The control's height will not change.
2017-10-12 05:54:43 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "PRESET_MODE_KEEP_SIZE" value= "3" enum= "LayoutPresetMode" >
2019-08-04 03:19:47 +08:00
The control's size will not change.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SIZE_FILL" value= "1" enum= "SizeFlags" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Tells the parent [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].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SIZE_EXPAND" value= "2" enum= "SizeFlags" >
2017-10-22 18:56:11 +08:00
Tells the parent [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].
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SIZE_EXPAND_FILL" value= "3" enum= "SizeFlags" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Sets the node's size flags to both fill and expand. See the 2 constants above for more information.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SIZE_SHRINK_CENTER" value= "4" enum= "SizeFlags" >
2018-08-18 05:55:19 +08:00
Tells the parent [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].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SIZE_SHRINK_END" value= "8" enum= "SizeFlags" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Tells the parent [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].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "MOUSE_FILTER_STOP" value= "0" enum= "MouseFilter" >
2019-06-22 07:04:47 +08:00
The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "MOUSE_FILTER_PASS" value= "1" enum= "MouseFilter" >
2019-01-22 14:39:06 +08:00
The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "MOUSE_FILTER_IGNORE" value= "2" enum= "MouseFilter" >
2019-06-22 07:04:47 +08:00
The control will not receive mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "GROW_DIRECTION_BEGIN" value= "0" enum= "GrowDirection" >
2018-12-26 23:20:31 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "GROW_DIRECTION_END" value= "1" enum= "GrowDirection" >
2019-02-13 16:23:29 +08:00
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.
2017-09-13 04:42:36 +08:00
</constant>
2018-04-10 16:12:42 +08:00
<constant name= "GROW_DIRECTION_BOTH" value= "2" enum= "GrowDirection" >
2019-02-13 16:23:29 +08:00
The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.
2018-04-10 16:12:42 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ANCHOR_BEGIN" value= "0" enum= "Anchor" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
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].
2017-09-13 04:42:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ANCHOR_END" value= "1" enum= "Anchor" >
[DOCS] Write member, signals and constants in the Control class
I left the following properties and constants out:
- rect_clip_content, I think it should let me resize the node below the content's size, but even with the minimum size set to (0,0) Godot won't let me
- mouse_filter, grow_horizontal and grow_vertical, same issue, after testing I don't know when they're necessary, so can't document them.
- GROW_DIRECTION_BEGIN, GROW_DIRECTION_END, MOUSE_FILTER_STOP, MOUSE_FILTER_PASS, MOUSE_FILTER_IGNORE, constants that correspond to the member variables above
For the mouse_filter, I couldn't see what it does in 3.0 alpha 1. For the grow_direction, I can see they might change the size calculation when the node's size changes, but in practice, with containers, I couldn't see a difference. If you know when to use it, please tell me and I'll add them to the PR.
2017-09-28 22:22:54 +08:00
Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. 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].
2017-09-13 04:42:36 +08:00
</constant>
2020-08-12 19:49:10 +08:00
<constant name= "LAYOUT_DIRECTION_INHERITED" value= "0" enum= "LayoutDirection" >
Automatic layout direction, determined from the parent control layout direction.
</constant>
<constant name= "LAYOUT_DIRECTION_LOCALE" value= "1" enum= "LayoutDirection" >
Automatic layout direction, determined from the current locale.
</constant>
<constant name= "LAYOUT_DIRECTION_LTR" value= "2" enum= "LayoutDirection" >
Left-to-right layout direction.
</constant>
<constant name= "LAYOUT_DIRECTION_RTL" value= "3" enum= "LayoutDirection" >
Right-to-left layout direction.
</constant>
<constant name= "TEXT_DIRECTION_INHERITED" value= "3" enum= "TextDirection" >
Text writing direction is the same as layout direction.
</constant>
<constant name= "TEXT_DIRECTION_AUTO" value= "0" enum= "TextDirection" >
Automatic text writing direction, determined from the current locale and text content.
</constant>
<constant name= "TEXT_DIRECTION_LTR" value= "1" enum= "TextDirection" >
Left-to-right text writing direction.
</constant>
<constant name= "TEXT_DIRECTION_RTL" value= "2" enum= "TextDirection" >
Right-to-left text writing direction.
</constant>
<constant name= "STRUCTURED_TEXT_DEFAULT" value= "0" enum= "StructuredTextParser" >
Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description.
</constant>
<constant name= "STRUCTURED_TEXT_URI" value= "1" enum= "StructuredTextParser" >
BiDi override for URI.
</constant>
<constant name= "STRUCTURED_TEXT_FILE" value= "2" enum= "StructuredTextParser" >
BiDi override for file path.
</constant>
<constant name= "STRUCTURED_TEXT_EMAIL" value= "3" enum= "StructuredTextParser" >
BiDi override for email.
</constant>
<constant name= "STRUCTURED_TEXT_LIST" value= "4" enum= "StructuredTextParser" >
BiDi override for lists.
Structured text options: list separator [code]String[/code].
</constant>
<constant name= "STRUCTURED_TEXT_NONE" value= "5" enum= "StructuredTextParser" >
Use default Unicode BiDi algorithm.
</constant>
<constant name= "STRUCTURED_TEXT_CUSTOM" value= "6" enum= "StructuredTextParser" >
User defined structured text BiDi override function.
</constant>
2017-09-13 04:42:36 +08:00
</constants>
</class>