summaryrefslogtreecommitdiff
path: root/doc/classes/Control.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Control.xml')
-rw-r--r--doc/classes/Control.xml87
1 files changed, 29 insertions, 58 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 680e008ff1..9db93bb6a9 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Control" inherits="CanvasItem" category="Core" version="3.0-beta">
+<class name="Control" inherits="CanvasItem" category="Core" version="3.0-stable">
<brief_description>
All User Interface nodes inherit from Control. Features anchors and margins to adapt its position and size to its parent.
</brief_description>
@@ -8,11 +8,13 @@
For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [code]Control[/code] and [Container] nodes.
[b]User Interface nodes and input[/b]
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 [method MainLoop._input_event]. 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.
- Only one [code]Control[/code] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the foucs, call [method set_focus_mode]. [code]Control[/code] nodes lose focus when another node grabs it, or if you hide the node in focus.
- Call [method set_ignore_mouse] to tell a [code]Control[/code] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
+ Only one [code]Control[/code] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [code]Control[/code] nodes lose focus when another node grabs it, or if you hide the node in focus.
+ Set [member mouse_filter] to MOUSE_FILTER_IGNORE to tell a [code]Control[/code] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
[Theme] resources change the Control's appearance. If you change the [Theme] on a [code]Control[/code] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_*_override[/code] methods, like [method add_font_override]. You can override the theme with the inspector.
</description>
<tutorials>
+ http://docs.godotengine.org/en/3.0/tutorials/gui/index.html
+ http://docs.godotengine.org/en/3.0/tutorials/2d/custom_drawing_in_2d.html
</tutorials>
<demos>
</demos>
@@ -96,7 +98,7 @@
Overrides the [code]name[/code] shader in the [theme] resource the node uses. If [code]shader[/code] is empty, Godot clears the override.
</description>
</method>
- <method name="add_style_override">
+ <method name="add_stylebox_override">
<return type="void">
</return>
<argument index="0" name="name" type="String">
@@ -178,13 +180,6 @@
Returns the mouse cursor shape the control displays on mouse hover, one of the [code]CURSOR_*[/code] constants.
</description>
</method>
- <method name="get_default_cursor_shape" qualifiers="const">
- <return type="int" enum="Control.CursorShape">
- </return>
- <description>
- Returns the default cursor shape for this control. See enum [code]CURSOR_*[/code] for the list of shapes.
- </description>
- </method>
<method name="get_drag_data" qualifiers="virtual">
<return type="Object">
</return>
@@ -200,13 +195,6 @@
Returns MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]).
</description>
</method>
- <method name="get_focus_mode" qualifiers="const">
- <return type="int" enum="Control.FocusMode">
- </return>
- <description>
- Returns the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL) (see [method set_focus_mode]).
- </description>
- </method>
<method name="get_focus_owner" qualifiers="const">
<return type="Control">
</return>
@@ -224,13 +212,6 @@
<description>
</description>
</method>
- <method name="get_global_position" qualifiers="const">
- <return type="Vector2">
- </return>
- <description>
- Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode.
- </description>
- </method>
<method name="get_global_rect" qualifiers="const">
<return type="Rect2">
</return>
@@ -400,6 +381,14 @@
<description>
</description>
</method>
+ <method name="has_shader_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="has_stylebox" qualifiers="const">
<return type="bool">
</return>
@@ -490,15 +479,6 @@
Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]).
</description>
</method>
- <method name="set_default_cursor_shape">
- <return type="void">
- </return>
- <argument index="0" name="shape" type="int" enum="Control.CursorShape">
- </argument>
- <description>
- Sets the default cursor shape for this control. See [code]CURSOR_*[/code] for the list of available cursor shapes. Useful for Godot plugins and applications or games that use the system's mouse cursors.
- </description>
- </method>
<method name="set_drag_forwarding">
<return type="void">
</return>
@@ -524,24 +504,6 @@
Sets MARGIN_RIGHT and MARGIN_BOTTOM at the same time. This is a helper (see [method set_margin]).
</description>
</method>
- <method name="set_focus_mode">
- <return type="void">
- </return>
- <argument index="0" name="mode" type="int" enum="Control.FocusMode">
- </argument>
- <description>
- Set the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL). Only one Control can be focused at the same time, and it will receive keyboard signals.
- </description>
- </method>
- <method name="set_global_position">
- <return type="void">
- </return>
- <argument index="0" name="position" type="Vector2">
- </argument>
- <description>
- Move the Control to a new position, relative to the top-left corner of the [i]window[/i] Control, and without changing current anchor mode. (see [method set_margin]).
- </description>
- </method>
<method name="set_margins_preset">
<return type="void">
</return>
@@ -594,6 +556,9 @@
<member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor">
Anchors the top edge of the node to the origin, the center or the end of its parent container. It changes how the top margin updates when the node moves or changes size. Use one of the [code]ANCHOR_*[/code] constants. Default value: [code]ANCHOR_BEGIN[/code].
</member>
+ <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode">
+ 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>
<member name="focus_neighbour_bottom" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour">
Tells Godot which node it should give keyboard focus to if the user presses Tab, the down arrow on the keyboard, or down on a gamepad. The node must be a [code]Control[/code]. If this property is not set, Godot will give focus to the closest [code]Control[/code] to the bottom of this one.
If the user presses Tab, Godot will give focus to the closest node to the right first, then to the bottom. If the user presses Shift+Tab, Godot will look to the left of the node, then above it.
@@ -631,11 +596,17 @@
<member name="margin_top" type="float" setter="set_margin" getter="get_margin">
Distance between the node's top edge and its parent container, based on [member anchor_top].
</member>
+ <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape">
+ The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
+ </member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter">
- Controls whether the control will be able to receive mouse button input events through [Control._gui_input] and how these events should be handled. Use one of the [code]MOUSE_FILTER_*[/code] constants. See the constants to learn what each does.
+ Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Use one of the [code]MOUSE_FILTER_*[/code] constants. See the constants to learn what each does.
</member>
<member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents">
</member>
+ <member name="rect_global_position" type="Vector2" setter="set_global_position" getter="get_global_position">
+ The node's global position, relative to the world (usually to the top-left corner of the window).
+ </member>
<member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size">
The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.
</member>
@@ -697,12 +668,12 @@
</signal>
<signal name="mouse_entered">
<description>
- Emitted when the mouse enters the control's [code]Rect[/code] area.
+ Emitted when the mouse enters the control's [code]Rect[/code] area, provided its [member mouse_filter] lets the event reach it.
</description>
</signal>
<signal name="mouse_exited">
<description>
- Emitted when the mouse leaves the control's [code]Rect[/code] area.
+ Emitted when the mouse leaves the control's [code]Rect[/code] area, provided its [member mouse_filter] lets the event reach it.
</description>
</signal>
<signal name="resized">
@@ -870,13 +841,13 @@
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].
</constant>
<constant name="MOUSE_FILTER_STOP" value="0" enum="MouseFilter">
- The control will receive mouse button input events through [method Control._gui_input] if clicked on. These events are automatically marked as handled and they will not propogate further to other controls.
+ The control will receive mouse button input events through [method _gui_input] if clicked on. These events are automatically marked as handled and they will not propagate further to other controls.
</constant>
<constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter">
- The control will receive mouse button input events through [method Control._gui_input] if clicked on. If this control does not handle the event, the parent control (if any) will be considered for a mouse click, and so on until there is no more parent control to potentially handle it. Even if no control handled it at all, the event will still be handled automatically.
+ The control will receive mouse button input events through [method _gui_input] if clicked on. If this control does not handle the event, the parent control (if any) will be considered for a mouse click, and so on until there is no more parent control to potentially handle it. Even if no control handled it at all, the event will still be handled automatically.
</constant>
<constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter">
- The control will not receive mouse button input events through [method Control._gui_input] and will not block other controls from receiving these events. These events will also not be handled automatically.
+ The control will not receive mouse button input events through [method _gui_input] and will not block other controls from receiving these events. These events will also not be handled automatically.
</constant>
<constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection">
</constant>