diff options
Diffstat (limited to 'doc/classes')
41 files changed, 763 insertions, 83 deletions
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index f10e80e048..c877b3de78 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -139,8 +139,10 @@ <return type="PackedInt64Array" /> <param index="0" name="from_id" type="int" /> <param index="1" name="to_id" type="int" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. [codeblocks] [gdscript] var astar = AStar2D.new() @@ -228,8 +230,10 @@ <return type="PackedVector2Array" /> <param index="0" name="from_id" type="int" /> <param index="1" name="to_id" type="int" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector2Array] and will print an error message. </description> </method> diff --git a/doc/classes/AStar3D.xml b/doc/classes/AStar3D.xml index e2afeef377..c8a80a9012 100644 --- a/doc/classes/AStar3D.xml +++ b/doc/classes/AStar3D.xml @@ -168,8 +168,10 @@ <return type="PackedInt64Array" /> <param index="0" name="from_id" type="int" /> <param index="1" name="to_id" type="int" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. [codeblocks] [gdscript] var astar = AStar3D.new() @@ -255,8 +257,10 @@ <return type="PackedVector3Array" /> <param index="0" name="from_id" type="int" /> <param index="1" name="to_id" type="int" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message. </description> </method> diff --git a/doc/classes/AStarGrid2D.xml b/doc/classes/AStarGrid2D.xml index 4501bec314..794e40fde9 100644 --- a/doc/classes/AStarGrid2D.xml +++ b/doc/classes/AStarGrid2D.xml @@ -75,16 +75,20 @@ <return type="Vector2i[]" /> <param index="0" name="from_id" type="Vector2i" /> <param index="1" name="to_id" type="Vector2i" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. </description> </method> <method name="get_point_path"> <return type="PackedVector2Array" /> <param index="0" name="from_id" type="Vector2i" /> <param index="1" name="to_id" type="Vector2i" /> + <param index="2" name="allow_partial_path" type="bool" default="false" /> <description> Returns an array with the points that are in the path found by [AStarGrid2D] between the given points. The array is ordered from the starting point to the ending point of the path. + If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached. [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message. </description> </method> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index d7fb735b4d..960bbe68ad 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -6,6 +6,13 @@ <description> Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. Inherit this when creating animation nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. + You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except [AnimationNodeOutput]. + [b]Note:[/b] If more than two inputs exist in the [AnimationNode], which time information takes precedence depends on the type of [AnimationNode]. + [codeblock] + var current_length = $AnimationTree[parameters/AnimationNodeName/current_length] + var current_position = $AnimationTree[parameters/AnimationNodeName/current_position] + var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta] + [/codeblock] </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> @@ -56,7 +63,7 @@ When inheriting from [AnimationRootNode], implement this virtual method to return whether the [param parameter] is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. </description> </method> - <method name="_process" qualifiers="virtual const"> + <method name="_process" qualifiers="virtual const" deprecated="Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future."> <return type="float" /> <param index="0" name="time" type="float" /> <param index="1" name="seek" type="bool" /> @@ -65,7 +72,7 @@ <description> When inheriting from [AnimationRootNode], implement this virtual method to run some code when this animation node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. - This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). + This function should return the delta. </description> </method> <method name="add_input"> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index d965d31b03..5683371182 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -15,9 +15,27 @@ <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&"""> Animation to use as an output. It is one of the animations provided by [member AnimationTree.anim_player]. </member> + <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="Animation.LoopMode"> + If [member use_custom_timeline] is [code]true[/code], override the loop settings of the original [Animation] resource with the value. + </member> <member name="play_mode" type="int" setter="set_play_mode" getter="get_play_mode" enum="AnimationNodeAnimation.PlayMode" default="0"> Determines the playback direction of the animation. </member> + <member name="start_offset" type="float" setter="set_start_offset" getter="get_start_offset"> + If [member use_custom_timeline] is [code]true[/code], offset the start position of the animation. + This is useful for adjusting which foot steps first in 3D walking animations. + </member> + <member name="stretch_time_scale" type="bool" setter="set_stretch_time_scale" getter="is_stretching_time_scale"> + If [code]true[/code], scales the time so that the length specified in [member timeline_length] is one cycle. + This is useful for matching the periods of walking and running animations. + If [code]false[/code], the original animation length is respected. If you set the loop to [member loop_mode], the animation will loop in [member timeline_length]. + </member> + <member name="timeline_length" type="float" setter="set_timeline_length" getter="get_timeline_length"> + If [member use_custom_timeline] is [code]true[/code], offset the start position of the animation. + </member> + <member name="use_custom_timeline" type="bool" setter="set_use_custom_timeline" getter="is_using_custom_timeline" default="false"> + If [code]true[/code], [AnimationNode] provides an animation based on the [Animation] resource with some parameters adjusted. + </member> </members> <constants> <constant name="PLAY_MODE_FORWARD" value="0" enum="PlayMode"> diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index ac7cf70133..6ff2d6f6db 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -66,17 +66,22 @@ <member name="autorestart_random_delay" type="float" setter="set_autorestart_random_delay" getter="get_autorestart_random_delay" default="0.0"> If [member autorestart] is [code]true[/code], a random additional delay (in seconds) between 0 and this value will be added to [member autorestart_delay]. </member> + <member name="break_loop_at_end" type="bool" setter="set_break_loop_at_end" getter="is_loop_broken_at_end" default="false"> + If [code]true[/code], breaks the loop at the end of the loop cycle for transition, even if the animation is looping. + </member> <member name="fadein_curve" type="Curve" setter="set_fadein_curve" getter="get_fadein_curve"> Determines how cross-fading between animations is eased. If empty, the transition will be linear. </member> <member name="fadein_time" type="float" setter="set_fadein_time" getter="get_fadein_time" default="0.0"> The fade-in duration. For example, setting this to [code]1.0[/code] for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation. + [b]Note:[/b] [AnimationNodeOneShot] transitions the current state after the end of the fading. When [AnimationNodeOutput] is considered as the most upstream, so the [member fadein_time] is scaled depending on the downstream delta. For example, if this value is set to [code]1.0[/code] and a [AnimationNodeTimeScale] with a value of [code]2.0[/code] is chained downstream, the actual processing time will be 0.5 second. </member> <member name="fadeout_curve" type="Curve" setter="set_fadeout_curve" getter="get_fadeout_curve"> Determines how cross-fading between animations is eased. If empty, the transition will be linear. </member> <member name="fadeout_time" type="float" setter="set_fadeout_time" getter="get_fadeout_time" default="0.0"> The fade-out duration. For example, setting this to [code]1.0[/code] for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation. + [b]Note:[/b] [AnimationNodeOneShot] transitions the current state after the end of the fading. When [AnimationNodeOutput] is considered as the most upstream, so the [member fadeout_time] is scaled depending on the downstream delta. For example, if this value is set to [code]1.0[/code] and an [AnimationNodeTimeScale] with a value of [code]2.0[/code] is chained downstream, the actual processing time will be 0.5 second. </member> <member name="mix_mode" type="int" setter="set_mix_mode" getter="get_mix_mode" enum="AnimationNodeOneShot.MixMode" default="0"> The blend type. diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index 7b7797f594..7bd0bd7e7e 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -28,6 +28,9 @@ <member name="advance_mode" type="int" setter="set_advance_mode" getter="get_advance_mode" enum="AnimationNodeStateMachineTransition.AdvanceMode" default="1"> Determines whether the transition should disabled, enabled when using [method AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [member advance_condition] and [member advance_expression] checks are true (if assigned). </member> + <member name="break_loop_at_end" type="bool" setter="set_break_loop_at_end" getter="is_loop_broken_at_end" default="false"> + If [code]true[/code], breaks the loop at the end of the loop cycle for transition, even if the animation is looping. + </member> <member name="priority" type="int" setter="set_priority" getter="get_priority" default="1"> Lower priority transitions are preferred when travelling through the tree via [method AnimationNodeStateMachinePlayback.travel] or [member advance_mode] is set to [constant ADVANCE_MODE_AUTO]. </member> @@ -42,6 +45,7 @@ </member> <member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time" default="0.0"> The time to cross-fade between this state and the next. + [b]Note:[/b] [AnimationNodeStateMachine] transitions the current state immediately after the start of the fading. The precise remaining time can only be inferred from the main animation. When [AnimationNodeOutput] is considered as the most upstream, so the [member xfade_time] is not scaled depending on the downstream delta. See also [member AnimationNodeOneShot.fadeout_time]. </member> </members> <signals> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 3e1a0a28b5..775a208735 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -42,6 +42,13 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="is_input_loop_broken_at_end" qualifiers="const"> + <return type="bool" /> + <param index="0" name="input" type="int" /> + <description> + Returns whether the animation breaks the loop at the end of the loop cycle for transition. + </description> + </method> <method name="is_input_reset" qualifiers="const"> <return type="bool" /> <param index="0" name="input" type="int" /> @@ -64,6 +71,14 @@ Enables or disables auto-advance for the given [param input] index. If enabled, state changes to the next input after playing the animation once. If enabled for the last input state, it loops to the first. </description> </method> + <method name="set_input_break_loop_at_end"> + <return type="void" /> + <param index="0" name="input" type="int" /> + <param index="1" name="enable" type="bool" /> + <description> + If [code]true[/code], breaks the loop at the end of the loop cycle for transition, even if the animation is looping. + </description> + </method> <method name="set_input_reset"> <return type="void" /> <param index="0" name="input" type="int" /> @@ -85,6 +100,7 @@ </member> <member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time" default="0.0"> Cross-fading time (in seconds) between each animation connected to the inputs. + [b]Note:[/b] [AnimationNodeTransition] transitions the current state immediately after the start of the fading. The precise remaining time can only be inferred from the main animation. When [AnimationNodeOutput] is considered as the most upstream, so the [member xfade_time] is not scaled depending on the downstream delta. See also [member AnimationNodeOneShot.fadeout_time]. </member> </members> </class> diff --git a/doc/classes/AudioEffectHardLimiter.xml b/doc/classes/AudioEffectHardLimiter.xml new file mode 100644 index 0000000000..7616b91f97 --- /dev/null +++ b/doc/classes/AudioEffectHardLimiter.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AudioEffectHardLimiter" inherits="AudioEffect" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Adds a hard limiter audio effect to an Audio bus. + </brief_description> + <description> + A limiter is an effect designed to disallow sound from going over a given dB threshold. Hard limiters predict volume peaks, and will smoothly apply gain reduction when a peak crosses the ceiling threshold to prevent clipping and distortion. It preserves the waveform and prevents it from crossing the ceiling threshold. Adding one in the Master bus is recommended as a safety measure to prevent sudden volume peaks from occurring, and to prevent distortion caused by clipping. + </description> + <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> + </tutorials> + <members> + <member name="ceiling_db" type="float" setter="set_ceiling_db" getter="get_ceiling_db" default="-0.3"> + The waveform's maximum allowed value, in decibels. This value can range from [code]-24.0[/code] to [code]0.0[/code]. + The default value of [code]-0.3[/code] prevents potential inter-sample peaks (ISP) from crossing over 0 dB, which can cause slight distortion on some older hardware. + </member> + <member name="pre_gain_db" type="float" setter="set_pre_gain_db" getter="get_pre_gain_db" default="0.0"> + Gain to apply before limiting, in decibels. + </member> + <member name="release" type="float" setter="set_release" getter="get_release" default="0.1"> + Time it takes in seconds for the gain reduction to fully release. + </member> + </members> +</class> diff --git a/doc/classes/AudioEffectLimiter.xml b/doc/classes/AudioEffectLimiter.xml index 57861d0485..b1a80cd9ef 100644 --- a/doc/classes/AudioEffectLimiter.xml +++ b/doc/classes/AudioEffectLimiter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectLimiter" inherits="AudioEffect" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AudioEffectLimiter" inherits="AudioEffect" deprecated="Use [AudioEffectHardLimiter] instead." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Adds a soft-clip limiter audio effect to an Audio bus. </brief_description> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 12f7024518..29535ffd64 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -4,7 +4,7 @@ A node that provides a polygon shape to a [CollisionObject2D] parent. </brief_description> <description> - A node that provides a thickened polygon shape (a prism) to a [CollisionObject2D] parent and allows to edit it. The polygon can be concave or convex. This can give a detection shape to an [Area2D] or turn [PhysicsBody2D] into a solid object. + A node that provides a polygon shape to a [CollisionObject2D] parent and allows to edit it. The polygon can be concave or convex. This can give a detection shape to an [Area2D], turn [PhysicsBody2D] into a solid object, or give a hollow shape to a [StaticBody2D]. [b]Warning:[/b] A non-uniformly scaled [CollisionShape2D] will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its shape resource instead. </description> <tutorials> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 43c3f5c1be..cc32964e87 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1012,6 +1012,7 @@ Distance between the node's top edge and its parent control, based on [member anchor_top]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. </member> + <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" /> <member name="pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)"> By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot. Set this property to [member size] / 2 to pivot around the Control's center. </member> @@ -1181,6 +1182,14 @@ - One of the node's theme property overrides is changed. - The node enters the scene tree. [b]Note:[/b] As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree. + [b]Note:[/b] This notification is received alongside [constant Node.NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using [method Node.is_node_ready]. + [codeblock] + func _notification(what): + if what == NOTIFICATION_THEME_CHANGED: + if not is_node_ready(): + await ready # Wait until ready signal. + $Label.add_theme_color_override("font_color", Color.YELLOW) + [/codeblock] </constant> <constant name="NOTIFICATION_SCROLL_BEGIN" value="47"> Sent when this node is inside a [ScrollContainer] which has begun being scrolled when dragging the scrollable area [i]with a touch event[/i]. This notification is [i]not[/i] sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events. diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index f4c75a731d..41e241779a 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -45,7 +45,7 @@ { private DtlsServer _dtls = new DtlsServer(); private UdpServer _server = new UdpServer(); - private Godot.Collections.Array<PacketPeerDTLS> _peers = new Godot.Collections.Array<PacketPeerDTLS>(); + private Godot.Collections.Array<PacketPeerDtls> _peers = new Godot.Collections.Array<PacketPeerDtls>(); public override void _Ready() { @@ -59,8 +59,8 @@ { while (Server.IsConnectionAvailable()) { - PacketPeerUDP peer = _server.TakeConnection(); - PacketPeerDTLS dtlsPeer = _dtls.TakeConnection(peer); + PacketPeerUdp peer = _server.TakeConnection(); + PacketPeerDtls dtlsPeer = _dtls.TakeConnection(peer); if (dtlsPeer.GetStatus() != PacketPeerDtls.Status.Handshaking) { continue; // It is normal that 50% of the connections fails due to cookie exchange. diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index ecb8438edb..9eb5f9e334 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -103,7 +103,7 @@ <param index="3" name="callback" type="Callable" /> <description> Shows a text input dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [String] parameter which contains the text field's contents. - [b]Note:[/b] This method is implemented only on macOS and Windows. + [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS and Windows. </description> </method> <method name="dialog_show"> @@ -114,7 +114,7 @@ <param index="3" name="callback" type="Callable" /> <description> Shows a text dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [int] parameter which corresponds to the index of the pressed button. - [b]Note:[/b] This method is implemented only on macOS and Windows. + [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS and Windows. </description> </method> <method name="enable_for_stealing_focus"> @@ -138,7 +138,7 @@ Displays OS native dialog for selecting files or directories in the file system. Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters]. Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code]. - [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. + [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. [b]Note:[/b] [param current_directory] might be ignored. [b]Note:[/b] On Linux, [param show_hidden] is ignored. [b]Note:[/b] On macOS, native file dialogs have no title. @@ -164,7 +164,7 @@ - [code]"values"[/code] - [PackedStringArray] of values. If empty, boolean option (check box) is used. - [code]"default"[/code] - default selected option index ([int]) or default boolean value ([bool]). Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary[/code]. - [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. + [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. [b]Note:[/b] [param current_directory] might be ignored. [b]Note:[/b] On Linux (X11), [param show_hidden] is ignored. [b]Note:[/b] On macOS, native file dialogs have no title. @@ -553,7 +553,7 @@ <param index="0" name="menu_root" type="String" /> <param index="1" name="tag" type="Variant" /> <description> - Returns the index of the item with the specified [param tag]. Index is automatically assigned to each item by the engine. Index can not be set manually. + Returns the index of the item with the specified [param tag]. Indices are automatically assigned to each item by the engine, and cannot be set manually. [b]Note:[/b] This method is implemented only on macOS. </description> </method> @@ -562,7 +562,7 @@ <param index="0" name="menu_root" type="String" /> <param index="1" name="text" type="String" /> <description> - Returns the index of the item with the specified [param text]. Index is automatically assigned to each item by the engine. Index can not be set manually. + Returns the index of the item with the specified [param text]. Indices are automatically assigned to each item by the engine, and cannot be set manually. [b]Note:[/b] This method is implemented only on macOS. </description> </method> @@ -1784,7 +1784,7 @@ Display server supports setting the mouse cursor shape to a custom image. [b]Windows, macOS, Linux (X11/Wayland), Web[/b] </constant> <constant name="FEATURE_NATIVE_DIALOG" value="9" enum="Feature"> - Display server supports spawning dialogs using the operating system's native look-and-feel. [b]Windows, macOS, Linux (X11/Wayland)[/b] + Display server supports spawning text dialogs using the operating system's native look-and-feel. See [method dialog_show]. [b]Windows, macOS[/b] </constant> <constant name="FEATURE_IME" value="10" enum="Feature"> Display server supports [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url], which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. [b]Windows, macOS, Linux (X11)[/b] @@ -1825,6 +1825,12 @@ <constant name="FEATURE_NATIVE_HELP" value="23" enum="Feature"> Display server supports native help system search callbacks. See [method help_set_search_callbacks]. </constant> + <constant name="FEATURE_NATIVE_DIALOG_INPUT" value="24" enum="Feature"> + Display server supports spawning text input dialogs using the operating system's native look-and-feel. See [method dialog_input_text]. [b]Windows, macOS[/b] + </constant> + <constant name="FEATURE_NATIVE_DIALOG_FILE" value="25" enum="Feature"> + Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See [method file_dialog_show] and [method file_dialog_with_options_show]. [b]Windows, macOS, Linux (X11/Wayland)[/b] + </constant> <constant name="MOUSE_MODE_VISIBLE" value="0" enum="MouseMode"> Makes the mouse cursor visible if it is hidden. </constant> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index f446d5bb1f..9f0b86e877 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -448,6 +448,9 @@ The color to use for the TileMap editor's grid. [b]Note:[/b] Only effective if [member editors/tiles_editor/display_grid] is [code]true[/code]. </member> + <member name="editors/tiles_editor/highlight_selected_layer" type="bool" setter="" getter=""> + Highlight the currently selected TileMapLayer by dimming the other ones in the scene. + </member> <member name="editors/visual_editors/category_colors/color_color" type="Color" setter="" getter=""> The color of a graph node's header when it belongs to the "Color" category. </member> @@ -1031,6 +1034,12 @@ The number of pixels to scroll with every mouse wheel increment. Higher values make the script scroll by faster when using the mouse wheel. [b]Note:[/b] You can hold down [kbd]Alt[/kbd] while using the mouse wheel to temporarily scroll 5 times faster. </member> + <member name="text_editor/completion/add_node_path_literals" type="bool" setter="" getter=""> + If [code]true[/code], uses [NodePath] instead of [String] when appropriate for code autocompletion or for drag and dropping object properties into the script editor. + </member> + <member name="text_editor/completion/add_string_name_literals" type="bool" setter="" getter=""> + If [code]true[/code], uses [StringName] instead of [String] when appropriate for code autocompletion. + </member> <member name="text_editor/completion/add_type_hints" type="bool" setter="" getter=""> If [code]true[/code], adds [url=$DOCS_URL/tutorials/scripting/gdscript/static_typing.html]GDScript static typing[/url] hints such as [code]-> void[/code] and [code]: int[/code] when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the [kbd]Ctrl[/kbd] key. If [code]true[/code], newly created scripts will also automatically have type hints added to their method parameters and return types. </member> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 25b6a48283..b6007a3b6b 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -156,9 +156,9 @@ [/gdscript] [csharp] var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } }; - string queryString = new HTTPClient().QueryStringFromDict(fields); + string queryString = new HttpClient().QueryStringFromDict(fields); string[] headers = { "Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}" }; - var result = new HTTPClient().Request(HTTPClient.Method.Post, "index.php", headers, queryString); + var result = new HttpClient().Request(HttpClient.Method.Post, "index.php", headers, queryString); [/csharp] [/codeblocks] [b]Note:[/b] The [param body] parameter is ignored if [param method] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.uri_encode] for an example. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 03c1ce2e00..6efa675a71 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -43,7 +43,7 @@ public override void _Ready() { // Create an HTTP request node and connect its completion signal. - var httpRequest = new HTTPRequest(); + var httpRequest = new HttpRequest(); AddChild(httpRequest); httpRequest.RequestCompleted += HttpRequestCompleted; @@ -61,7 +61,7 @@ { { "name", "Godette" } }); - error = httpRequest.Request("https://httpbin.org/post", null, HTTPClient.Method.Post, body); + error = httpRequest.Request("https://httpbin.org/post", null, HttpClient.Method.Post, body); if (error != Error.Ok) { GD.PushError("An error occurred in the HTTP request."); @@ -115,7 +115,7 @@ public override void _Ready() { // Create an HTTP request node and connect its completion signal. - var httpRequest = new HTTPRequest(); + var httpRequest = new HttpRequest(); AddChild(httpRequest); httpRequest.RequestCompleted += HttpRequestCompleted; @@ -130,7 +130,7 @@ // Called when the HTTP request is completed. private void HttpRequestCompleted(long result, long responseCode, string[] headers, byte[] body) { - if (result != (long)HTTPRequest.Result.Success) + if (result != (long)HttpRequest.Result.Success) { GD.PushError("Image couldn't be downloaded. Try a different image."); } diff --git a/doc/classes/HeightMapShape3D.xml b/doc/classes/HeightMapShape3D.xml index ba79cbc89a..7e3055b34e 100644 --- a/doc/classes/HeightMapShape3D.xml +++ b/doc/classes/HeightMapShape3D.xml @@ -6,6 +6,19 @@ <description> A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D]. This is useful for terrain, but it is limited as overhangs (such as caves) cannot be stored. Holes in a [HeightMapShape3D] are created by assigning very low values to points in the desired area. [b]Performance:[/b] [HeightMapShape3D] is faster to check collisions against than [ConcavePolygonShape3D], but it is significantly slower than primitive shapes like [BoxShape3D]. + A heightmap collision shape can also be build by using an [Image] reference: + [codeblocks] + [gdscript] + var heightmap_texture: Texture = ResourceLoader.load("res://heightmap_image.exr") + var heightmap_image: Image = heightmap_texture.get_image() + heightmap_image.convert(Image.FORMAT_RF) + + var height_min: float = 0.0 + var height_max: float = 10.0 + + update_map_data_from_image(heightmap_image, height_min, height_max) + [/gdscript] + [/codeblocks] </description> <tutorials> </tutorials> @@ -22,6 +35,17 @@ Returns the smallest height value found in [member map_data]. Recalculates only when [member map_data] changes. </description> </method> + <method name="update_map_data_from_image"> + <return type="void" /> + <param index="0" name="image" type="Image" /> + <param index="1" name="height_min" type="float" /> + <param index="2" name="height_max" type="float" /> + <description> + Updates [member map_data] with data read from an [Image] reference. Automatically resizes heightmap [member map_width] and [member map_depth] to fit the full image width and height. + The image needs to be in either [constant Image.FORMAT_RF] (32 bit), [constant Image.FORMAT_RH] (16 bit), or [constant Image.FORMAT_R8] (8 bit). + Each image pixel is read in as a float on the range from [code]0.0[/code] (black pixel) to [code]1.0[/code] (white pixel). This range value gets remapped to [param height_min] and [param height_max] to form the final height value. + </description> + </method> </methods> <members> <member name="map_data" type="PackedFloat32Array" setter="set_map_data" getter="get_map_data" default="PackedFloat32Array(0, 0, 0, 0)"> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 391d060fc3..96a4612466 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -117,7 +117,12 @@ <members> <member name="device" type="int" setter="set_device" getter="get_device" default="0"> The event's device ID. - [b]Note:[/b] This device ID will always be [code]-1[/code] for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. + [b]Note:[/b] [member device] can be negative for special use cases that don't refer to devices physically present on the system. See [constant DEVICE_ID_EMULATION]. </member> </members> + <constants> + <constant name="DEVICE_ID_EMULATION" value="-1"> + Device ID used for emulated mouse input from a touchscreen, or for emulated touch input from a mouse. This can be used to distinguish emulated mouse input from physical mouse input, or emulated touch input from physical touch input. + </constant> + </constants> </class> diff --git a/doc/classes/InputEventMIDI.xml b/doc/classes/InputEventMIDI.xml index 0f0b756651..4dcaf98747 100644 --- a/doc/classes/InputEventMIDI.xml +++ b/doc/classes/InputEventMIDI.xml @@ -37,13 +37,13 @@ public override void _Input(InputEvent inputEvent) { - if (inputEvent is InputEventMIDI midiEvent) + if (inputEvent is InputEventMidi midiEvent) { PrintMIDIInfo(midiEvent); } } - private void PrintMIDIInfo(InputEventMIDI midiEvent) + private void PrintMIDIInfo(InputEventMidi midiEvent) { GD.Print(midiEvent); GD.Print($"Channel {midiEvent.Channel}"); diff --git a/doc/classes/NativeMenu.xml b/doc/classes/NativeMenu.xml index cc81c81a24..475874dee7 100644 --- a/doc/classes/NativeMenu.xml +++ b/doc/classes/NativeMenu.xml @@ -53,7 +53,7 @@ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_icon_check_item"> @@ -72,7 +72,7 @@ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_icon_item"> @@ -91,7 +91,7 @@ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_icon_radio_check_item"> @@ -111,7 +111,7 @@ [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_item"> @@ -129,7 +129,7 @@ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_multistate_item"> @@ -151,7 +151,7 @@ [b]Note:[/b] By default, there's no indication of the current item state, it should be changed manually. [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_radio_check_item"> @@ -170,7 +170,7 @@ [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag]. [b]Note:[/b] This method is implemented on macOS and Windows. - [b]Note:[/b] [param accelerator] and [param key_callback] are ignored on Windows. + [b]Note:[/b] On Windows, [param accelerator] and [param key_callback] are ignored. </description> </method> <method name="add_separator"> @@ -211,12 +211,21 @@ [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> + <method name="find_item_index_with_submenu" qualifiers="const"> + <return type="int" /> + <param index="0" name="rid" type="RID" /> + <param index="1" name="submenu_rid" type="RID" /> + <description> + Returns the index of the item with the submenu specified by [param submenu_rid]. Indices are automatically assigned to each item by the engine, and cannot be set manually. + [b]Note:[/b] This method is implemented on macOS and Windows. + </description> + </method> <method name="find_item_index_with_tag" qualifiers="const"> <return type="int" /> <param index="0" name="rid" type="RID" /> <param index="1" name="tag" type="Variant" /> <description> - Returns the index of the item with the specified [param tag]. Index is automatically assigned to each item by the engine. Index can not be set manually. + Returns the index of the item with the specified [param tag]. Indices are automatically assigned to each item by the engine, and cannot be set manually. [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> @@ -225,7 +234,7 @@ <param index="0" name="rid" type="RID" /> <param index="1" name="text" type="String" /> <description> - Returns the index of the item with the specified [param text]. Index is automatically assigned to each item by the engine. Index can not be set manually. + Returns the index of the item with the specified [param text]. Indices are automatically assigned to each item by the engine, and cannot be set manually. [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> @@ -496,7 +505,7 @@ <param index="0" name="rid" type="RID" /> <param index="1" name="is_rtl" type="bool" /> <description> - Sets the menu text layout directtion. + Sets the menu text layout direction from right-to-left if [param is_rtl] is [code]true[/code]. [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index b786b67933..ae6cd9596c 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -100,7 +100,7 @@ <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. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. + Called when an [InputEventKey], [InputEventShortcut], or [InputEventJoypadButton] hasn't been consumed by [method _input] or any GUI [Control] item. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_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 shortcuts. For generic GUI events, use [method _input] instead. Gameplay events should usually be handled with either [method _unhandled_input] or [method _unhandled_key_input]. @@ -187,7 +187,7 @@ <param index="0" name="message" type="String" /> <param index="1" name="context" type="StringName" default="""" /> <description> - Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. + Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. This method works the same as [method Object.tr], with the addition of respecting the [member auto_translate_mode] state. If [method Object.can_translate_messages] is [code]false[/code], or no translation is available, this method returns the [param message] without changes. See [method Object.set_message_translation]. For detailed examples, see [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. @@ -619,6 +619,21 @@ [method request_ready] resets it back to [code]false[/code]. </description> </method> + <method name="is_physics_interpolated" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if physics interpolation is enabled for this node (see [member physics_interpolation_mode]). + [b]Note:[/b] Interpolation will only be active if both the flag is set [b]and[/b] physics interpolation is enabled within the [SceneTree]. This can be tested using [method is_physics_interpolated_and_enabled]. + </description> + </method> + <method name="is_physics_interpolated_and_enabled" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if physics interpolation is enabled (see [member physics_interpolation_mode]) [b]and[/b] enabled in the [SceneTree]. + This is a convenience version of [method is_physics_interpolated] that also checks whether physics interpolation is enabled globally. + See [member SceneTree.physics_interpolation] and [member ProjectSettings.physics/common/physics_interpolation]. + </description> + </method> <method name="is_physics_processing" qualifiers="const"> <return type="bool" /> <description> @@ -780,8 +795,9 @@ <return type="void" /> <param index="0" name="node" type="Node" /> <param index="1" name="keep_groups" type="bool" default="false" /> + <param index="2" name="keep_children" type="bool" default="true" /> <description> - Replaces this node by the given [param node]. All children of this node are moved to [param node]. + Replaces this node by the given [param node]. If [param keep_children] is [code]true[/code] all children of this node are moved to [param node]. If [param keep_groups] is [code]true[/code], the [param node] is added to the same groups that the replaced node is in (see [method add_to_group]). [b]Warning:[/b] The replaced node is removed from the tree, but it is [b]not[/b] deleted. To prevent memory leaks, store a reference to the node in a variable, or use [method Object.free]. </description> @@ -793,6 +809,15 @@ [b]Note:[/b] This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of [method _ready] callbacks will be the same as normal. </description> </method> + <method name="reset_physics_interpolation"> + <return type="void" /> + <description> + When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick. + That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete. + The notification [constant NOTIFICATION_RESET_PHYSICS_INTERPOLATION] will be received by the node and all children recursively. + [b]Note:[/b] This function should be called [b]after[/b] moving the node, rather than before. + </description> + </method> <method name="rpc" qualifiers="vararg"> <return type="int" enum="Error" /> <param index="0" name="method" type="StringName" /> @@ -964,6 +989,10 @@ The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it. [b]Note:[/b] In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will [b]not[/b] be saved. To prevent this, remember to set the owner after calling [method add_child]. See also (see [member unique_name_in_owner]) </member> + <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" enum="Node.PhysicsInterpolationMode" default="0"> + Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting. + [b]Note:[/b] When teleporting a node to a distant position you should temporarily disable interpolation with [method Node.reset_physics_interpolation]. + </member> <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Node.ProcessMode" default="0"> The node's processing behavior (see [enum ProcessMode]). To check if the node can process in its current mode, use [method can_process]. </member> @@ -1122,6 +1151,9 @@ <constant name="NOTIFICATION_ENABLED" value="29"> Notification received when the node is enabled again after being disabled. See [constant PROCESS_MODE_DISABLED]. </constant> + <constant name="NOTIFICATION_RESET_PHYSICS_INTERPOLATION" value="2001"> + Notification received when [method reset_physics_interpolation] is called on the node or its ancestors. + </constant> <constant name="NOTIFICATION_EDITOR_PRE_SAVE" value="9001"> Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. </constant> @@ -1170,7 +1202,15 @@ Implemented only on iOS. </constant> <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="2010"> - Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. + Notification received when translations may have changed. Can be triggered by the user changing the locale, changing [member auto_translate_mode] or when the node enters the scene tree. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. + [b]Note:[/b] This notification is received alongside [constant NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup translations for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using [method is_node_ready]. + [codeblock] + func _notification(what): + if what == NOTIFICATION_TRANSLATION_CHANGED: + if not is_node_ready(): + await ready # Wait until ready signal. + $Label.text = atr("%d Bananas") % banana_counter + [/codeblock] </constant> <constant name="NOTIFICATION_WM_ABOUT" value="2011"> Notification received from the OS when a request for "About" information is sent. @@ -1237,6 +1277,15 @@ <constant name="FLAG_PROCESS_THREAD_MESSAGES_ALL" value="3" enum="ProcessThreadMessages" is_bitfield="true"> Allows this node to process threaded messages created with [method call_deferred_thread_group] right before either [method _process] or [method _physics_process] are called. </constant> + <constant name="PHYSICS_INTERPOLATION_MODE_INHERIT" value="0" enum="PhysicsInterpolationMode"> + Inherits [member physics_interpolation_mode] from the node's parent. This is the default for any newly created node. + </constant> + <constant name="PHYSICS_INTERPOLATION_MODE_ON" value="1" enum="PhysicsInterpolationMode"> + Enables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. This is the default for the root node. + </constant> + <constant name="PHYSICS_INTERPOLATION_MODE_OFF" value="2" enum="PhysicsInterpolationMode"> + Disables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. + </constant> <constant name="DUPLICATE_SIGNALS" value="1" enum="DuplicateFlags"> Duplicate the node's signal connections. </constant> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index be7394a30b..bd1bd9afa7 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -50,9 +50,9 @@ <param index="1" name="arguments" type="PackedStringArray" /> <param index="2" name="open_console" type="bool" default="false" /> <description> - Creates a new process that runs independently of Godot. It will not terminate when Godot terminates. The path specified in [param path] must exist and be executable file or macOS .app bundle. Platform path resolution will be used. The [param arguments] are used in the given order and separated by a space. + Creates a new process that runs independently of Godot. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS [code].app[/code] bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space. On Windows, if [param open_console] is [code]true[/code] and the process is a console app, a new terminal window will be opened. - If the process is successfully created, this method returns its process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). Otherwise this method returns [code]-1[/code]. + If the process is successfully created, this method returns its process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). Otherwise, this method returns [code]-1[/code]. For example, running another instance of the project: [codeblocks] [gdscript] @@ -63,7 +63,7 @@ [/csharp] [/codeblocks] See [method execute] if you wish to run an external command and retrieve the results. - [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Android, Linux, macOS, and Windows. [b]Note:[/b] On macOS, sandboxed applications are limited to run only embedded helper executables, specified during export or system .app bundle, system .app bundles will ignore arguments. </description> </method> @@ -120,7 +120,7 @@ OS.Execute("CMD.exe", new string[] {"/C", "cd %TEMP% && dir"}, output); [/csharp] [/codeblocks] - [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Android, Linux, macOS, and Windows. [b]Note:[/b] To execute a Windows command interpreter built-in command, specify [code]cmd.exe[/code] in [param path], [code]/c[/code] as the first argument, and the desired command as the second argument. [b]Note:[/b] To execute a PowerShell built-in command, specify [code]powershell.exe[/code] in [param path], [code]-Command[/code] as the first argument, and the desired command as the second argument. [b]Note:[/b] To execute a Unix shell built-in command, specify shell executable name in [param path], [code]-c[/code] as the first argument, and the desired command as the second argument. @@ -128,6 +128,23 @@ [b]Note:[/b] On Android, system commands such as [code]dumpsys[/code] can only be run on a rooted device. </description> </method> + <method name="execute_with_pipe"> + <return type="Dictionary" /> + <param index="0" name="path" type="String" /> + <param index="1" name="arguments" type="PackedStringArray" /> + <description> + Creates a new process that runs independently of Godot with redirected IO. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS [code].app[/code] bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space. + If the process cannot be created, this method returns an empty [Dictionary]. Otherwise, this method returns a [Dictionary] with the following keys: + - [code]"stdio"[/code] - [FileAccess] to access the process stdin and stdout pipes (read/write). + - [code]"stderr"[/code] - [FileAccess] to access the process stderr pipe (read only). + - [code]"pid"[/code] - Process ID as an [int], which you can use to monitor the process (and potentially terminate it with [method kill]). + [b]Note:[/b] This method is implemented on Android, Linux, macOS, and Windows. + [b]Note:[/b] To execute a Windows command interpreter built-in command, specify [code]cmd.exe[/code] in [param path], [code]/c[/code] as the first argument, and the desired command as the second argument. + [b]Note:[/b] To execute a PowerShell built-in command, specify [code]powershell.exe[/code] in [param path], [code]-Command[/code] as the first argument, and the desired command as the second argument. + [b]Note:[/b] To execute a Unix shell built-in command, specify shell executable name in [param path], [code]-c[/code] as the first argument, and the desired command as the second argument. + [b]Note:[/b] On macOS, sandboxed applications are limited to run only embedded helper executables, specified during export or system .app bundle, system .app bundles will ignore arguments. + </description> + </method> <method name="find_keycode_from_string" qualifiers="const"> <return type="int" enum="Key" /> <param index="0" name="string" type="String" /> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 85b9cf16f2..b69326b6e0 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -1024,7 +1024,7 @@ <param index="0" name="message" type="StringName" /> <param index="1" name="context" type="StringName" default="&""" /> <description> - Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. + Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. If [method can_translate_messages] is [code]false[/code], or no translation is available, this method returns the [param message] without changes. See [method set_message_translation]. For detailed examples, see [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. </description> diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml index 2627c8b7d3..494e9966ac 100644 --- a/doc/classes/PCKPacker.xml +++ b/doc/classes/PCKPacker.xml @@ -13,7 +13,7 @@ packer.flush() [/gdscript] [csharp] - var packer = new PCKPacker(); + var packer = new PckPacker(); packer.PckStart("test.pck"); packer.AddFile("res://text.txt", "text.txt"); packer.Flush(); diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 41457761fd..12d3178797 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -121,7 +121,7 @@ return [/gdscript] [csharp] - var socket = new PacketPeerUDP(); + var socket = new PacketPeerUdp(); // Server socket.SetDestAddress("127.0.0.1", 789); socket.PutPacket("Time to stop".ToAsciiBuffer()); diff --git a/doc/classes/Parallax2D.xml b/doc/classes/Parallax2D.xml index 6db29b7a33..472aeb0bd3 100644 --- a/doc/classes/Parallax2D.xml +++ b/doc/classes/Parallax2D.xml @@ -25,6 +25,7 @@ <member name="limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end" default="Vector2(1e+07, 1e+07)"> Bottom-right limits for scrolling to end. If the camera is outside of this limit, the [Parallax2D] will stop scrolling. Must be higher than [member limit_begin] and the viewport size combined to work. </member> + <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" /> <member name="repeat_size" type="Vector2" setter="set_repeat_size" getter="get_repeat_size" default="Vector2(0, 0)"> Repeats the [Texture2D] of each of this node's children and offsets them by this value. When scrolling, the node's position loops, giving the illusion of an infinite scrolling background if the values are larger than the screen size. If an axis is set to [code]0[/code], the [Texture2D] will not be repeated. </member> @@ -40,7 +41,7 @@ </member> <member name="scroll_scale" type="Vector2" setter="set_scroll_scale" getter="get_scroll_scale" default="Vector2(1, 1)"> Multiplier to the final [Parallax2D]'s offset. Can be used to simulate distance from the camera. - For example, a value of [code]1[/code] scrolls at the same speed as the camera. A value greater than [code]1[/code] scrolls faster, making objects appear closer. Less than [code]1[/code] scrolls slower, making object appear closer and a value of [code]0[/code] stops the objects completely. + For example, a value of [code]1[/code] scrolls at the same speed as the camera. A value greater than [code]1[/code] scrolls faster, making objects appear closer. Less than [code]1[/code] scrolls slower, making objects appear further, and a value of [code]0[/code] stops the objects completely. </member> </members> </class> diff --git a/doc/classes/ParallaxLayer.xml b/doc/classes/ParallaxLayer.xml index fb92c9d85f..12482d6f66 100644 --- a/doc/classes/ParallaxLayer.xml +++ b/doc/classes/ParallaxLayer.xml @@ -23,5 +23,6 @@ <member name="motion_scale" type="Vector2" setter="set_motion_scale" getter="get_motion_scale" default="Vector2(1, 1)"> Multiplies the ParallaxLayer's motion. If an axis is set to [code]0[/code], it will not scroll. </member> + <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" /> </members> </class> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 4735091f20..e40d73862b 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -740,7 +740,7 @@ <param index="1" name="axis" type="int" enum="Vector3.Axis" /> <param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" /> <description> - Gets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants). + Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. </description> </method> <method name="generic_6dof_joint_get_param" qualifiers="const"> @@ -749,7 +749,7 @@ <param index="1" name="axis" type="int" enum="Vector3.Axis" /> <param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" /> <description> - Gets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants). + Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. </description> </method> <method name="generic_6dof_joint_set_flag"> @@ -759,7 +759,7 @@ <param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" /> <param index="3" name="enable" type="bool" /> <description> - Sets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants). + Sets the value of a given generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. </description> </method> <method name="generic_6dof_joint_set_param"> @@ -769,7 +769,7 @@ <param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" /> <param index="3" name="value" type="float" /> <description> - Sets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants). + Sets the value of a given generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. </description> </method> <method name="get_process_info"> @@ -876,6 +876,7 @@ <param index="3" name="body_B" type="RID" /> <param index="4" name="local_ref_B" type="Transform3D" /> <description> + Make the joint a generic six degrees of freedom (6DOF) joint. Use [method generic_6dof_joint_set_flag] and [method generic_6dof_joint_set_param] to set the joint's flags and parameters respectively. </description> </method> <method name="joint_make_hinge"> @@ -1497,6 +1498,12 @@ <constant name="G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT" value="6" enum="G6DOFJointAxisParam"> The maximum force that the linear motor can apply while trying to reach the target velocity. </constant> + <constant name="G6DOF_JOINT_LINEAR_SPRING_STIFFNESS" value="7" enum="G6DOFJointAxisParam"> + </constant> + <constant name="G6DOF_JOINT_LINEAR_SPRING_DAMPING" value="8" enum="G6DOFJointAxisParam"> + </constant> + <constant name="G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT" value="9" enum="G6DOFJointAxisParam"> + </constant> <constant name="G6DOF_JOINT_ANGULAR_LOWER_LIMIT" value="10" enum="G6DOFJointAxisParam"> The minimum rotation in negative direction to break loose and rotate around the axes. </constant> @@ -1524,18 +1531,34 @@ <constant name="G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT" value="18" enum="G6DOFJointAxisParam"> Maximum acceleration for the motor at the axes. </constant> + <constant name="G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS" value="19" enum="G6DOFJointAxisParam"> + </constant> + <constant name="G6DOF_JOINT_ANGULAR_SPRING_DAMPING" value="20" enum="G6DOFJointAxisParam"> + </constant> + <constant name="G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT" value="21" enum="G6DOFJointAxisParam"> + </constant> + <constant name="G6DOF_JOINT_MAX" value="22" enum="G6DOFJointAxisParam"> + Represents the size of the [enum G6DOFJointAxisParam] enum. + </constant> <constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT" value="0" enum="G6DOFJointAxisFlag"> If set, linear motion is possible within the given limits. </constant> <constant name="G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT" value="1" enum="G6DOFJointAxisFlag"> If set, rotational motion is possible. </constant> + <constant name="G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING" value="2" enum="G6DOFJointAxisFlag"> + </constant> + <constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING" value="3" enum="G6DOFJointAxisFlag"> + </constant> <constant name="G6DOF_JOINT_FLAG_ENABLE_MOTOR" value="4" enum="G6DOFJointAxisFlag"> If set, there is a rotational motor across these axes. </constant> <constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="G6DOFJointAxisFlag"> If set, there is a linear motor on this axis that targets a specific velocity. </constant> + <constant name="G6DOF_JOINT_FLAG_MAX" value="6" enum="G6DOFJointAxisFlag"> + Represents the size of the [enum G6DOFJointAxisFlag] enum. + </constant> <constant name="SHAPE_WORLD_BOUNDARY" value="0" enum="ShapeType"> The [Shape3D] is a [WorldBoundaryShape3D]. </constant> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 407041289c..4d3e838bb1 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1334,6 +1334,12 @@ <member name="input/ui_text_select_word_under_caret.macos" type="Dictionary" setter="" getter=""> macOS specific override for the shortcut to select the word currently under the caret. </member> + <member name="input/ui_text_skip_selection_for_next_occurrence" type="Dictionary" setter="" getter=""> + If no selection is currently active with the last caret in text fields, searches for the next occurrence of the the word currently under the caret and moves the caret to the next occurrence. The action can be performed sequentially for other occurrences of the word under the last caret. + If a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret, selects the next occurrence then deselects the previous selection and its associated caret. The action can be performed sequentially for other occurrences of the selection of the last caret. + The viewport is adjusted to the latest newly added caret. + [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. + </member> <member name="input/ui_text_submit" type="Dictionary" setter="" getter=""> Default [InputEventAction] to submit a text field. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -2082,6 +2088,9 @@ <member name="navigation/baking/thread_model/baking_use_multiple_threads" type="bool" setter="" getter="" default="true"> If enabled the async navmesh baking uses multiple threads. </member> + <member name="navigation/baking/use_crash_prevention_checks" type="bool" setter="" getter="" default="true"> + If enabled, and baking would potentially lead to an engine crash, the baking will be interrupted and an error message with explanation will be raised. + </member> <member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768"> Maximum number of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. </member> @@ -2266,9 +2275,15 @@ Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics/common/physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member physics/common/max_physics_steps_per_frame] if you have increased [member physics/common/physics_ticks_per_second] significantly above its default value. [b]Note:[/b] This property is only read when the project starts. To change the maximum number of simulated physics steps per frame at runtime, set [member Engine.max_physics_steps_per_frame] instead. </member> + <member name="physics/common/physics_interpolation" type="bool" setter="" getter="" default="false"> + If [code]true[/code], the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames. See also [member Node.physics_interpolation_mode] and [method Node.reset_physics_interpolation]. + [b]Note:[/b] If [code]true[/code], the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code]. + [b]Note:[/b] This property is only read when the project starts. To toggle physics interpolation at runtime, set [member SceneTree.physics_interpolation] instead. + [b]Note:[/b] This feature is currently only implemented in the 2D renderer. + </member> <member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5"> Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. - [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0[/code]. + [b]Note:[/b] When using a physics interpolation solution (such as enabling [member physics/common/physics_interpolation] or using a custom solution), the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code]. [b]Note:[/b] This property is only read when the project starts. To change the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] instead. </member> <member name="physics/common/physics_ticks_per_second" type="int" setter="" getter="" default="60"> @@ -2628,6 +2643,9 @@ The [url=https://en.wikipedia.org/wiki/Bounding_volume_hierarchy]Bounding Volume Hierarchy[/url] quality to use when rendering the occlusion culling buffer. Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. See also [member rendering/occlusion_culling/occlusion_rays_per_thread]. [b]Note:[/b] This property is only read when the project starts. To adjust the BVH build quality at runtime, use [method RenderingServer.viewport_set_occlusion_culling_build_quality]. </member> + <member name="rendering/occlusion_culling/jitter_projection" type="bool" setter="" getter="" default="true"> + If [code]true[/code], the projection used for rendering the occlusion buffer will be jittered. This can help prevent objects being incorrectly culled when visible through small gaps. + </member> <member name="rendering/occlusion_culling/occlusion_rays_per_thread" type="int" setter="" getter="" default="512"> The number of occlusion rays traced per CPU thread. Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. The occlusion culling buffer's pixel count is roughly equal to [code]occlusion_rays_per_thread * number_of_logical_cpu_cores[/code], so it will depend on the system's CPU. Therefore, CPUs with fewer cores will use a lower resolution to attempt keeping performance costs even across devices. See also [member rendering/occlusion_culling/bvh_build_quality]. [b]Note:[/b] This property is only read when the project starts. To adjust the number of occlusion rays traced per thread at runtime, use [method RenderingServer.viewport_set_occlusion_rays_per_thread]. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 324e6d50b6..5efda5f83f 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -424,6 +424,14 @@ [b]Note:[/b] The equivalent node is [CanvasItem]. </description> </method> + <method name="canvas_item_reset_physics_interpolation"> + <return type="void" /> + <param index="0" name="item" type="RID" /> + <description> + Prevents physics interpolation for the current physics tick. + This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location. + </description> + </method> <method name="canvas_item_set_canvas_group_mode"> <return type="void" /> <param index="0" name="item" type="RID" /> @@ -504,6 +512,14 @@ Sets the index for the [CanvasItem]. </description> </method> + <method name="canvas_item_set_interpolated"> + <return type="void" /> + <param index="0" name="item" type="RID" /> + <param index="1" name="interpolated" type="bool" /> + <description> + If [param interpolated] is [code]true[/code], turns on physics interpolation for the canvas item. + </description> + </method> <method name="canvas_item_set_light_mask"> <return type="void" /> <param index="0" name="item" type="RID" /> @@ -612,6 +628,15 @@ Sets the [CanvasItem]'s Z index, i.e. its draw order (lower indexes are drawn first). </description> </method> + <method name="canvas_item_transform_physics_interpolation"> + <return type="void" /> + <param index="0" name="item" type="RID" /> + <param index="1" name="transform" type="Transform2D" /> + <description> + Transforms both the current and previous stored transform for a canvas item. + This allows transforming a canvas item without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilising a shifting origin. + </description> + </method> <method name="canvas_light_attach_to_canvas"> <return type="void" /> <param index="0" name="light" type="RID" /> @@ -644,6 +669,14 @@ [b]Note:[/b] The equivalent node is [LightOccluder2D]. </description> </method> + <method name="canvas_light_occluder_reset_physics_interpolation"> + <return type="void" /> + <param index="0" name="occluder" type="RID" /> + <description> + Prevents physics interpolation for the current physics tick. + This is useful when moving an occluder to a new location, to give an instantaneous change rather than interpolation from the previous location. + </description> + </method> <method name="canvas_light_occluder_set_as_sdf_collision"> <return type="void" /> <param index="0" name="occluder" type="RID" /> @@ -659,6 +692,14 @@ Enables or disables light occluder. </description> </method> + <method name="canvas_light_occluder_set_interpolated"> + <return type="void" /> + <param index="0" name="occluder" type="RID" /> + <param index="1" name="interpolated" type="bool" /> + <description> + If [param interpolated] is [code]true[/code], turns on physics interpolation for the light occluder. + </description> + </method> <method name="canvas_light_occluder_set_light_mask"> <return type="void" /> <param index="0" name="occluder" type="RID" /> @@ -683,6 +724,23 @@ Sets a light occluder's [Transform2D]. </description> </method> + <method name="canvas_light_occluder_transform_physics_interpolation"> + <return type="void" /> + <param index="0" name="occluder" type="RID" /> + <param index="1" name="transform" type="Transform2D" /> + <description> + Transforms both the current and previous stored transform for a light occluder. + This allows transforming an occluder without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilising a shifting origin. + </description> + </method> + <method name="canvas_light_reset_physics_interpolation"> + <return type="void" /> + <param index="0" name="light" type="RID" /> + <description> + Prevents physics interpolation for the current physics tick. + This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location. + </description> + </method> <method name="canvas_light_set_blend_mode"> <return type="void" /> <param index="0" name="light" type="RID" /> @@ -723,6 +781,14 @@ Sets a canvas light's height. </description> </method> + <method name="canvas_light_set_interpolated"> + <return type="void" /> + <param index="0" name="light" type="RID" /> + <param index="1" name="interpolated" type="bool" /> + <description> + If [param interpolated] is [code]true[/code], turns on physics interpolation for the canvas light. + </description> + </method> <method name="canvas_light_set_item_cull_mask"> <return type="void" /> <param index="0" name="light" type="RID" /> @@ -829,6 +895,15 @@ Sets the Z range of objects that will be affected by this light. Equivalent to [member Light2D.range_z_min] and [member Light2D.range_z_max]. </description> </method> + <method name="canvas_light_transform_physics_interpolation"> + <return type="void" /> + <param index="0" name="light" type="RID" /> + <param index="1" name="transform" type="Transform2D" /> + <description> + Transforms both the current and previous stored transform for a canvas light. + This allows transforming a light without creating a "glitch" in the interpolation, which is is particularly useful for large worlds utilising a shifting origin. + </description> + </method> <method name="canvas_occluder_polygon_create"> <return type="RID" /> <description> diff --git a/doc/classes/ResourceImporterScene.xml b/doc/classes/ResourceImporterScene.xml index 4e20fe150e..900e028b25 100644 --- a/doc/classes/ResourceImporterScene.xml +++ b/doc/classes/ResourceImporterScene.xml @@ -21,6 +21,9 @@ <member name="animation/import" type="bool" setter="" getter="" default="true"> If [code]true[/code], import animations from the 3D scene. </member> + <member name="animation/import_rest_as_RESET" type="bool" setter="" getter="" default="false"> + If [code]true[/code], adds an [Animation] named [code]RESET[/code], containing the [method Skeleton3D.get_bone_rest] from [Skeleton3D] nodes. This can be useful to extract an animation in the reference pose. + </member> <member name="animation/remove_immutable_tracks" type="bool" setter="" getter="" default="true"> If [code]true[/code], remove animation tracks that only contain default values. This can reduce output file size and memory usage with certain 3D scenes, depending on the contents of their animation tracks. </member> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index f1bb5a1cf6..bae5fe1205 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -264,6 +264,10 @@ - 2D and 3D physics will be stopped, as well as collision detection and related signals. - Depending on each node's [member Node.process_mode], their [method Node._process], [method Node._physics_process] and [method Node._input] callback methods may not called anymore. </member> + <member name="physics_interpolation" type="bool" setter="set_physics_interpolation_enabled" getter="is_physics_interpolation_enabled" default="false"> + If [code]true[/code], the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames. + The default value of this property is controlled by [member ProjectSettings.physics/common/physics_interpolation]. + </member> <member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true"> If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android). To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 17f953f48f..7592342602 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -112,7 +112,7 @@ <description> Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" and "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to], [method naturalcasecmp_to], and [method naturalnocasecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to], [method filecasecmp_to], and [method naturalcasecmp_to]. </description> </method> <method name="chr" qualifiers="static"> @@ -184,6 +184,22 @@ Returns a string with [param chars] characters erased starting from [param position]. If [param chars] goes beyond the string's length given the specified [param position], fewer characters will be erased from the returned string. Returns an empty string if either [param position] or [param chars] is negative. Returns the original string unmodified if [param chars] is [code]0[/code]. </description> </method> + <method name="filecasecmp_to" qualifiers="const"> + <return type="int" /> + <param index="0" name="to" type="String" /> + <description> + Like [method naturalcasecmp_to] but prioritises strings that begin with periods ([code].[/code]) and underscores ([code]_[/code]) before any other character. Useful when sorting folders or file names. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method filenocasecmp_to], [method naturalcasecmp_to], and [method casecmp_to]. + </description> + </method> + <method name="filenocasecmp_to" qualifiers="const"> + <return type="int" /> + <param index="0" name="to" type="String" /> + <description> + Like [method naturalnocasecmp_to] but prioritises strings that begin with periods ([code].[/code]) and underscores ([code]_[/code]) before any other character. Useful when sorting folders or file names. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method filecasecmp_to], [method naturalnocasecmp_to], and [method nocasecmp_to]. + </description> + </method> <method name="find" qualifiers="const"> <return type="int" /> <param index="0" name="what" type="String" /> @@ -586,7 +602,7 @@ Performs a [b]case-sensitive[/b], [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be [code]["1", "2", "3", ...][/code], not [code]["1", "10", "2", "3", ...][/code]. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalnocasecmp_to], [method nocasecmp_to], and [method casecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalnocasecmp_to], [method filecasecmp_to], and [method nocasecmp_to]. </description> </method> <method name="naturalnocasecmp_to" qualifiers="const"> @@ -596,7 +612,7 @@ Performs a [b]case-insensitive[/b], [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be [code]["1", "2", "3", ...][/code], not [code]["1", "10", "2", "3", ...][/code]. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalcasecmp_to], [method nocasecmp_to], and [method casecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalcasecmp_to], [method filenocasecmp_to], and [method casecmp_to]. </description> </method> <method name="nocasecmp_to" qualifiers="const"> @@ -605,7 +621,7 @@ <description> Performs a [b]case-insensitive[/b] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to], [method naturalcasecmp_to], and [method naturalnocasecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to], [method filenocasecmp_to], and [method naturalnocasecmp_to]. </description> </method> <method name="num" qualifiers="static"> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index 41763489f1..e837b65199 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -107,7 +107,7 @@ <description> Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" and "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to], [method naturalcasecmp_to], and [method naturalnocasecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to], [method filecasecmp_to], and [method naturalcasecmp_to]. </description> </method> <method name="contains" qualifiers="const"> @@ -168,6 +168,22 @@ Returns a string with [param chars] characters erased starting from [param position]. If [param chars] goes beyond the string's length given the specified [param position], fewer characters will be erased from the returned string. Returns an empty string if either [param position] or [param chars] is negative. Returns the original string unmodified if [param chars] is [code]0[/code]. </description> </method> + <method name="filecasecmp_to" qualifiers="const"> + <return type="int" /> + <param index="0" name="to" type="String" /> + <description> + Like [method naturalcasecmp_to] but prioritises strings that begin with periods ([code].[/code]) and underscores ([code]_[/code]) before any other character. Useful when sorting folders or file names. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method filenocasecmp_to], [method naturalcasecmp_to], and [method casecmp_to]. + </description> + </method> + <method name="filenocasecmp_to" qualifiers="const"> + <return type="int" /> + <param index="0" name="to" type="String" /> + <description> + Like [method naturalnocasecmp_to] but prioritises strings that begin with periods ([code].[/code]) and underscores ([code]_[/code]) before any other character. Useful when sorting folders or file names. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method filecasecmp_to], [method naturalnocasecmp_to], and [method nocasecmp_to]. + </description> + </method> <method name="find" qualifiers="const"> <return type="int" /> <param index="0" name="what" type="String" /> @@ -562,7 +578,7 @@ Performs a [b]case-sensitive[/b], [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be [code]["1", "2", "3", ...][/code], not [code]["1", "10", "2", "3", ...][/code]. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalnocasecmp_to], [method nocasecmp_to], and [method casecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalnocasecmp_to], [method filecasecmp_to], and [method nocasecmp_to]. </description> </method> <method name="naturalnocasecmp_to" qualifiers="const"> @@ -572,7 +588,7 @@ Performs a [b]case-insensitive[/b], [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be [code]["1", "2", "3", ...][/code], not [code]["1", "10", "2", "3", ...][/code]. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalcasecmp_to], [method nocasecmp_to], and [method casecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method naturalcasecmp_to], [method filenocasecmp_to], and [method casecmp_to]. </description> </method> <method name="nocasecmp_to" qualifiers="const"> @@ -581,7 +597,7 @@ <description> Performs a [b]case-insensitive[/b] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "Less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison. With different string lengths, returns [code]1[/code] if this string is longer than the [param to] string, or [code]-1[/code] if shorter. Note that the length of empty strings is [i]always[/i] [code]0[/code]. - To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to], [method naturalcasecmp_to], and [method naturalnocasecmp_to]. + To get a [bool] result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to], [method filenocasecmp_to], and [method naturalnocasecmp_to]. </description> </method> <method name="pad_decimals" qualifiers="const"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 04d05e7860..92b54eef21 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1070,6 +1070,12 @@ Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String[/code]. </description> </method> + <method name="skip_selection_for_next_occurrence"> + <return type="void" /> + <description> + Moves a selection and a caret for the next occurrence of the current selection. If there is no active selection, moves to the next occurrence of the word under caret. + </description> + </method> <method name="start_action"> <return type="void" /> <param index="0" name="action" type="int" enum="TextEdit.EditAction" /> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index c5b86f079e..91df90580c 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -93,7 +93,7 @@ <return type="int" /> <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <description> - Returns the tile's terrain bit for the given [param peering_bit] direction. + Returns the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit]. </description> </method> <method name="is_collision_polygon_one_way" qualifiers="const"> @@ -104,6 +104,13 @@ Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id]. </description> </method> + <method name="is_valid_terrain_peering_bit" qualifiers="const"> + <return type="bool" /> + <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> + <description> + Returns whether the given [param peering_bit] direction is valid for this tile. + </description> + </method> <method name="remove_collision_polygon"> <return type="void" /> <param index="0" name="layer_id" type="int" /> @@ -200,7 +207,7 @@ <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <param index="1" name="terrain" type="int" /> <description> - Sets the tile's terrain bit for the given [param peering_bit] direction. + Sets the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit]. </description> </method> </methods> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index fc19e1de49..bc8a1d7bf1 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TileMap" inherits="TileMapLayerGroup" keywords="gridmap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="TileMap" inherits="Node2D" deprecated="Use multiple [TileMapLayer] nodes instead." keywords="gridmap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Node for 2D tile-based maps. </brief_description> @@ -89,7 +89,8 @@ <param index="1" name="coords" type="Vector2i" /> <param index="2" name="use_proxies" type="bool" default="false" /> <description> - Returns the tile alternative ID of the cell on layer [param layer] at [param coords]. If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. + Returns the tile alternative ID of the cell on layer [param layer] at [param coords]. + If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. If [param layer] is negative, the layers are accessed from the last one. </description> </method> @@ -100,7 +101,7 @@ <param index="2" name="use_proxies" type="bool" default="false" /> <description> Returns the tile atlas coordinates ID of the cell on layer [param layer] at coordinates [param coords]. Returns [code]Vector2i(-1, -1)[/code] if the cell does not exist. - If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. + If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw atlas coordinate identifier. See [method TileSet.map_tile_proxy]. If [param layer] is negative, the layers are accessed from the last one. </description> </method> @@ -111,7 +112,7 @@ <param index="2" name="use_proxies" type="bool" default="false" /> <description> Returns the tile source ID of the cell on layer [param layer] at coordinates [param coords]. Returns [code]-1[/code] if the cell does not exist. - If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. + If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw source identifier. See [method TileSet.map_tile_proxy]. If [param layer] is negative, the layers are accessed from the last one. </description> </method> @@ -123,7 +124,6 @@ <description> Returns the [TileData] object associated with the given cell, or [code]null[/code] if the cell does not exist or is not a [TileSetAtlasSource]. If [param layer] is negative, the layers are accessed from the last one. - If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. [codeblock] func get_clicked_tile_power(): var clicked_cell = tile_map.local_to_map(tile_map.get_local_mouse_position()) @@ -133,6 +133,7 @@ else: return 0 [/codeblock] + If [param use_proxies] is [code]false[/code], ignores the [TileSet]'s tile proxies. See [method TileSet.map_tile_proxy]. </description> </method> <method name="get_coords_for_body_rid"> @@ -489,6 +490,9 @@ The quadrant size does not apply on Y-sorted layers, as tiles are be grouped by Y position instead in that case. [b]Note:[/b] As quadrants are created according to the map's coordinate system, the quadrant's "square shape" might not look like square in the TileMap's local coordinate system. </member> + <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> + The [TileSet] used by this [TileMap]. The textures, collisions, and additional behavior of all available tiles are stored here. + </member> </members> <signals> <signal name="changed"> diff --git a/doc/classes/TileMapLayer.xml b/doc/classes/TileMapLayer.xml new file mode 100644 index 0000000000..bc8e259599 --- /dev/null +++ b/doc/classes/TileMapLayer.xml @@ -0,0 +1,303 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="TileMapLayer" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Node for 2D tile-based maps. + </brief_description> + <description> + Node for 2D tile-based maps. A [TileMapLayer] uses a [TileSet] which contain a list of tiles which are used to create grid-based maps. Unlike the [TileMap] node, which is deprecated, [TileMapLayer] has only one layer of tiles. You can use several [TileMapLayer] to achieve the same result as a [TileMap] node. + For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent. This is only queued when inside the scene tree. + To force an update earlier on, call [method update_internals]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="_tile_data_runtime_update" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="coords" type="Vector2i" /> + <param index="1" name="tile_data" type="TileData" /> + <description> + Called with a [TileData] object about to be used internally by the [TileMapLayer], allowing its modification at runtime. + This method is only called if [method _use_tile_data_runtime_update] is implemented and returns [code]true[/code] for the given tile [param coords]. + [b]Warning:[/b] The [param tile_data] object's sub-resources are the same as the one in the TileSet. Modifying them might impact the whole TileSet. Instead, make sure to duplicate those resources. + [b]Note:[/b] If the properties of [param tile_data] object should change over time, use [method notify_runtime_tile_data_update] to notify the [TileMapLayer] it needs an update. + </description> + </method> + <method name="_use_tile_data_runtime_update" qualifiers="virtual"> + <return type="bool" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Should return [code]true[/code] if the tile at coordinates [param coords] requires a runtime update. + [b]Warning:[/b] Make sure this function only returns [code]true[/code] when needed. Any tile processed at runtime without a need for it will imply a significant performance penalty. + [b]Note:[/b] If the result of this function should change, use [method notify_runtime_tile_data_update] to notify the [TileMapLayer] it needs an update. + </description> + </method> + <method name="clear"> + <return type="void" /> + <description> + Clears all cells. + </description> + </method> + <method name="erase_cell"> + <return type="void" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Erases the cell at coordinates [param coords]. + </description> + </method> + <method name="fix_invalid_tiles"> + <return type="void" /> + <description> + Clears cells containing tiles that do not exist in the [member tile_set]. + </description> + </method> + <method name="get_cell_alternative_tile" qualifiers="const"> + <return type="int" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile alternative ID of the cell at coordinates [param coords]. + </description> + </method> + <method name="get_cell_atlas_coords" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile atlas coordinates ID of the cell at coordinates [param coords]. Returns [code]Vector2i(-1, -1)[/code] if the cell does not exist. + </description> + </method> + <method name="get_cell_source_id" qualifiers="const"> + <return type="int" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile source ID of the cell at coordinates [param coords]. Returns [code]-1[/code] if the cell does not exist. + </description> + </method> + <method name="get_cell_tile_data" qualifiers="const"> + <return type="TileData" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Returns the [TileData] object associated with the given cell, or [code]null[/code] if the cell does not exist or is not a [TileSetAtlasSource]. + [codeblock] + func get_clicked_tile_power(): + var clicked_cell = tile_map_layer.local_to_map(tile_map_layer.get_local_mouse_position()) + var data = tile_map_layer.get_cell_tile_data(clicked_cell) + if data: + return data.get_custom_data("power") + else: + return 0 + [/codeblock] + </description> + </method> + <method name="get_coords_for_body_rid" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="body" type="RID" /> + <description> + Returns the coordinates of the tile for given physics body [RID]. Such an [RID] can be retrieved from [method KinematicCollision2D.get_collider_rid], when colliding with a tile. + </description> + </method> + <method name="get_navigation_map" qualifiers="const"> + <return type="RID" /> + <description> + Returns the [RID] of the [NavigationServer2D] navigation used by this [TileMapLayer]. + By default this returns the default [World2D] navigation map, unless a custom map was provided using [method set_navigation_map]. + </description> + </method> + <method name="get_neighbor_cell" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="coords" type="Vector2i" /> + <param index="1" name="neighbor" type="int" enum="TileSet.CellNeighbor" /> + <description> + Returns the neighboring cell to the one at coordinates [param coords], identified by the [param neighbor] direction. This method takes into account the different layouts a TileMap can take. + </description> + </method> + <method name="get_pattern"> + <return type="TileMapPattern" /> + <param index="0" name="coords_array" type="Vector2i[]" /> + <description> + Creates and returns a new [TileMapPattern] from the given array of cells. See also [method set_pattern]. + </description> + </method> + <method name="get_surrounding_cells"> + <return type="Vector2i[]" /> + <param index="0" name="coords" type="Vector2i" /> + <description> + Returns the list of all neighboring cells to the one at [param coords]. + </description> + </method> + <method name="get_used_cells" qualifiers="const"> + <return type="Vector2i[]" /> + <description> + Returns a [Vector2i] array with the positions of all cells containing a tile. A cell is considered empty if its source identifier equals [code]-1[/code], its atlas coordinate identifier is [code]Vector2(-1, -1)[/code] and its alternative identifier is [code]-1[/code]. + </description> + </method> + <method name="get_used_cells_by_id" qualifiers="const"> + <return type="Vector2i[]" /> + <param index="0" name="source_id" type="int" default="-1" /> + <param index="1" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> + <param index="2" name="alternative_tile" type="int" default="-1" /> + <description> + Returns a [Vector2i] array with the positions of all cells containing a tile. Tiles may be filtered according to their source ([param source_id]), their atlas coordinates ([param atlas_coords]), or alternative id ([param alternative_tile]). + If a parameter has its value set to the default one, this parameter is not used to filter a cell. Thus, if all parameters have their respective default values, this method returns the same result as [method get_used_cells]. + A cell is considered empty if its source identifier equals [code]-1[/code], its atlas coordinate identifier is [code]Vector2(-1, -1)[/code] and its alternative identifier is [code]-1[/code]. + </description> + </method> + <method name="get_used_rect" qualifiers="const"> + <return type="Rect2i" /> + <description> + Returns a rectangle enclosing the used (non-empty) tiles of the map. + </description> + </method> + <method name="has_body_rid" qualifiers="const"> + <return type="bool" /> + <param index="0" name="body" type="RID" /> + <description> + Returns whether the provided [param body] [RID] belongs to one of this [TileMapLayer]'s cells. + </description> + </method> + <method name="local_to_map" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="local_position" type="Vector2" /> + <description> + Returns the map coordinates of the cell containing the given [param local_position]. If [param local_position] is in global coordinates, consider using [method Node2D.to_local] before passing it to this method. See also [method map_to_local]. + </description> + </method> + <method name="map_pattern"> + <return type="Vector2i" /> + <param index="0" name="position_in_tilemap" type="Vector2i" /> + <param index="1" name="coords_in_pattern" type="Vector2i" /> + <param index="2" name="pattern" type="TileMapPattern" /> + <description> + Returns for the given coordinates [param coords_in_pattern] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [param position_in_tilemap] coordinates (see [method set_pattern]). This mapping is required as in half-offset tile shapes, the mapping might not work by calculating [code]position_in_tile_map + coords_in_pattern[/code]. + </description> + </method> + <method name="map_to_local" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="map_position" type="Vector2i" /> + <description> + Returns the centered position of a cell in the [TileMapLayer]'s local coordinate space. To convert the returned value into global coordinates, use [method Node2D.to_global]. See also [method local_to_map]. + [b]Note:[/b] This may not correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_origin] property of individual tiles. + </description> + </method> + <method name="notify_runtime_tile_data_update"> + <return type="void" /> + <description> + Notifies the [TileMapLayer] node that calls to [method _use_tile_data_runtime_update] or [method _tile_data_runtime_update] will lead to different results. This will thus trigger a [TileMapLayer] update. + [b]Warning:[/b] Updating the [TileMapLayer] is computationally expensive and may impact performance. Try to limit the number of calls to this function to avoid unnecessary update. + [b]Note:[/b] This does not trigger a direct update of the [TileMapLayer], the update will be done at the end of the frame as usual (unless you call [method update_internals]). + </description> + </method> + <method name="set_cell"> + <return type="void" /> + <param index="0" name="coords" type="Vector2i" /> + <param index="1" name="source_id" type="int" default="-1" /> + <param index="2" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> + <param index="3" name="alternative_tile" type="int" default="0" /> + <description> + Sets the tile identifiers for the cell at coordinates [param coords]. Each tile of the [TileSet] is identified using three parts: + - The source identifier [param source_id] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id], + - The atlas coordinate identifier [param atlas_coords] identifies a tile coordinates in the atlas (if the source is a [TileSetAtlasSource]). For [TileSetScenesCollectionSource] it should always be [code]Vector2i(0, 0)[/code], + - The alternative tile identifier [param alternative_tile] identifies a tile alternative in the atlas (if the source is a [TileSetAtlasSource]), and the scene for a [TileSetScenesCollectionSource]. + If [param source_id] is set to [code]-1[/code], [param atlas_coords] to [code]Vector2i(-1, -1)[/code], or [param alternative_tile] to [code]-1[/code], the cell will be erased. An erased cell gets [b]all[/b] its identifiers automatically set to their respective invalid values, namely [code]-1[/code], [code]Vector2i(-1, -1)[/code] and [code]-1[/code]. + </description> + </method> + <method name="set_cells_terrain_connect"> + <return type="void" /> + <param index="0" name="cells" type="Vector2i[]" /> + <param index="1" name="terrain_set" type="int" /> + <param index="2" name="terrain" type="int" /> + <param index="3" name="ignore_empty_terrains" type="bool" default="true" /> + <description> + Update all the cells in the [param cells] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions. + If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. + [b]Note:[/b] To work correctly, this method requires the [TileMapLayer]'s TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. + </description> + </method> + <method name="set_cells_terrain_path"> + <return type="void" /> + <param index="0" name="path" type="Vector2i[]" /> + <param index="1" name="terrain_set" type="int" /> + <param index="2" name="terrain" type="int" /> + <param index="3" name="ignore_empty_terrains" type="bool" default="true" /> + <description> + Update all the cells in the [param path] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions. + If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. + [b]Note:[/b] To work correctly, this method requires the [TileMapLayer]'s TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. + </description> + </method> + <method name="set_navigation_map"> + <return type="void" /> + <param index="0" name="map" type="RID" /> + <description> + Sets a custom [param map] as a [NavigationServer2D] navigation map. If not set, uses the default [World2D] navigation map instead. + </description> + </method> + <method name="set_pattern"> + <return type="void" /> + <param index="0" name="position" type="Vector2i" /> + <param index="1" name="pattern" type="TileMapPattern" /> + <description> + Pastes the [TileMapPattern] at the given [param position] in the tile map. See also [method get_pattern]. + </description> + </method> + <method name="update_internals"> + <return type="void" /> + <description> + Triggers a direct update of the [TileMapLayer]. Usually, calling this function is not needed, as [TileMapLayer] node updates automatically when one of its properties or cells is modified. + However, for performance reasons, those updates are batched and delayed to the end of the frame. Calling this function will force the [TileMapLayer] to update right away instead. + [b]Warning:[/b] Updating the [TileMapLayer] is computationally expensive and may impact performance. Try to limit the number of updates and how many tiles they impact. + </description> + </method> + </methods> + <members> + <member name="collision_enabled" type="bool" setter="set_collision_enabled" getter="is_collision_enabled" default="true"> + Enable or disable collisions. + </member> + <member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMapLayer.DebugVisibilityMode" default="0"> + Show or hide the [TileMapLayer]'s collision shapes. If set to [constant DEBUG_VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings. + </member> + <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> + If [code]false[/code], disables this [TileMapLayer] completely (rendering, collision, navigation, scene tiles, etc.) + </member> + <member name="navigation_enabled" type="bool" setter="set_navigation_enabled" getter="is_navigation_enabled" default="true"> + If [code]true[/code], navigation regions are enabled. + </member> + <member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMapLayer.DebugVisibilityMode" default="0"> + Show or hide the [TileMapLayer]'s navigation meshes. If set to [constant DEBUG_VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings. + </member> + <member name="rendering_quadrant_size" type="int" setter="set_rendering_quadrant_size" getter="get_rendering_quadrant_size" default="16"> + The [TileMapLayer]'s quadrant size. A quadrant is a group of tiles to be drawn together on a single canvas item, for optimization purposes. [member rendering_quadrant_size] defines the length of a square's side, in the map's coordinate system, that forms the quadrant. Thus, the default quandrant size groups together [code]16 * 16 = 256[/code] tiles. + The quadrant size does not apply on a Y-sorted [TileMapLayer], as tiles are be grouped by Y position instead in that case. + [b]Note:[/b] As quadrants are created according to the map's coordinate system, the quadrant's "square shape" might not look like square in the [TileMapLayer]'s local coordinate system. + </member> + <member name="tile_map_data" type="PackedByteArray" setter="set_tile_map_data_from_array" getter="get_tile_map_data_as_array" default="PackedByteArray(0, 0)"> + The raw tile map data as a byte array. + </member> + <member name="tile_set" type="TileSet" setter="set_tile_set" getter="get_tile_set"> + The [TileSet] used by this layer. The textures, collisions, and additional behavior of all available tiles are stored here. + </member> + <member name="use_kinematic_bodies" type="bool" setter="set_use_kinematic_bodies" getter="is_using_kinematic_bodies" default="false"> + If [code]true[/code], this [TileMapLayer] collision shapes will be instantiated as kinematic bodies. This can be needed for moving [TileMapLayer] nodes (i.e. moving platforms). + </member> + <member name="y_sort_origin" type="int" setter="set_y_sort_origin" getter="get_y_sort_origin" default="0"> + This Y-sort origin value is added to each tile's Y-sort origin value. This allows, for example, to fake a different height level. This can be useful for top-down view games. + </member> + </members> + <signals> + <signal name="changed"> + <description> + Emitted when this [TileMapLayer]'s properties changes. This includes modified cells, properties, or changes made to its assigned [TileSet]. + [b]Note:[/b] This signal may be emitted very often when batch-modifying a [TileMapLayer]. Avoid executing complex processing in a connected function, and consider delaying it to the end of the frame instead (i.e. calling [method Object.call_deferred]). + </description> + </signal> + </signals> + <constants> + <constant name="DEBUG_VISIBILITY_MODE_DEFAULT" value="0" enum="DebugVisibilityMode"> + Hide the collisions or navigation debug shapes in the editor, and use the debug settings to determine their visibility in game (i.e. [member SceneTree.debug_collisions_hint] or [member SceneTree.debug_navigation_hint]). + </constant> + <constant name="DEBUG_VISIBILITY_MODE_FORCE_HIDE" value="2" enum="DebugVisibilityMode"> + Always hide the collisions or navigation debug shapes. + </constant> + <constant name="DEBUG_VISIBILITY_MODE_FORCE_SHOW" value="1" enum="DebugVisibilityMode"> + Always show the collisions or navigation debug shapes. + </constant> + </constants> +</class> diff --git a/doc/classes/TileMapLayerGroup.xml b/doc/classes/TileMapLayerGroup.xml deleted file mode 100644 index 3787d3bb17..0000000000 --- a/doc/classes/TileMapLayerGroup.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="TileMapLayerGroup" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - Groups a set of tile map layers together, allowing them to share a provided [TileSet]. - </brief_description> - <description> - Groups together tile map layers as part or the same map, replacing the [TileMap] node. Child layers will use this node's [member tile_set]. - The editor also uses [TileMapLayerGroup] as a way to store which layers are selected in a given group. This allows highlighting the currently selected layers. - </description> - <tutorials> - </tutorials> - <members> - <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> - The assigned [TileSet]. This TileSet will be applied to all child layers. - </member> - </members> -</class> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 13d84d96d6..dcc817427b 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -497,10 +497,16 @@ Represents the size of the [enum RenderInfo] enum. </constant> <constant name="RENDER_INFO_TYPE_VISIBLE" value="0" enum="RenderInfoType"> + Visible render pass (excluding shadows). </constant> <constant name="RENDER_INFO_TYPE_SHADOW" value="1" enum="RenderInfoType"> + Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits. </constant> - <constant name="RENDER_INFO_TYPE_MAX" value="2" enum="RenderInfoType"> + <constant name="RENDER_INFO_TYPE_CANVAS" value="2" enum="RenderInfoType"> + Canvas item rendering. This includes all 2D rendering. + </constant> + <constant name="RENDER_INFO_TYPE_MAX" value="3" enum="RenderInfoType"> + Represents the size of the [enum RenderInfoType] enum. </constant> <constant name="DEBUG_DRAW_DISABLED" value="0" enum="DebugDraw"> Objects are displayed normally. |