diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Control.xml | 4 | ||||
-rw-r--r-- | doc/classes/NavigationObstacle2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/NavigationObstacle3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Node.xml | 3 | ||||
-rw-r--r-- | doc/classes/PhysicsDirectBodyState3D.xml | 3 | ||||
-rw-r--r-- | doc/classes/PhysicsDirectBodyState3DExtension.xml | 5 | ||||
-rw-r--r-- | doc/classes/StaticBody2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/StaticBody3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/TextEdit.xml | 128 | ||||
-rw-r--r-- | doc/classes/TileMap.xml | 1 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 22 | ||||
-rw-r--r-- | doc/classes/Window.xml | 2 |
12 files changed, 167 insertions, 9 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index c66a93ce37..9c7cb7b089 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -7,8 +7,8 @@ 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. [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 in focus. To do so, it calls [code]MainLoop._input_event[/code]. - [b]FIXME:[/b] No longer valid after DisplayServer split and Input refactoring. + Godot propagates input events via viewports. Each [Viewport] is responsible for propagating [InputEvent]s to their child nodes. As the [member SceneTree.root] is a [Window], this already happens automatically for all UI elements in your game. + Input events are propagated through the [SceneTree] from the root node to all child nodes by calling [method Node._input]. For UI elements specifically, it makes more sense to override the virtual method [method _gui_input], which filters out unrelated input events, such as by checking z-order, [member mouse_filter], focus, or if the event was inside of the control's bounding box. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. 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. diff --git a/doc/classes/NavigationObstacle2D.xml b/doc/classes/NavigationObstacle2D.xml index 6d05e220e3..68d9691ccf 100644 --- a/doc/classes/NavigationObstacle2D.xml +++ b/doc/classes/NavigationObstacle2D.xml @@ -5,7 +5,7 @@ </brief_description> <description> 2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle2D] is physics safe. - [b]Note:[/b] Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. + Obstacles [b]don't[/b] change the resulting path from the pathfinding, they only affect the navigation agent movement in a radius. Therefore, using obstacles for the static walls in your level won't work because those walls don't exist in the pathfinding. The navigation agent will be pushed in a semi-random direction away while moving inside that radius. Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. </description> <tutorials> </tutorials> diff --git a/doc/classes/NavigationObstacle3D.xml b/doc/classes/NavigationObstacle3D.xml index f5a0bde089..90eb55887f 100644 --- a/doc/classes/NavigationObstacle3D.xml +++ b/doc/classes/NavigationObstacle3D.xml @@ -5,7 +5,7 @@ </brief_description> <description> 3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle3D] is physics safe. - [b]Note:[/b] Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. + Obstacles [b]don't[/b] change the resulting path from the pathfinding, they only affect the navigation agent movement in a radius. Therefore, using obstacles for the static walls in your level won't work because those walls don't exist in the pathfinding. The navigation agent will be pushed in a semi-random direction away while moving inside that radius. Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. </description> <tutorials> </tutorials> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 6ba7deba15..bceb285584 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -110,11 +110,12 @@ <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> - Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. + Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first. + This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method> diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml index efe63e4093..04087cbfb6 100644 --- a/doc/classes/PhysicsDirectBodyState3D.xml +++ b/doc/classes/PhysicsDirectBodyState3D.xml @@ -226,6 +226,9 @@ <member name="inverse_inertia" type="Vector3" setter="" getter="get_inverse_inertia"> The inverse of the inertia of the body. </member> + <member name="inverse_inertia_tensor" type="Basis" setter="" getter="get_inverse_inertia_tensor"> + The inverse of the inertia tensor of the body. + </member> <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass"> The inverse of the mass of the body. </member> diff --git a/doc/classes/PhysicsDirectBodyState3DExtension.xml b/doc/classes/PhysicsDirectBodyState3DExtension.xml index ade197eadc..4432f89b9d 100644 --- a/doc/classes/PhysicsDirectBodyState3DExtension.xml +++ b/doc/classes/PhysicsDirectBodyState3DExtension.xml @@ -159,6 +159,11 @@ <description> </description> </method> + <method name="_get_inverse_inertia_tensor" qualifiers="virtual const"> + <return type="Basis" /> + <description> + </description> + </method> <method name="_get_inverse_mass" qualifiers="virtual const"> <return type="float" /> <description> diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index 21c160b780..2393790e12 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -5,7 +5,7 @@ </brief_description> <description> Static body for 2D physics. - A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody2D], it doesn't consume any CPU resources as long as they don't move. + A static body is a simple body that doesn't move under physics simulation, i.e. it can't be moved by external forces or contacts but its transformation can still be updated manually by the user. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody2D], it doesn't consume any CPU resources as long as they don't move. They have extra functionalities to move and affect other bodies: [b]Static transform change:[/b] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. [b]Constant velocity:[/b] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml index daa71d1168..0beaa6bb52 100644 --- a/doc/classes/StaticBody3D.xml +++ b/doc/classes/StaticBody3D.xml @@ -5,7 +5,7 @@ </brief_description> <description> Static body for 3D physics. - A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody3D], it doesn't consume any CPU resources as long as they don't move. + A static body is a simple body that doesn't move under physics simulation, i.e. it can't be moved by external forces or contacts but its transformation can still be updated manually by the user. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody3D], it doesn't consume any CPU resources as long as they don't move. They have extra functionalities to move and affect other bodies: [b]Static transform change:[/b] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. [b]Constant velocity:[/b] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 0905c0c20b..2f9b971fc8 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -5,6 +5,7 @@ </brief_description> <description> TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo. + [b]Note:[/b] Most viewport, caret and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets. [b]Note:[/b] When holding down [kbd]Alt[/kbd], the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor. </description> <tutorials> @@ -12,18 +13,21 @@ <methods> <method name="_backspace" qualifiers="virtual"> <return type="void" /> + <param index="0" name="caret_index" type="int" /> <description> Override this method to define what happens when the user presses the backspace key. </description> </method> <method name="_copy" qualifiers="virtual"> <return type="void" /> + <param index="0" name="caret_index" type="int" /> <description> Override this method to define what happens when the user performs a copy operation. </description> </method> <method name="_cut" qualifiers="virtual"> <return type="void" /> + <param index="0" name="caret_index" type="int" /> <description> Override this method to define what happens when the user performs a cut operation. </description> @@ -31,23 +35,34 @@ <method name="_handle_unicode_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="unicode_char" type="int" /> + <param index="1" name="caret_index" type="int" /> <description> Override this method to define what happens when the user types in the provided key [param unicode_char]. </description> </method> <method name="_paste" qualifiers="virtual"> <return type="void" /> + <param index="0" name="caret_index" type="int" /> <description> Override this method to define what happens when the user performs a paste operation. </description> </method> <method name="_paste_primary_clipboard" qualifiers="virtual"> <return type="void" /> + <param index="0" name="caret_index" type="int" /> <description> Override this method to define what happens when the user performs a paste operation with middle mouse button. [b]Note:[/b] This method is only implemented on Linux. </description> </method> + <method name="add_caret"> + <return type="int" /> + <param index="0" name="line" type="int" /> + <param index="1" name="col" type="int" /> + <description> + Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid. + </description> + </method> <method name="add_gutter"> <return type="void" /> <param index="0" name="at" type="int" default="-1" /> @@ -55,14 +70,27 @@ Register a new gutter to this [TextEdit]. Use [param at] to have a specific gutter order. A value of [code]-1[/code] appends the gutter to the right. </description> </method> + <method name="adjust_carets_after_edit"> + <return type="void" /> + <param index="0" name="caret" type="int" /> + <param index="1" name="from_line" type="int" /> + <param index="2" name="from_col" type="int" /> + <param index="3" name="to_line" type="int" /> + <param index="4" name="to_col" type="int" /> + <description> + Reposition the carets affected by the edit. This assumes edits are applied in edit order, see [method get_caret_index_edit_order]. + </description> + </method> <method name="adjust_viewport_to_caret"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Adjust the viewport so the caret is visible. </description> </method> <method name="backspace"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Called when the user presses the backspace key. Can be overridden with [method _backspace]. </description> @@ -75,6 +103,7 @@ </method> <method name="center_viewport_to_caret"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Centers the viewport on the line the editing caret is at. This also resets the [member scroll_horizontal] value to [code]0[/code]. </description> @@ -93,28 +122,38 @@ </method> <method name="copy"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Copies the current text selection. Can be overridden with [method _copy]. </description> </method> <method name="cut"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Cut's the current selection. Can be overridden with [method _cut]. </description> </method> <method name="delete_selection"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Deletes the selected text. </description> </method> <method name="deselect"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Deselects the current selection. </description> </method> + <method name="end_action"> + <return type="void" /> + <description> + Marks the end of steps in the current action started with [method start_action]. + </description> + </method> <method name="end_complex_operation"> <return type="void" /> <description> @@ -123,24 +162,40 @@ </method> <method name="get_caret_column" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the column the editing caret is at. </description> </method> + <method name="get_caret_count" qualifiers="const"> + <return type="int" /> + <description> + Returns the number of carets in this [TextEdit]. + </description> + </method> <method name="get_caret_draw_pos" qualifiers="const"> <return type="Vector2" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the caret pixel draw position. </description> </method> + <method name="get_caret_index_edit_order"> + <return type="PackedInt32Array" /> + <description> + Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as [method insert_text_at_caret] are applied. + </description> + </method> <method name="get_caret_line" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the line the editing caret is on. </description> </method> <method name="get_caret_wrap_index" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the wrap index the editing caret is on. </description> @@ -381,32 +436,37 @@ Returns the scroll position for [param wrap_index] of [param line]. </description> </method> - <method name="get_selected_text" qualifiers="const"> + <method name="get_selected_text"> <return type="String" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Returns the text inside the selection. </description> </method> <method name="get_selection_column" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the original start column of the selection. </description> </method> <method name="get_selection_from_column" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the selection begin column. </description> </method> <method name="get_selection_from_line" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the selection begin line. </description> </method> <method name="get_selection_line" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the original start line of the selection. </description> @@ -419,12 +479,14 @@ </method> <method name="get_selection_to_column" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the selection end column. </description> </method> <method name="get_selection_to_line" qualifiers="const"> <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns the selection end line. </description> @@ -476,6 +538,7 @@ </method> <method name="get_word_under_caret" qualifiers="const"> <return type="String" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Returns a [String] text with the word under the caret's location. </description> @@ -494,6 +557,7 @@ </method> <method name="has_selection" qualifiers="const"> <return type="bool" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Returns [code]true[/code] if the user has selected text. </description> @@ -515,12 +579,14 @@ <method name="insert_text_at_caret"> <return type="void" /> <param index="0" name="text" type="String" /> + <param index="1" name="caret_index" type="int" default="-1" /> <description> Insert the specified text at the caret position. </description> </method> <method name="is_caret_visible" qualifiers="const"> <return type="bool" /> + <param index="0" name="caret_index" type="int" default="0" /> <description> Returns [code]true[/code] if the caret is visible on the screen. </description> @@ -576,6 +642,7 @@ <method name="is_mouse_over_selection" qualifiers="const"> <return type="bool" /> <param index="0" name="edges" type="bool" /> + <param index="1" name="caret_index" type="int" default="-1" /> <description> Returns whether the mouse is over selection. If [param edges] is [code]true[/code], the edges are considered part of the selection. </description> @@ -601,18 +668,41 @@ Merge the gutters from [param from_line] into [param to_line]. Only overwritable gutters will be copied. </description> </method> + <method name="merge_overlapping_carets"> + <return type="void" /> + <description> + Merges any overlapping carets. Will favour the newest caret, or the caret with a selection. + [b]Note:[/b] This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap. + </description> + </method> <method name="paste"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Paste at the current location. Can be overridden with [method _paste]. </description> </method> + <method name="paste_primary_clipboard"> + <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> + <description> + Pastes the primary clipboard. + </description> + </method> <method name="redo"> <return type="void" /> <description> Perform redo operation. </description> </method> + <method name="remove_caret"> + <return type="void" /> + <param index="0" name="caret" type="int" /> + <description> + Removes the given caret index. + [b]Note:[/b] This can result in adjustment of all other caret indices. + </description> + </method> <method name="remove_gutter"> <return type="void" /> <param index="0" name="gutter" type="int" /> @@ -620,6 +710,12 @@ Removes the gutter from this [TextEdit]. </description> </method> + <method name="remove_secondary_carets"> + <return type="void" /> + <description> + Removes all additional carets. + </description> + </method> <method name="remove_text"> <return type="void" /> <param index="0" name="from_line" type="int" /> @@ -666,6 +762,7 @@ <param index="1" name="from_column" type="int" /> <param index="2" name="to_line" type="int" /> <param index="3" name="to_column" type="int" /> + <param index="4" name="caret_index" type="int" default="0" /> <description> Perform selection, from line/column to line/column. If [member selecting_enabled] is [code]false[/code], no selection will occur. @@ -680,6 +777,7 @@ </method> <method name="select_word_under_caret"> <return type="void" /> + <param index="0" name="caret_index" type="int" default="-1" /> <description> Selects the word under the caret. </description> @@ -688,9 +786,11 @@ <return type="void" /> <param index="0" name="column" type="int" /> <param index="1" name="adjust_viewport" type="bool" default="true" /> + <param index="2" name="caret_index" type="int" default="0" /> <description> Moves the caret to the specified [param column] index. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. + [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets]. </description> </method> <method name="set_caret_line"> @@ -699,10 +799,12 @@ <param index="1" name="adjust_viewport" type="bool" default="true" /> <param index="2" name="can_be_hidden" type="bool" default="true" /> <param index="3" name="wrap_index" type="int" default="0" /> + <param index="4" name="caret_index" type="int" default="0" /> <description> Moves the caret to the specified [param line] index. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. If [param can_be_hidden] is [code]true[/code], the specified [code]line[/code] can be hidden. + [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets]. </description> </method> <method name="set_gutter_clickable"> @@ -872,6 +974,7 @@ <param index="0" name="mode" type="int" enum="TextEdit.SelectionMode" /> <param index="1" name="line" type="int" default="-1" /> <param index="2" name="column" type="int" default="-1" /> + <param index="3" name="caret_index" type="int" default="0" /> <description> Sets the current selection mode. </description> @@ -890,6 +993,14 @@ Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String[/code] </description> </method> + <method name="start_action"> + <return type="void" /> + <param index="0" name="action" type="int" enum="TextEdit.EditAction" /> + <description> + Starts an action, will end the current action if [code]action[/code] is different. + An action will also end after a call to [method end_action], after [member ProjectSettings.gui/timers/text_edit_idle_detect_sec] is triggered or a new undoable step outside the [method start_action] and [method end_action] calls. + </description> + </method> <method name="swap_lines"> <return type="void" /> <param index="0" name="from_line" type="int" /> @@ -926,6 +1037,9 @@ If [code]true[/code], a right-click moves the caret at the mouse position before displaying the context menu. If [code]false[/code], the context menu disregards mouse location. </member> + <member name="caret_multiple" type="bool" setter="set_multiple_carets_enabled" getter="is_multiple_carets_enabled" default="true"> + Sets if multiple carets are allowed. + </member> <member name="caret_type" type="int" setter="set_caret_type" getter="get_caret_type" enum="TextEdit.CaretType" default="0"> Set the type of caret to draw. </member> @@ -1154,6 +1268,18 @@ <constant name="MENU_MAX" value="28" enum="MenuItems"> Represents the size of the [enum MenuItems] enum. </constant> + <constant name="ACTION_NONE" value="0" enum="EditAction"> + No current action. + </constant> + <constant name="ACTION_TYPING" value="1" enum="EditAction"> + A typing action. + </constant> + <constant name="ACTION_BACKSPACE" value="2" enum="EditAction"> + A backwards delete action. + </constant> + <constant name="ACTION_DELETE" value="3" enum="EditAction"> + A forward delete action. + </constant> <constant name="SEARCH_MATCH_CASE" value="1" enum="SearchFlags"> Match case when searching. </constant> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index fd9c44091c..348184a16a 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -155,6 +155,7 @@ <method name="get_layers_count" qualifiers="const"> <return type="int" /> <description> + Returns the number of layers in the TileMap. </description> </method> <method name="get_neighbor_cell" qualifiers="const"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 87ee26fa32..998e782975 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -129,6 +129,9 @@ <method name="is_input_handled" qualifiers="const"> <return type="bool" /> <description> + Returns whether the current [InputEvent] has been handled. Input events are not handled until [method set_input_as_handled] has been called during the lifetime of an [InputEvent]. + This is usually done as part of input handling methods like [method Node._input], [method Control._gui_input] or others, as well as in corresponding signal handlers. + If [member handle_input_locally] is set to [code]false[/code], this method will try finding the first parent viewport that is set to handle input locally, and return its value for [method is_input_handled] instead. </description> </method> <method name="push_input"> @@ -136,6 +139,13 @@ <param index="0" name="event" type="InputEvent" /> <param index="1" name="in_local_coords" type="bool" default="false" /> <description> + Triggers the given [param event] in this [Viewport]. This can be used to pass an [InputEvent] between viewports, or to locally apply inputs that were sent over the network or saved to a file. + If [param in_local_coords] is [code]false[/code], the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If [param in_local_coords] is [code]true[/code], the event's position is in viewport coordinates. + While this method serves a similar purpose as [method Input.parse_input_event], it does not remap the specified [param event] based on project settings like [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. + Calling this method will propagate calls to child nodes for following methods in the given order: + - [method Node._input] + - [method Control._gui_input] for [Control] nodes + If an earlier method marks the input as handled via [method set_input_as_handled], any later method in this list will not be called. </description> </method> <method name="push_text_input"> @@ -149,6 +159,15 @@ <param index="0" name="event" type="InputEvent" /> <param index="1" name="in_local_coords" type="bool" default="false" /> <description> + Triggers the given [InputEvent] in this [Viewport]. This can be used to pass input events between viewports, or to locally apply inputs that were sent over the network or saved to a file. + If [param in_local_coords] is [code]false[/code], the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If [param in_local_coords] is [code]true[/code], the event's position is in viewport coordinates. + While this method serves a similar purpose as [method Input.parse_input_event], it does not remap the specified [param event] based on project settings like [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. + Calling this method will propagate calls to child nodes for following methods in the given order: + - [method Node._shortcut_input] + - [method Node._unhandled_input] + - [method Node._unhandled_key_input] + If an earlier method marks the input as handled via [method set_input_as_handled], any later method in this list will not be called. + If none of the methods handle the event and [member physics_object_picking] is [code]true[/code], the event is used for physics object picking. </description> </method> <method name="set_input_as_handled"> @@ -212,6 +231,9 @@ If [code]true[/code], the GUI controls on the viewport will lay pixel perfectly. </member> <member name="handle_input_locally" type="bool" setter="set_handle_input_locally" getter="is_handling_input_locally" default="true"> + If [code]true[/code], this viewport will mark incoming input events as handled by itself. If [code]false[/code], this is instead done by the the first parent viewport that is set to handle input locally. + A [SubViewportContainer] will automatically set this property to [code]false[/code] for the [Viewport] contained inside of it. + See also [method set_input_as_handled] and [method is_input_handled]. </member> <member name="mesh_lod_threshold" type="float" setter="set_mesh_lod_threshold" getter="get_mesh_lod_threshold" default="1.0"> The automatic LOD bias to use for meshes rendered within the [Viewport] (this is analogous to [member ReflectionProbe.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index a688fb36b3..c278f7031f 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -469,7 +469,7 @@ <signal name="window_input"> <param index="0" name="event" type="InputEvent" /> <description> - Emitted when the [Window] is currently focused and receives any input, passing the received event as an argument. + Emitted when the [Window] is currently focused and receives any input, passing the received event as an argument. The event's position, if present, is in the embedder's coordinate system. </description> </signal> </signals> |