diff options
Diffstat (limited to 'doc/classes')
236 files changed, 2429 insertions, 825 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 3a1bd83c18..bcab80ea94 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -368,7 +368,7 @@ <param index="1" name="curve" type="float" /> <description> Returns an "eased" value of [param x] based on an easing function defined with [param curve]. This easing function is based on an exponent. The [param curve] can be any floating-point number, with specific values leading to the following behaviors: - [codeblock] + [codeblock lang=text] - Lower than -1.0 (exclusive): Ease in-out - 1.0: Linear - Between -1.0 and 0.0 (exclusive): Ease out-in @@ -460,8 +460,8 @@ var x = i * 0.5 - 1.5 print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) [/codeblock] - Produces: - [codeblock] + Prints: + [codeblock lang=text] (x) (fmod(x, 1.5)) (fposmod(x, 1.5)) -1.5 -0.0 | 0.0 -1.0 -1.0 | 0.5 @@ -604,7 +604,7 @@ is_same(arr_a, arr_b) # false [/codeblock] These are [Variant] value types: [code]null[/code], [bool], [int], [float], [String], [StringName], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], [Vector4i], [Rect2], [Rect2i], [Transform2D], [Transform3D], [Plane], [Quaternion], [AABB], [Basis], [Projection], [Color], [NodePath], [RID], [Callable] and [Signal]. - These are [Variant] reference types: [Object], [Dictionary], [Array], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], [PackedFloat32Array], [PackedFloat64Array], [PackedStringArray], [PackedVector2Array], [PackedVector3Array] and [PackedColorArray]. + These are [Variant] reference types: [Object], [Dictionary], [Array], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], [PackedFloat32Array], [PackedFloat64Array], [PackedStringArray], [PackedVector2Array], [PackedVector3Array], [PackedVector4Array], and [PackedColorArray]. </description> </method> <method name="is_zero_approx"> @@ -696,6 +696,7 @@ [codeblock] max(1, 7, 3, -6, 5) # Returns 7 [/codeblock] + [b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise maximum, and will pick the largest value when compared using [code]x < y[/code]. To perform component-wise maximum, use [method Vector2.max], [method Vector2i.max], [method Vector3.max], [method Vector3i.max], [method Vector4.max], and [method Vector4i.max]. </description> </method> <method name="maxf"> @@ -729,6 +730,7 @@ [codeblock] min(1, 7, 3, -6, 5) # Returns -6 [/codeblock] + [b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise minimum, and will pick the smallest value when compared using [code]x < y[/code]. To perform component-wise minimum, use [method Vector2.min], [method Vector2i.min], [method Vector3.min], [method Vector3i.min], [method Vector4.min], and [method Vector4i.min]. </description> </method> <method name="minf"> @@ -818,8 +820,8 @@ for i in range(-3, 4): print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)]) [/codeblock] - Produces: - [codeblock] + Prints: + [codeblock lang=text] (i) (i % 3) (posmod(i, 3)) -3 0 | 0 -2 -2 | 1 @@ -901,6 +903,7 @@ <method name="printraw" qualifiers="vararg"> <description> Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike [method print], no newline is automatically added at the end. + [b]Note:[/b] The OS terminal is [i]not[/i] the same as the editor's Output dock. The output sent to the OS terminal can be seen when running Godot from a terminal. On Windows, this requires using the [code]console.exe[/code] executable. [codeblocks] [gdscript] printraw("A") @@ -1094,6 +1097,7 @@ remap(75, 0, 100, -1, 1) # Returns 0.5 [/codeblock] For complex use cases where multiple ranges are needed, consider using [Curve] or [Gradient] instead. + [b]Note:[/b] If [code]istart == istop[/code], the return value is undefined (most likely NaN, INF, or -INF). </description> </method> <method name="rid_allocate_id"> @@ -1457,7 +1461,7 @@ [/csharp] [/codeblocks] Prints: - [codeblock] + [codeblock lang=text] { "a": 1, "b": 2 @@ -1567,9 +1571,6 @@ <member name="Geometry3D" type="Geometry3D" setter="" getter=""> The [Geometry3D] singleton. </member> - <member name="GodotSharp" type="GodotSharp" setter="" getter=""> - The [GodotSharp] singleton. - </member> <member name="IP" type="IP" setter="" getter=""> The [IP] singleton. </member> @@ -3166,7 +3167,10 @@ <constant name="TYPE_PACKED_COLOR_ARRAY" value="37" enum="Variant.Type"> Variable is of type [PackedColorArray]. </constant> - <constant name="TYPE_MAX" value="38" enum="Variant.Type"> + <constant name="TYPE_PACKED_VECTOR4_ARRAY" value="38" enum="Variant.Type"> + Variable is of type [PackedVector4Array]. + </constant> + <constant name="TYPE_MAX" value="39" enum="Variant.Type"> Represents the size of the [enum Variant.Type] enum. </constant> <constant name="OP_EQUAL" value="0" enum="Variant.Operator"> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 7fbdd4272d..392364425b 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -100,6 +100,12 @@ </signal> </signals> <theme_items> + <theme_item name="buttons_min_height" data_type="constant" type="int" default="0"> + The minimum height of each button in the bottom row (such as OK/Cancel) in pixels. This can be increased to make buttons with short texts easier to click/tap. + </theme_item> + <theme_item name="buttons_min_width" data_type="constant" type="int" default="0"> + The minimum width of each button in the bottom row (such as OK/Cancel) in pixels. This can be increased to make buttons with short texts easier to click/tap. + </theme_item> <theme_item name="buttons_separation" data_type="constant" type="int" default="10"> The size of the vertical space between the dialog's content and the button row. </theme_item> diff --git a/doc/classes/AnimatableBody3D.xml b/doc/classes/AnimatableBody3D.xml index f5c6217477..f888ca1416 100644 --- a/doc/classes/AnimatableBody3D.xml +++ b/doc/classes/AnimatableBody3D.xml @@ -8,9 +8,9 @@ When [AnimatableBody3D] is moved, its linear and angular velocity are estimated and used to affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other moving objects. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="true"> diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index 4b38773505..012ae4fe29 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -8,7 +8,7 @@ </description> <tutorials> <link title="2D Sprite animation">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_playing_speed" qualifiers="const"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index b00889f483..26ed881502 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -595,6 +595,9 @@ </method> </methods> <members> + <member name="capture_included" type="bool" setter="_set_capture_included" getter="is_capture_included" default="false"> + Returns [code]true[/code] if the capture track is included. This is a cached readonly value for performance. + </member> <member name="length" type="float" setter="set_length" getter="get_length" default="1.0"> The total length of the animation (in seconds). [b]Note:[/b] Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. @@ -602,7 +605,7 @@ <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="Animation.LoopMode" default="0"> Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. </member> - <member name="step" type="float" setter="set_step" getter="get_step" default="0.1"> + <member name="step" type="float" setter="set_step" getter="get_step" default="0.0333333"> The animation step value. </member> </members> @@ -658,7 +661,7 @@ Update at the keyframes. </constant> <constant name="UPDATE_CAPTURE" value="2" enum="UpdateMode"> - Same as [constant UPDATE_CONTINUOUS] but works as a flag to capture the value of the current object and perform interpolation in some methods. See also [method AnimationMixer.capture] and [method AnimationPlayer.play_with_capture]. + Same as [constant UPDATE_CONTINUOUS] but works as a flag to capture the value of the current object and perform interpolation in some methods. See also [method AnimationMixer.capture], [member AnimationPlayer.playback_auto_capture], and [method AnimationPlayer.play_with_capture]. </constant> <constant name="LOOP_NONE" value="0" enum="LoopMode"> At both ends of the animation, the animation will stop playing. diff --git a/doc/classes/AnimationMixer.xml b/doc/classes/AnimationMixer.xml index a77e9e28c6..c635eba2ab 100644 --- a/doc/classes/AnimationMixer.xml +++ b/doc/classes/AnimationMixer.xml @@ -273,7 +273,7 @@ The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers. For example, if this value is [code]32[/code] and the animation has two audio tracks, the two [AudioStreamPlayer]s assigned can play simultaneously up to [code]32[/code] voices each. </member> - <member name="callback_mode_discrete" type="int" setter="set_callback_mode_discrete" getter="get_callback_mode_discrete" enum="AnimationMixer.AnimationCallbackModeDiscrete" default="0"> + <member name="callback_mode_discrete" type="int" setter="set_callback_mode_discrete" getter="get_callback_mode_discrete" enum="AnimationMixer.AnimationCallbackModeDiscrete" default="1"> Ordinarily, tracks can be set to [constant Animation.UPDATE_DISCRETE] to update infrequently, usually when using nearest interpolation. However, when blending with [constant Animation.UPDATE_CONTINUOUS] several results are considered. The [member callback_mode_discrete] specify it explicitly. See also [enum AnimationCallbackModeDiscrete]. To make the blended results look good, it is recommended to set this to [constant ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS] to update every frame during blending. Other values exist for compatibility and they are fine if there is no blending, but not so, may produce artifacts. @@ -361,14 +361,14 @@ Make method calls immediately when reached in the animation. </constant> <constant name="ANIMATION_CALLBACK_MODE_DISCRETE_DOMINANT" value="0" enum="AnimationCallbackModeDiscrete"> - An [constant Animation.UPDATE_DISCRETE] track value takes precedence when blending [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track values and [constant Animation.UPDATE_DISCRETE] track values. This is the default behavior for [AnimationPlayer]. - [b]Note:[/b] If a value track has non-numeric type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_DOMINANT] with [constant Animation.UPDATE_DISCRETE]. + An [constant Animation.UPDATE_DISCRETE] track value takes precedence when blending [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track values and [constant Animation.UPDATE_DISCRETE] track values. </constant> <constant name="ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE" value="1" enum="AnimationCallbackModeDiscrete"> - An [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track value takes precedence when blending the [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track values and the [constant Animation.UPDATE_DISCRETE] track values. + An [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track value takes precedence when blending the [constant Animation.UPDATE_CONTINUOUS] or [constant Animation.UPDATE_CAPTURE] track values and the [constant Animation.UPDATE_DISCRETE] track values. This is the default behavior for [AnimationPlayer]. </constant> <constant name="ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS" value="2" enum="AnimationCallbackModeDiscrete"> Always treat the [constant Animation.UPDATE_DISCRETE] track value as [constant Animation.UPDATE_CONTINUOUS] with [constant Animation.INTERPOLATION_NEAREST]. This is the default behavior for [AnimationTree]. + If a value track has non-numeric type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE] with [constant Animation.UPDATE_DISCRETE]. </constant> </constants> </class> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 960bbe68ad..4e093cb887 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -7,7 +7,7 @@ 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]. + [b]Note:[/b] If multiple 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] diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml index 12f00849cc..edd733ad34 100644 --- a/doc/classes/AnimationNodeAdd3.xml +++ b/doc/classes/AnimationNodeAdd3.xml @@ -13,6 +13,6 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> </class> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index 5683371182..0c85e8e670 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -8,8 +8,8 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <members> <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&"""> diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml index 61df0b26b3..50d785fee7 100644 --- a/doc/classes/AnimationNodeBlend2.xml +++ b/doc/classes/AnimationNodeBlend2.xml @@ -9,7 +9,7 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> </class> diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index 47933a1fd0..596767599c 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -10,7 +10,7 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="add_blend_point"> diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index 6ff2d6f6db..b2a8002d74 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -53,7 +53,7 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <members> <member name="autorestart" type="bool" setter="set_autorestart" getter="has_autorestart" default="false"> diff --git a/doc/classes/AnimationNodeOutput.xml b/doc/classes/AnimationNodeOutput.xml index f957650294..6186fdd8e1 100644 --- a/doc/classes/AnimationNodeOutput.xml +++ b/doc/classes/AnimationNodeOutput.xml @@ -8,7 +8,7 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> </class> diff --git a/doc/classes/AnimationNodeSync.xml b/doc/classes/AnimationNodeSync.xml index e9e1519672..57c79378c0 100644 --- a/doc/classes/AnimationNodeSync.xml +++ b/doc/classes/AnimationNodeSync.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationNodeSync" inherits="AnimationNode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Base class for [AnimationNode]s with more than two input ports that must be synchronized. + Base class for [AnimationNode]s with multiple input ports that must be synchronized. </brief_description> <description> An animation node used to combine, mix, or blend two or more animations together while keeping them synchronized within an [AnimationTree]. diff --git a/doc/classes/AnimationNodeTimeScale.xml b/doc/classes/AnimationNodeTimeScale.xml index 4cb8ccb962..9bf7529124 100644 --- a/doc/classes/AnimationNodeTimeScale.xml +++ b/doc/classes/AnimationNodeTimeScale.xml @@ -8,6 +8,6 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> </tutorials> </class> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 775a208735..382166d823 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -38,8 +38,8 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="is_input_loop_broken_at_end" qualifiers="const"> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 9d2d93b0f0..302ca314bb 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -12,7 +12,7 @@ <tutorials> <link title="2D Sprite animation">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link> <link title="Animation documentation index">$DOCS_URL/tutorials/animation/index.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="animation_get_next" qualifiers="const"> @@ -112,7 +112,7 @@ </method> <method name="play_with_capture"> <return type="void" /> - <param index="0" name="name" type="StringName" /> + <param index="0" name="name" type="StringName" default="&""" /> <param index="1" name="duration" type="float" default="-1.0" /> <param index="2" name="custom_blend" type="float" default="-1" /> <param index="3" name="custom_speed" type="float" default="1.0" /> @@ -120,12 +120,13 @@ <param index="5" name="trans_type" type="int" enum="Tween.TransitionType" default="0" /> <param index="6" name="ease_type" type="int" enum="Tween.EaseType" default="0" /> <description> - See [method AnimationMixer.capture]. It is almost the same as the following: + See also [method AnimationMixer.capture]. + You can use this method to use more detailed options for capture than those performed by [member playback_auto_capture]. When [member playback_auto_capture] is [code]false[/code], this method is almost the same as the following: [codeblock] capture(name, duration, trans_type, ease_type) play(name, custom_blend, custom_speed, from_end) [/codeblock] - If name is blank, it specifies [member assigned_animation]. + If [param name] is blank, it specifies [member assigned_animation]. If [param duration] is a negative value, the duration is set to the interval between the current position and the first key, when [param from_end] is [code]true[/code], uses the interval between the current position and the last key instead. [b]Note:[/b] The [param duration] takes [member speed_scale] into account, but [param custom_speed] does not, because the capture cache is interpolated with the blend result and the result may contain multiple animations. </description> @@ -210,6 +211,20 @@ If [code]true[/code] and the engine is running in Movie Maker mode (see [MovieWriter]), exits the engine with [method SceneTree.quit] as soon as an animation is done playing in this [AnimationPlayer]. A message is printed when the engine quits for this reason. [b]Note:[/b] This obeys the same logic as the [signal AnimationMixer.animation_finished] signal, so it will not quit the engine if the animation is set to be looping. </member> + <member name="playback_auto_capture" type="bool" setter="set_auto_capture" getter="is_auto_capture" default="true"> + If [code]true[/code], performs [method AnimationMixer.capture] before playback automatically. This means just [method play_with_capture] is executed with default arguments instead of [method play]. + [b]Note:[/b] Capture interpolation is only performed if the animation contains a capture track. See also [constant Animation.UPDATE_CAPTURE]. + </member> + <member name="playback_auto_capture_duration" type="float" setter="set_auto_capture_duration" getter="get_auto_capture_duration" default="-1.0"> + See also [method play_with_capture] and [method AnimationMixer.capture]. + If [member playback_auto_capture_duration] is negative value, the duration is set to the interval between the current position and the first key. + </member> + <member name="playback_auto_capture_ease_type" type="int" setter="set_auto_capture_ease_type" getter="get_auto_capture_ease_type" enum="Tween.EaseType" default="0"> + The ease type of the capture interpolation. See also [enum Tween.EaseType]. + </member> + <member name="playback_auto_capture_transition_type" type="int" setter="set_auto_capture_transition_type" getter="get_auto_capture_transition_type" enum="Tween.TransitionType" default="0"> + The transition type of the capture interpolation. See also [enum Tween.TransitionType]. + </member> <member name="playback_default_blend_time" type="float" setter="set_default_blend_time" getter="get_default_blend_time" default="0.0"> The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. </member> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index d240a4967e..4a63b35ba0 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -9,7 +9,7 @@ </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="get_process_callback" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_process] instead."> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index a52aa80606..4ad5db2b67 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -10,9 +10,9 @@ </description> <tutorials> <link title="Using Area2D">$DOCS_URL/tutorials/physics/using_area_2d.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link> - <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/2728</link> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> </tutorials> <methods> <method name="get_overlapping_areas" qualifiers="const"> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 671c824c30..8eedd3cdf2 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -11,8 +11,8 @@ </description> <tutorials> <link title="Using Area2D">$DOCS_URL/tutorials/physics/using_area_2d.html</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> </tutorials> <methods> <method name="get_overlapping_areas" qualifiers="const"> @@ -124,12 +124,15 @@ </member> <member name="wind_attenuation_factor" type="float" setter="set_wind_attenuation_factor" getter="get_wind_attenuation_factor" default="0.0"> The exponential rate at which wind force decreases with distance from its origin. + [b]Note:[/b] This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. </member> <member name="wind_force_magnitude" type="float" setter="set_wind_force_magnitude" getter="get_wind_force_magnitude" default="0.0"> The magnitude of area-specific wind force. + [b]Note:[/b] This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. </member> <member name="wind_source_path" type="NodePath" setter="set_wind_source_path" getter="get_wind_source_path" default="NodePath("")"> The [Node3D] which is used to specify the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the [Node3D]'s local transform, and its origin is the origin of the [Node3D]'s local transform. + [b]Note:[/b] This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. </member> </members> <signals> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index fd5ba57615..326b71c588 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -40,6 +40,7 @@ [/codeblocks] [b]Note:[/b] Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. [b]Note:[/b] Erasing elements while iterating over arrays is [b]not[/b] supported and will result in unpredictable behavior. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt64Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. </description> <tutorials> </tutorials> @@ -57,7 +58,30 @@ <param index="2" name="class_name" type="StringName" /> <param index="3" name="script" type="Variant" /> <description> - Creates a typed array from the [param base] array. + Creates a typed array from the [param base] array. All arguments are required. + - [param type] is the built-in type as a [enum Variant.Type] constant, for example [constant TYPE_INT]. + - [param class_name] is the [b]native[/b] class name, for example [Node]. If [param type] is not [constant TYPE_OBJECT], must be an empty string. + - [param script] is the associated script. Must be a [Script] instance or [code]null[/code]. + Examples: + [codeblock] + class_name MyNode + extends Node + + class MyClass: + pass + + func _ready(): + var a = Array([], TYPE_INT, &"", null) # Array[int] + var b = Array([], TYPE_OBJECT, &"Node", null) # Array[Node] + var c = Array([], TYPE_OBJECT, &"Node", MyNode) # Array[MyNode] + var d = Array([], TYPE_OBJECT, &"RefCounted", MyClass) # Array[MyClass] + [/codeblock] + [b]Note:[/b] This constructor can be useful if you want to create a typed array on the fly, but you are not required to use it. In GDScript you can use a temporary variable with the static type you need and then pass it: + [codeblock] + func _ready(): + var a: Array[int] = [] + some_func(a) + [/codeblock] </description> </constructor> <constructor name="Array"> @@ -130,6 +154,13 @@ Constructs an array from a [PackedVector3Array]. </description> </constructor> + <constructor name="Array"> + <return type="Array" /> + <param index="0" name="from" type="PackedVector4Array" /> + <description> + Constructs an array from a [PackedVector4Array]. + </description> + </constructor> </constructors> <methods> <method name="all" qualifiers="const"> @@ -323,19 +354,19 @@ <method name="get_typed_builtin" qualifiers="const"> <return type="int" /> <description> - Returns the [enum Variant.Type] constant for a typed array. If the [Array] is not typed, returns [constant TYPE_NIL]. + Returns the built-in type of the typed array as a [enum Variant.Type] constant. If the array is not typed, returns [constant TYPE_NIL]. </description> </method> <method name="get_typed_class_name" qualifiers="const"> <return type="StringName" /> <description> - Returns a class name of a typed [Array] of type [constant TYPE_OBJECT]. + Returns the [b]native[/b] class name of the typed array if the built-in type is [constant TYPE_OBJECT]. Otherwise, this method returns an empty string. </description> </method> <method name="get_typed_script" qualifiers="const"> <return type="Variant" /> <description> - Returns the script associated with a typed array tied to a class name. + Returns the script associated with the typed array. This method returns a [Script] instance or [code]null[/code]. </description> </method> <method name="has" qualifiers="const" keywords="includes, contains"> diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml index 4fe47ac011..bd31603517 100644 --- a/doc/classes/AudioEffect.xml +++ b/doc/classes/AudioEffect.xml @@ -9,7 +9,7 @@ </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> - <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> + <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> </tutorials> <methods> <method name="_instantiate" qualifiers="virtual"> diff --git a/doc/classes/AudioEffectRecord.xml b/doc/classes/AudioEffectRecord.xml index 5b43c5ebaa..ed0a0c5b08 100644 --- a/doc/classes/AudioEffectRecord.xml +++ b/doc/classes/AudioEffectRecord.xml @@ -11,7 +11,7 @@ </description> <tutorials> <link title="Recording with microphone">$DOCS_URL/tutorials/audio/recording_with_microphone.html</link> - <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> + <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> </tutorials> <methods> <method name="get_recording" qualifiers="const"> diff --git a/doc/classes/AudioEffectReverb.xml b/doc/classes/AudioEffectReverb.xml index 2c055f3825..4ac9672a8f 100644 --- a/doc/classes/AudioEffectReverb.xml +++ b/doc/classes/AudioEffectReverb.xml @@ -8,7 +8,7 @@ </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <members> <member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.5"> diff --git a/doc/classes/AudioEffectSpectrumAnalyzer.xml b/doc/classes/AudioEffectSpectrumAnalyzer.xml index eb70396433..fbc0c2275f 100644 --- a/doc/classes/AudioEffectSpectrumAnalyzer.xml +++ b/doc/classes/AudioEffectSpectrumAnalyzer.xml @@ -8,8 +8,7 @@ See also [AudioStreamGenerator] for procedurally generating sounds. </description> <tutorials> - <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> - <link title="Godot 3.2 will get new audio features">https://godotengine.org/article/godot-32-will-get-new-audio-features</link> + <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link> </tutorials> <members> <member name="buffer_length" type="float" setter="set_buffer_length" getter="get_buffer_length" default="2.0"> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 993aa581dc..b3cf53367d 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -8,9 +8,9 @@ </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> - <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link> - <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> - <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> + <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/2758</link> + <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> + <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link> </tutorials> <methods> <method name="add_bus"> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 9813c2f251..4abce3f1da 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -8,9 +8,9 @@ </description> <tutorials> <link title="Audio streams">$DOCS_URL/tutorials/audio/audio_streams.html</link> - <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> - <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> - <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> + <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> + <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link> </tutorials> <methods> <method name="_get_beat_count" qualifiers="virtual const"> diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml index 9e91d5c450..f618e69631 100644 --- a/doc/classes/AudioStreamGenerator.xml +++ b/doc/classes/AudioStreamGenerator.xml @@ -63,7 +63,7 @@ [b]Note:[/b] Due to performance constraints, this class is best used from C# or from a compiled language via GDExtension. If you still want to use this class from GDScript, consider using a lower [member mix_rate] such as 11,025 Hz or 22,050 Hz. </description> <tutorials> - <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> </tutorials> <members> <member name="buffer_length" type="float" setter="set_buffer_length" getter="get_buffer_length" default="0.5"> diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index 88c5cf6dbe..2f86eaf9e9 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -7,7 +7,7 @@ This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in real-time. </description> <tutorials> - <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> <link title="Godot 3.2 will get new audio features">https://godotengine.org/article/godot-32-will-get-new-audio-features</link> </tutorials> <methods> diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml index 460a7050c8..9f87b76a2b 100644 --- a/doc/classes/AudioStreamPlayback.xml +++ b/doc/classes/AudioStreamPlayback.xml @@ -7,7 +7,7 @@ Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOggVorbis] for usage. </description> <tutorials> - <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> </tutorials> <methods> <method name="_get_loop_count" qualifiers="virtual const"> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index fbe2508da3..a7d0a10073 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -1,100 +1,104 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamPlayer" inherits="Node" keywords="sound, music, song" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Plays back audio non-positionally. + A node for audio playback. </brief_description> <description> - Plays an audio stream non-positionally. - To play audio positionally, use [AudioStreamPlayer2D] or [AudioStreamPlayer3D] instead of [AudioStreamPlayer]. + The [AudioStreamPlayer] node plays an audio stream non-positionally. It is ideal for user interfaces, menus, or background music. + To use this node, [member stream] needs to be set to a valid [AudioStream] resource. Playing more than one sound at the time is also supported, see [member max_polyphony]. + If you need to play audio at a specific position, use [AudioStreamPlayer2D] or [AudioStreamPlayer3D] instead. </description> <tutorials> <link title="Audio streams">$DOCS_URL/tutorials/audio/audio_streams.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link> - <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> - <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> - <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/2758</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> + <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> + <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link> </tutorials> <methods> <method name="get_playback_position"> <return type="float" /> <description> - Returns the position in the [AudioStream] in seconds. + Returns the position in the [AudioStream] of the latest sound, in seconds. Returns [code]0.0[/code] if no sounds are playing. + [b]Note:[/b] The position is not always accurate, as the [AudioServer] does not mix audio every processed frame. To get more accurate results, add [method AudioServer.get_time_since_last_mix] to the returned position. </description> </method> <method name="get_stream_playback"> <return type="AudioStreamPlayback" /> <description> - Returns the [AudioStreamPlayback] object associated with this [AudioStreamPlayer]. + Returns the latest [AudioStreamPlayback] of this node, usually the most recently created by [method play]. If no sounds are playing, this method fails and returns an empty playback. </description> </method> <method name="has_stream_playback"> <return type="bool" /> <description> - Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. + Returns [code]true[/code] if any sound is active, even if [member stream_paused] is set to [code]true[/code]. See also [member playing] and [method get_stream_playback]. </description> </method> <method name="play"> <return type="void" /> <param index="0" name="from_position" type="float" default="0.0" /> <description> - Plays the audio from the given [param from_position], in seconds. + Plays a sound from the beginning, or the given [param from_position] in seconds. </description> </method> <method name="seek"> <return type="void" /> <param index="0" name="to_position" type="float" /> <description> - Sets the position from which audio will be played, in seconds. + Restarts all sounds to be played from the given [param to_position], in seconds. Does nothing if no sounds are playing. </description> </method> <method name="stop"> <return type="void" /> <description> - Stops the audio. + Stops all sounds from this node. </description> </method> </methods> <members> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false"> - If [code]true[/code], audio plays when added to scene tree. + If [code]true[/code], this node calls [method play] when entering the tree. </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> - Bus on which this audio is playing. - [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. + The target bus name. All sounds from this node will be playing on this bus. + [b]Note:[/b] At runtime, if no bus with the given name exists, all sounds will fall back on [code]"Master"[/code]. See also [method AudioServer.get_bus_name]. </member> <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1"> - The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. + The maximum number of sounds this node can play at the same time. Calling [method play] after this value is reached will cut off the oldest sounds. </member> <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget" default="0"> - If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants. + The mix target channels, as one of the [enum MixTarget] constants. Has no effect when two speakers or less are detected (see [enum AudioServer.SpeakerMode]). </member> <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0"> - The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. + The audio's pitch and tempo, as a multiplier of the [member stream]'s sample rate. A value of [code]2.0[/code] doubles the audio's pitch, while a value of [code]0.5[/code] halves the pitch. </member> <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> - If [code]true[/code], audio is playing. + If [code]true[/code], this node is playing sounds. Setting this property has the same effect as [method play] and [method stop]. </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> - The [AudioStream] object to be played. + The [AudioStream] resource to be played. Setting this property stops all currently playing sounds. If left empty, the [AudioStreamPlayer] does not work. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> - If [code]true[/code], the playback is paused. You can resume it by setting [member stream_paused] to [code]false[/code]. + If [code]true[/code], the sounds are paused. Setting [member stream_paused] to [code]false[/code] resumes all sounds. + [b]Note:[/b] This property is automatically changed when exiting or entering the tree, or this node is paused (see [member Node.process_mode]). </member> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> - Volume of sound, in dB. + Volume of sound, in decibel. This is an offset of the [member stream]'s volume. + [b]Note:[/b] To convert between decibel and linear energy (like most volume sliders do), use [method @GlobalScope.db_to_linear] and [method @GlobalScope.linear_to_db]. </member> </members> <signals> <signal name="finished"> <description> - Emitted when the audio stops playing. + Emitted when a sound finishes playing without interruptions. This signal is [i]not[/i] emitted when calling [method stop], or when exiting the tree while sounds are playing. </description> </signal> </signals> <constants> <constant name="MIX_TARGET_STEREO" value="0" enum="MixTarget"> - The audio will be played only on the first channel. + The audio will be played only on the first channel. This is the default. </constant> <constant name="MIX_TARGET_SURROUND" value="1" enum="MixTarget"> The audio will be played on all surround channels. diff --git a/doc/classes/AudioStreamWAV.xml b/doc/classes/AudioStreamWAV.xml index 206b6361cc..3df814cb7f 100644 --- a/doc/classes/AudioStreamWAV.xml +++ b/doc/classes/AudioStreamWAV.xml @@ -15,7 +15,7 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> <description> - Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM format can't be saved. + Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM or QOA formats can't be saved. [b]Note:[/b] A [code].wav[/code] extension is automatically appended to [param path] if it is missing. </description> </method> @@ -56,6 +56,9 @@ <constant name="FORMAT_IMA_ADPCM" value="2" enum="Format"> Audio is compressed using IMA ADPCM. </constant> + <constant name="FORMAT_QOA" value="3" enum="Format"> + Audio is compressed as QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]). + </constant> <constant name="LOOP_DISABLED" value="0" enum="LoopMode"> Audio does not loop. </constant> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 1bd4183b3c..fc8af02869 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -609,6 +609,9 @@ <constant name="BLEND_MODE_MUL" value="3" enum="BlendMode"> The color of the object is multiplied by the background. </constant> + <constant name="BLEND_MODE_PREMULT_ALPHA" value="4" enum="BlendMode"> + The color of the object is added to the background and the alpha channel is used to mask out the background. This is effectively a hybrid of the blend mix and add modes, useful for effects like fire where you want the flame to add but the smoke to mix. By default, this works with unshaded materials using premultiplied textures. For shaded materials, use the [code]PREMUL_ALPHA_FACTOR[/code] built-in so that lighting can be modulated as well. + </constant> <constant name="ALPHA_ANTIALIASING_OFF" value="0" enum="AlphaAntiAliasing"> Disables Alpha AntiAliasing for the material. </constant> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 32077c0b89..338d9523fa 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -15,10 +15,10 @@ <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link> <link title="Matrices and transforms">$DOCS_URL/tutorials/math/matrices_and_transforms.html</link> <link title="Using 3D transforms">$DOCS_URL/tutorials/3d/using_transforms.html</link> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> - <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> + <link title="2.5D Game Demo">https://godotengine.org/asset-library/asset/2783</link> </tutorials> <constructors> <constructor name="Basis"> diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml index bafa463f82..a51b2d9a94 100644 --- a/doc/classes/BoneAttachment3D.xml +++ b/doc/classes/BoneAttachment3D.xml @@ -21,11 +21,10 @@ Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than attempting to use its parent node as the [Skeleton3D]. </description> </method> - <method name="on_bone_pose_update"> + <method name="on_skeleton_update"> <return type="void" /> - <param index="0" name="bone_index" type="int" /> <description> - A function that is called automatically when the [Skeleton3D] the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose. + A function that is called automatically when the [Skeleton3D] is updated. This function is where the [BoneAttachment3D] node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose. </description> </method> <method name="set_external_skeleton"> diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml index 5190e6e759..ead5afd89c 100644 --- a/doc/classes/BoxShape3D.xml +++ b/doc/classes/BoxShape3D.xml @@ -8,9 +8,9 @@ [b]Performance:[/b] [BoxShape3D] is fast to check collisions against. It is faster than [CapsuleShape3D] and [CylinderShape3D], but slower than [SphereShape3D]. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> </tutorials> <members> <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(1, 1, 1)"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index e5b47ffb89..d2af6179d9 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -36,8 +36,8 @@ [b]Note:[/b] Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions. </description> <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <members> <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> @@ -122,7 +122,7 @@ The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="icon_max_width" data_type="constant" type="int" default="0"> - The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio. + The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio. If the button has additional icons (e.g. [CheckBox]), they will also be limited. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 6319bfb3d1..da98e6c26a 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -10,9 +10,8 @@ Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_screen_center_position] to get the real position. </description> <tutorials> - <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> - <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link> - <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> + <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/2718</link> </tutorials> <methods> <method name="align"> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 01890b471c..27194122d5 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -7,7 +7,7 @@ [Camera3D] is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a [Viewport], and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed. </description> <tutorials> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="clear_current"> diff --git a/doc/classes/CameraServer.xml b/doc/classes/CameraServer.xml index 983bd6cd91..020b5d887b 100644 --- a/doc/classes/CameraServer.xml +++ b/doc/classes/CameraServer.xml @@ -6,7 +6,7 @@ <description> The [CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. It is notably used to provide AR modules with a video feed from the camera. - [b]Note:[/b] This class is currently only implemented on macOS and iOS. On other platforms, no [CameraFeed]s will be available. + [b]Note:[/b] This class is currently only implemented on macOS and iOS. To get a [CameraFeed] on iOS, the camera plugin from [url=https://github.com/godotengine/godot-ios-plugins]godot-ios-plugins[/url] is required. On other platforms, no [CameraFeed]s will be available. </description> <tutorials> </tutorials> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 72783bc5d6..207045b065 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -8,11 +8,12 @@ Any [CanvasItem] can draw. For this, [method queue_redraw] is called by the engine, then [constant NOTIFICATION_DRAW] will be received on idle time to request a redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the [CanvasItem] are provided (see [code]draw_*[/code] functions). However, they can only be used inside [method _draw], its corresponding [method Object._notification] or methods connected to the [signal draw] signal. Canvas items are drawn in tree order on their canvas layer. By default, children are on top of their parents, so a root [CanvasItem] will be drawn behind everything. This behavior can be changed on a per-item basis. A [CanvasItem] can be hidden, which will also hide its children. By adjusting various other properties of a [CanvasItem], you can also modulate its color (via [member modulate] or [member self_modulate]), change its Z-index, blend mode, and more. + Note that properties like transform, modulation, and visibility are only propagated to [i]direct[/i] [CanvasItem] child nodes. If there is a non-[CanvasItem] node in between, like [Node] or [AnimationPlayer], the [CanvasItem] nodes below will have an independent position and [member modulate] chain. See also [member top_level]. </description> <tutorials> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> <link title="Custom drawing in 2D">$DOCS_URL/tutorials/2d/custom_drawing_in_2d.html</link> - <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> + <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link> </tutorials> <methods> <method name="_draw" qualifiers="virtual"> @@ -76,8 +77,15 @@ <param index="0" name="position" type="Vector2" /> <param index="1" name="radius" type="float" /> <param index="2" name="color" type="Color" /> + <param index="3" name="filled" type="bool" default="true" /> + <param index="4" name="width" type="float" default="-1.0" /> + <param index="5" name="antialiased" type="bool" default="false" /> <description> - Draws a colored, filled circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon]. + Draws a circle. See also [method draw_arc], [method draw_polyline], and [method draw_polygon]. + If [param filled] is [code]true[/code], the circle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the circle will be drawn as a stroke with the [param color] and [param width] specified. + If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. + If [param antialiased] is [code]true[/code], half transparent "feathers" will be attached to the boundary, making outlines smooth. + [b]Note:[/b] [param width] is only effective if [param filled] is [code]false[/code]. </description> </method> <method name="draw_colored_polygon"> @@ -98,9 +106,12 @@ <param index="3" name="width" type="float" default="-1.0" /> <param index="4" name="dash" type="float" default="2.0" /> <param index="5" name="aligned" type="bool" default="true" /> + <param index="6" name="antialiased" type="bool" default="false" /> <description> Draws a dashed line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. If [param width] is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. + If [param antialiased] is [code]true[/code], half transparent "feathers" will be attached to the boundary, making outlines smooth. + [b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. </description> </method> <method name="draw_end_animation"> @@ -168,9 +179,11 @@ <param index="0" name="points" type="PackedVector2Array" /> <param index="1" name="color" type="Color" /> <param index="2" name="width" type="float" default="-1.0" /> + <param index="3" name="antialiased" type="bool" default="false" /> <description> Draws multiple disconnected lines with a uniform [param width] and [param color]. Each line is defined by two consecutive points from [param points] array, i.e. i-th segment consists of [code]points[2 * i][/code], [code]points[2 * i + 1][/code] endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead. If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. + [b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. </description> </method> <method name="draw_multiline_colors"> @@ -178,9 +191,11 @@ <param index="0" name="points" type="PackedVector2Array" /> <param index="1" name="colors" type="PackedColorArray" /> <param index="2" name="width" type="float" default="-1.0" /> + <param index="3" name="antialiased" type="bool" default="false" /> <description> Draws multiple disconnected lines with a uniform [param width] and segment-by-segment coloring. Each segment is defined by two consecutive points from [param points] array and a corresponding color from [param colors] array, i.e. i-th segment consists of [code]points[2 * i][/code], [code]points[2 * i + 1][/code] endpoints and has [code]colors[i][/code] color. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead. If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. + [b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. </description> </method> <method name="draw_multiline_string" qualifiers="const"> @@ -276,9 +291,11 @@ <param index="1" name="color" type="Color" /> <param index="2" name="filled" type="bool" default="true" /> <param index="3" name="width" type="float" default="-1.0" /> + <param index="4" name="antialiased" type="bool" default="false" /> <description> Draws a rectangle. If [param filled] is [code]true[/code], the rectangle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the rectangle will be drawn as a stroke with the [param color] and [param width] specified. See also [method draw_texture_rect]. If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. + If [param antialiased] is [code]true[/code], half transparent "feathers" will be attached to the boundary, making outlines smooth. [b]Note:[/b] [param width] is only effective if [param filled] is [code]false[/code]. [b]Note:[/b] Unfilled rectangles drawn with a negative [param width] may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent [param color]). </description> @@ -606,14 +623,15 @@ [b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. </member> <member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false"> - If [code]true[/code], this [CanvasItem] and its [CanvasItem] child nodes are sorted according to the Y position. Nodes with a lower Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled. - You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree. + If [code]true[/code], this and child [CanvasItem] nodes with a lower Y position are rendered in front of nodes with a higher Y position. If [code]false[/code], this and child [CanvasItem] nodes are rendered normally in scene tree order. + With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc) render together on the same Y position as the child node 'B'. This allows you to organize the render order of a scene without changing the scene tree. + Nodes sort relative to each other only if they are on the same [member z_index]. </member> <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true"> If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. </member> <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0"> - Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). + Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). [b]Note:[/b] Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others. </member> </members> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index a91b003d79..597ec78089 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -12,7 +12,7 @@ <tutorials> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> <link title="Canvas layers">$DOCS_URL/tutorials/2d/canvas_layers.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_canvas" qualifiers="const"> diff --git a/doc/classes/CapsuleShape3D.xml b/doc/classes/CapsuleShape3D.xml index 2c8c2cef9e..4c6b3a870f 100644 --- a/doc/classes/CapsuleShape3D.xml +++ b/doc/classes/CapsuleShape3D.xml @@ -8,7 +8,7 @@ [b]Performance:[/b] [CapsuleShape3D] is fast to check collisions against. It is faster than [CylinderShape3D], but slower than [SphereShape3D] and [BoxShape3D]. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> </tutorials> <members> <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index b66a01a282..ede4d63cfc 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -10,8 +10,8 @@ <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> <link title="Using CharacterBody2D">$DOCS_URL/tutorials/physics/using_character_body_2d.html</link> - <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> - <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> </tutorials> <methods> <method name="apply_floor_snap"> @@ -30,7 +30,8 @@ <method name="get_floor_normal" qualifiers="const"> <return type="Vector2" /> <description> - Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="get_last_motion" qualifiers="const"> @@ -94,7 +95,8 @@ <method name="get_wall_normal" qualifiers="const"> <return type="Vector2" /> <description> - Returns the surface normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. + Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. + [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="is_on_ceiling" qualifiers="const"> diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 2382c77a12..474adfc6ff 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -9,10 +9,10 @@ </description> <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="apply_floor_snap"> @@ -31,7 +31,8 @@ <method name="get_floor_normal" qualifiers="const"> <return type="Vector3" /> <description> - Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="get_last_motion" qualifiers="const"> @@ -86,7 +87,8 @@ <method name="get_wall_normal" qualifiers="const"> <return type="Vector3" /> <description> - Returns the surface normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. + Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. + [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="is_on_ceiling" qualifiers="const"> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 3f71406091..59ed0b8fe7 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -91,6 +91,14 @@ Returns the value of [param property] of [param object] or its ancestry. </description> </method> + <method name="class_get_property_default_value" qualifiers="const"> + <return type="Variant" /> + <param index="0" name="class" type="StringName" /> + <param index="1" name="property" type="StringName" /> + <description> + Returns the default value of [param property] of [param class] or its ancestor classes. + </description> + </method> <method name="class_get_property_list" qualifiers="const"> <return type="Dictionary[]" /> <param index="0" name="class" type="StringName" /> @@ -192,6 +200,15 @@ Returns whether this [param class] is enabled or not. </description> </method> + <method name="is_class_enum_bitfield" qualifiers="const"> + <return type="bool" /> + <param index="0" name="class" type="StringName" /> + <param index="1" name="enum" type="StringName" /> + <param index="2" name="no_inheritance" type="bool" default="false" /> + <description> + Returns whether [param class] (or its ancestor classes if [param no_inheritance] is [code]false[/code]) has an enum called [param enum] that is a bitfield. + </description> + </method> <method name="is_parent_class" qualifiers="const"> <return type="bool" /> <param index="0" name="class" type="StringName" /> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 7c6f1a51c4..d455799c29 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -14,7 +14,7 @@ <return type="void" /> <param index="0" name="replace" type="bool" /> <description> - Override this method to define how the selected entry should be inserted. If [param replace] is true, any existing text should be replaced. + Override this method to define how the selected entry should be inserted. If [param replace] is [code]true[/code], any existing text should be replaced. </description> </method> <method name="_filter_code_completion_candidates" qualifiers="virtual const"> @@ -29,7 +29,7 @@ <return type="void" /> <param index="0" name="force" type="bool" /> <description> - Override this method to define what happens when the user requests code completion. If [param force] is true, any checks should be bypassed. + Override this method to define what happens when the user requests code completion. If [param force] is [code]true[/code], any checks should be bypassed. </description> </method> <method name="add_auto_brace_completion_pair"> @@ -123,7 +123,7 @@ <return type="void" /> <param index="0" name="replace" type="bool" default="false" /> <description> - Inserts the selected entry into the text. If [param replace] is true, any existing text is replaced rather than merged. + Inserts the selected entry into the text. If [param replace] is [code]true[/code], any existing text is replaced rather than merged. </description> </method> <method name="convert_indent"> @@ -144,6 +144,12 @@ Code regions are delimited using start and end tags (respectively [code]region[/code] and [code]endregion[/code] by default) preceded by one line comment delimiter. (eg. [code]#region[/code] and [code]#endregion[/code]) </description> </method> + <method name="delete_lines"> + <return type="void" /> + <description> + Deletes all lines that are selected or have a caret on them. + </description> + </method> <method name="do_indent"> <return type="void" /> <description> @@ -156,6 +162,12 @@ Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line. </description> </method> + <method name="duplicate_selection"> + <return type="void" /> + <description> + Duplicates all selected text and duplicates all lines with a caret on them. + </description> + </method> <method name="fold_all_lines"> <return type="void" /> <description> @@ -379,6 +391,18 @@ Returns whether the line at the specified index is folded or not. </description> </method> + <method name="move_lines_down"> + <return type="void" /> + <description> + Moves all lines down that are selected or have a caret on them. + </description> + </method> + <method name="move_lines_up"> + <return type="void" /> + <description> + Moves all lines up that are selected or have a caret on them. + </description> + </method> <method name="remove_comment_delimiter"> <return type="void" /> <param index="0" name="start_key" type="String" /> @@ -397,7 +421,7 @@ <return type="void" /> <param index="0" name="force" type="bool" default="false" /> <description> - Emits [signal code_completion_requested], if [param force] is true will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path or signal. + Emits [signal code_completion_requested], if [param force] is [code]true[/code] will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path, or signal. </description> </method> <method name="set_code_completion_selected_index"> @@ -467,6 +491,12 @@ Toggle the folding of the code block at the given line. </description> </method> + <method name="toggle_foldable_lines_at_carets"> + <return type="void" /> + <description> + Toggle the folding of the code block on all lines with a caret on them. + </description> + </method> <method name="unfold_all_lines"> <return type="void" /> <description> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 29535ffd64..1805683de5 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -26,7 +26,6 @@ <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first. [b]Note:[/b] The returned vertices are in the local coordinate space of the given [CollisionPolygon2D]. - [b]Warning:[/b] The returned value is a clone of the [PackedVector2Array], not a reference. </member> </members> <constants> diff --git a/doc/classes/CollisionPolygon3D.xml b/doc/classes/CollisionPolygon3D.xml index 16090c203e..4f5866c348 100644 --- a/doc/classes/CollisionPolygon3D.xml +++ b/doc/classes/CollisionPolygon3D.xml @@ -21,7 +21,6 @@ </member> <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> Array of vertices which define the 2D polygon in the local XY plane. - [b]Note:[/b] The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the class property. </member> </members> </class> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index 1320982376..dd04bf7b82 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -8,9 +8,9 @@ </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link> - <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/2728</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> </tutorials> <members> <member name="debug_color" type="Color" setter="set_debug_color" getter="get_debug_color" default="Color(0, 0, 0, 1)"> diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml index f6c0c323f4..a4e0ed0b28 100644 --- a/doc/classes/CollisionShape3D.xml +++ b/doc/classes/CollisionShape3D.xml @@ -9,9 +9,9 @@ </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="make_convex_from_siblings"> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 942d3bc80d..37beca5f81 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -10,9 +10,9 @@ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url] </description> <tutorials> - <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link> - <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link> - <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link> + <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/2768</link> + <link title="Tween Interpolation Demo">https://godotengine.org/asset-library/asset/2733</link> + <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/2767</link> </tutorials> <constructors> <constructor name="Color"> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 9aa0122ed2..cf26f917e1 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -8,7 +8,7 @@ [b]Note:[/b] This control is the color picker widget itself. You can use a [ColorPickerButton] instead if you need a button that brings up a [ColorPicker] in a popup. </description> <tutorials> - <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link> + <link title="Tween Interpolation Demo">https://godotengine.org/asset-library/asset/2733</link> </tutorials> <methods> <method name="add_preset"> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index c53d61f036..bec2520397 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -9,8 +9,8 @@ [b]Note:[/b] By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [member Control.custom_minimum_size] to a big enough value to give the button enough space. </description> <tutorials> - <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link> - <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link> + <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/2768</link> + <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/2767</link> </tutorials> <methods> <method name="get_picker"> diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 413d51db72..6b2ddd748e 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -7,7 +7,7 @@ Displays a rectangle filled with a solid [member color]. If you need to display the border alone, consider using a [Panel] instead. </description> <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <members> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)" keywords="colour"> diff --git a/doc/classes/Compositor.xml b/doc/classes/Compositor.xml index c030896b6f..7605083319 100644 --- a/doc/classes/Compositor.xml +++ b/doc/classes/Compositor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Compositor" inherits="Resource" experimental="More customisation of the rendering pipeline will be added in the future." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="Compositor" inherits="Resource" experimental="More customization of the rendering pipeline will be added in the future." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Stores attributes used to customize how a Viewport is rendered. </brief_description> diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml index 7e4df2073f..5c93325b63 100644 --- a/doc/classes/ConcavePolygonShape3D.xml +++ b/doc/classes/ConcavePolygonShape3D.xml @@ -11,7 +11,7 @@ [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest 3D collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, [ConvexPolygonShape3D] should be used. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> </tutorials> <methods> <method name="get_faces" qualifiers="const"> diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index e6b28ae98e..feeea339fe 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -5,7 +5,7 @@ </brief_description> <description> This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are identified by a section and a key: - [codeblock] + [codeblock lang=text] [section] some_key=42 string_example="Hello World3D!" diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 8fa5dac7bf..5cdff076bd 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -8,10 +8,10 @@ To get cancel action, you can use: [codeblocks] [gdscript] - get_cancel_button().pressed.connect(self.canceled) + get_cancel_button().pressed.connect(_on_canceled) [/gdscript] [csharp] - GetCancelButton().Pressed += Canceled; + GetCancelButton().Pressed += OnCanceled; [/csharp] [/codeblocks] </description> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index cc32964e87..a0c76a3ad6 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -937,14 +937,14 @@ <member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> - <member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true" deprecated="Use [member Node.auto_translate_mode] instead."> + <member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" deprecated="Use [member Node.auto_translate_mode] instead."> Toggles if any text should automatically change to its translated version depending on the current locale. </member> <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false"> Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. </member> <member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> - The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. + The minimum size of the node's bounding rectangle. If you set it to a value greater than [code](0, 0)[/code], the node's bounding rectangle will always have at least this size. Note that [Control] nodes have their internal minimum size returned by [method get_minimum_size]. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see [method get_combined_minimum_size]). </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals. diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml index 280cadde78..98c3459289 100644 --- a/doc/classes/ConvexPolygonShape3D.xml +++ b/doc/classes/ConvexPolygonShape3D.xml @@ -10,7 +10,7 @@ [b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] and [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> </tutorials> <members> <member name="points" type="PackedVector3Array" setter="set_points" getter="get_points" default="PackedVector3Array()"> diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index 65abc4c641..0effd54fb9 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -8,66 +8,67 @@ Currently, this includes asymmetric key encryption/decryption, signing/verification, and generating cryptographically secure random bytes, RSA keys, HMAC digests, and self-signed [X509Certificate]s. [codeblocks] [gdscript] - extends Node - var crypto = Crypto.new() - var key = CryptoKey.new() - var cert = X509Certificate.new() - - func _ready(): - # Generate new RSA key. - key = crypto.generate_rsa(4096) - # Generate new self-signed certificate with the given key. - cert = crypto.generate_self_signed_certificate(key, "CN=mydomain.com,O=My Game Company,C=IT") - # Save key and certificate in the user folder. - key.save("user://generated.key") - cert.save("user://generated.crt") - # Encryption - var data = "Some data" - var encrypted = crypto.encrypt(key, data.to_utf8_buffer()) - # Decryption - var decrypted = crypto.decrypt(key, encrypted) - # Signing - var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key) - # Verifying - var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) - # Checks - assert(verified) - assert(data.to_utf8_buffer() == decrypted) + + # Generate new RSA key. + var key = crypto.generate_rsa(4096) + + # Generate new self-signed certificate with the given key. + var cert = crypto.generate_self_signed_certificate(key, "CN=mydomain.com,O=My Game Company,C=IT") + + # Save key and certificate in the user folder. + key.save("user://generated.key") + cert.save("user://generated.crt") + + # Encryption + var data = "Some data" + var encrypted = crypto.encrypt(key, data.to_utf8_buffer()) + + # Decryption + var decrypted = crypto.decrypt(key, encrypted) + + # Signing + var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key) + + # Verifying + var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) + + # Checks + assert(verified) + assert(data.to_utf8_buffer() == decrypted) [/gdscript] [csharp] using Godot; using System.Diagnostics; - public partial class MyNode : Node - { - private Crypto _crypto = new Crypto(); - private CryptoKey _key = new CryptoKey(); - private X509Certificate _cert = new X509Certificate(); - - public override void _Ready() - { - // Generate new RSA key. - _key = _crypto.GenerateRsa(4096); - // Generate new self-signed certificate with the given key. - _cert = _crypto.GenerateSelfSignedCertificate(_key, "CN=mydomain.com,O=My Game Company,C=IT"); - // Save key and certificate in the user folder. - _key.Save("user://generated.key"); - _cert.Save("user://generated.crt"); - // Encryption - string data = "Some data"; - byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8Buffer()); - // Decryption - byte[] decrypted = _crypto.Decrypt(_key, encrypted); - // Signing - byte[] signature = _crypto.Sign(HashingContext.HashType.Sha256, Data.Sha256Buffer(), _key); - // Verifying - bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data.Sha256Buffer(), signature, _key); - // Checks - Debug.Assert(verified); - Debug.Assert(data.ToUtf8Buffer() == decrypted); - } - } + Crypto crypto = new Crypto(); + + // Generate new RSA key. + CryptoKey key = crypto.GenerateRsa(4096); + + // Generate new self-signed certificate with the given key. + X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game Company,C=IT"); + + // Save key and certificate in the user folder. + key.Save("user://generated.key"); + cert.Save("user://generated.crt"); + + // Encryption + string data = "Some data"; + byte[] encrypted = crypto.Encrypt(key, data.ToUtf8Buffer()); + + // Decryption + byte[] decrypted = crypto.Decrypt(key, encrypted); + + // Signing + byte[] signature = crypto.Sign(HashingContext.HashType.Sha256, Data.Sha256Buffer(), key); + + // Verifying + bool verified = crypto.Verify(HashingContext.HashType.Sha256, Data.Sha256Buffer(), signature, key); + + // Checks + Debug.Assert(verified); + Debug.Assert(data.ToUtf8Buffer() == decrypted); [/csharp] [/codeblocks] </description> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index ff826a3ae5..dd128b6806 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CryptoKey" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A cryptographic key (RSA). + A cryptographic key (RSA or elliptic-curve). </brief_description> <description> The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource]. diff --git a/doc/classes/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml index 8bec199ab6..db98cac6e3 100644 --- a/doc/classes/CylinderShape3D.xml +++ b/doc/classes/CylinderShape3D.xml @@ -9,9 +9,9 @@ [b]Performance:[/b] [CylinderShape3D] is fast to check collisions against, but it is slower than [CapsuleShape3D], [BoxShape3D], and [SphereShape3D]. </description> <tutorials> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 14ce7c894f..7f0fdddcdd 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -138,8 +138,8 @@ </description> <tutorials> <link title="GDScript basics: Dictionary">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#dictionary</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <constructors> <constructor name="Dictionary"> diff --git a/doc/classes/DirAccess.xml b/doc/classes/DirAccess.xml index 03d7f68f43..9c71addf0c 100644 --- a/doc/classes/DirAccess.xml +++ b/doc/classes/DirAccess.xml @@ -94,6 +94,16 @@ Static version of [method copy]. Supports only absolute paths. </description> </method> + <method name="create_link"> + <return type="int" enum="Error" /> + <param index="0" name="source" type="String" /> + <param index="1" name="target" type="String" /> + <description> + Creates symbolic link between files or folders. + [b]Note:[/b] On Windows, this method works only if the application is running with elevated privileges or Developer Mode is enabled. + [b]Note:[/b] This method is implemented on macOS, Linux, and Windows. + </description> + </method> <method name="current_is_dir" qualifiers="const"> <return type="bool" /> <description> @@ -212,6 +222,14 @@ [b]Note:[/b] This method is implemented on macOS, Linux (for EXT4 and F2FS filesystems only) and Windows. On other platforms, it always returns [code]true[/code]. </description> </method> + <method name="is_link"> + <return type="bool" /> + <param index="0" name="path" type="String" /> + <description> + Returns [code]true[/code] if the file or directory is a symbolic link, directory junction, or other reparse point. + [b]Note:[/b] This method is implemented on macOS, Linux, and Windows. + </description> + </method> <method name="list_dir_begin"> <return type="int" enum="Error" /> <description> @@ -264,6 +282,14 @@ Returns [code]null[/code] if opening the directory failed. You can use [method get_open_error] to check the error that occurred. </description> </method> + <method name="read_link"> + <return type="String" /> + <param index="0" name="path" type="String" /> + <description> + Returns target of the symbolic link. + [b]Note:[/b] This method is implemented on macOS, Linux, and Windows. + </description> + </method> <method name="remove"> <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 9eb5f9e334..ff1c390b3c 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -58,11 +58,12 @@ </method> <method name="create_status_indicator"> <return type="int" /> - <param index="0" name="icon" type="Image" /> + <param index="0" name="icon" type="Texture2D" /> <param index="1" name="tooltip" type="String" /> <param index="2" name="callback" type="Callable" /> <description> Creates a new application status indicator with the specified icon, tooltip, and activation callback. + [param callback] should take two arguments: the pressed mouse button (one of the [enum MouseButton] constants) and the click position in screen coordinates (a [Vector2i]). </description> </method> <method name="cursor_get_shape" qualifiers="const"> @@ -249,7 +250,7 @@ <param index="0" name="position" type="Vector2i" /> <description> Returns the ID of the window at the specified screen [param position] (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: - [codeblock] + [codeblock lang=text] * (0, 0) +-------+ | | +-------------+ | | @@ -282,7 +283,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -308,7 +309,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -334,7 +335,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -361,7 +362,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -386,7 +387,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -415,7 +416,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -441,7 +442,7 @@ [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 only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -459,7 +460,7 @@ Returns index of the inserted item, it's not guaranteed to be the same as [param index] value. [b]Note:[/b] This method is implemented only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -479,7 +480,7 @@ Returns index of the inserted item, it's not guaranteed to be the same as [param index] value. [b]Note:[/b] This method is implemented only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -495,7 +496,7 @@ Removes all items from the global menu with ID [param menu_root]. [b]Note:[/b] This method is implemented only on macOS. [b]Supported system menu IDs:[/b] - [codeblock] + [codeblock lang=text] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). "_apple" - Apple menu (macOS, custom items added before "Services"). @@ -875,7 +876,7 @@ <param index="1" name="open_callback" type="Callable" /> <param index="2" name="close_callback" type="Callable" /> <description> - Registers callables to emit when the menu is respectively about to show or closed. + Registers callables to emit when the menu is respectively about to show or closed. Callback methods should have zero arguments. </description> </method> <method name="has_feature" qualifiers="const"> @@ -930,6 +931,12 @@ Returns [code]true[/code] if touch events are available (Android or iOS), the capability is detected on the Web platform or if [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is [code]true[/code]. </description> </method> + <method name="is_window_transparency_available" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the window background can be made transparent. This method returns [code]false[/code] if [member ProjectSettings.display/window/per_pixel_transparency/allowed] is set to [code]false[/code], or if transparency is not supported by the renderer or OS compositor. + </description> + </method> <method name="keyboard_get_current_layout" qualifiers="const"> <return type="int" /> <description> @@ -1022,7 +1029,7 @@ Returns the dots per inch density of the specified screen. If [param screen] is [constant SCREEN_OF_MAIN_WINDOW] (the default value), a screen with the main window will be used. [b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used. [b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities: - [codeblock] + [codeblock lang=text] ldpi - 120 dpi mdpi - 160 dpi hdpi - 240 dpi @@ -1072,7 +1079,7 @@ <param index="0" name="screen" type="int" default="-1" /> <description> Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: - [codeblock] + [codeblock lang=text] * (0, 0) +-------+ | | +-------------+ | | @@ -1103,8 +1110,9 @@ <param index="0" name="screen" type="int" default="-1" /> <description> Returns the scale factor of the specified screen by index. - [b]Note:[/b] On macOS returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases. - [b]Note:[/b] This method is implemented only on macOS. + [b]Note:[/b] On macOS, the returned value is [code]2.0[/code] for hiDPI (Retina) screens, and [code]1.0[/code] for all other cases. + [b]Note:[/b] On Linux (Wayland), the returned value is accurate only when [param screen] is [constant SCREEN_OF_MAIN_WINDOW]. Due to API limitations, passing a direct index will return a rounded-up integer, if the screen has a fractional scale (e.g. [code]1.25[/code] would get rounded up to [code]2.0[/code]). + [b]Note:[/b] This method is implemented only on macOS and Linux (Wayland). </description> </method> <method name="screen_get_size" qualifiers="const"> @@ -1167,20 +1175,41 @@ [b]Note:[/b] This method is implemented on Android, iOS, macOS, Windows, and Linux (X11/Wayland). </description> </method> + <method name="status_indicator_get_rect" qualifiers="const"> + <return type="Rect2" /> + <param index="0" name="id" type="int" /> + <description> + Returns the rectangle for the given status indicator [param id] in screen coordinates. If the status indicator is not visible, returns an empty [Rect2]. + [b]Note:[/b] This method is implemented on macOS and Windows. + </description> + </method> <method name="status_indicator_set_callback"> <return type="void" /> <param index="0" name="id" type="int" /> <param index="1" name="callback" type="Callable" /> <description> - Sets the application status indicator activation callback. + Sets the application status indicator activation callback. [param callback] should take two arguments: [int] mouse button index (one of [enum MouseButton] values) and [Vector2i] click position in screen coordinates. + [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> <method name="status_indicator_set_icon"> <return type="void" /> <param index="0" name="id" type="int" /> - <param index="1" name="icon" type="Image" /> + <param index="1" name="icon" type="Texture2D" /> <description> Sets the application status indicator icon. + [b]Note:[/b] This method is implemented on macOS and Windows. + </description> + </method> + <method name="status_indicator_set_menu"> + <return type="void" /> + <param index="0" name="id" type="int" /> + <param index="1" name="menu_rid" type="RID" /> + <description> + Sets the application status indicator native popup menu. + [b]Note:[/b] On macOS, the menu is activated by any mouse button. Its activation callback is [i]not[/i] triggered. + [b]Note:[/b] On Windows, the menu is activated by the right mouse button, selecting the status icon and pressing [kbd]Shift + F10[/kbd], or the applications key. The menu's activation callback for the other mouse buttons is still triggered. + [b]Note:[/b] Native popup is only supported if [NativeMenu] supports the [constant NativeMenu.FEATURE_POPUP_MENU] feature. </description> </method> <method name="status_indicator_set_tooltip"> @@ -1189,6 +1218,7 @@ <param index="1" name="tooltip" type="String" /> <description> Sets the application status indicator tooltip. + [b]Note:[/b] This method is implemented on macOS and Windows. </description> </method> <method name="tablet_get_current_driver" qualifiers="const"> @@ -1539,7 +1569,7 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the [param callback] that should be called when files are dropped from the operating system's file manager to the window specified by [param window_id]. + Sets the [param callback] that should be called when files are dropped from the operating system's file manager to the window specified by [param window_id]. [param callback] should take one [PackedStringArray] argument, which is the list of dropped files. [b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] node will override its default implementation, which can introduce bugs. [b]Note:[/b] This method is implemented on Windows, macOS, Linux (X11/Wayland), and Web. </description> @@ -1602,7 +1632,7 @@ <param index="0" name="max_size" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the maximum size of the window specified by [param window_id] in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also [method window_get_max_size]. + Sets the maximum size of the window specified by [param window_id] in pixels. Normally, the user will not be able to drag the window to make it larger than the specified size. See also [method window_get_max_size]. [b]Note:[/b] It's recommended to change this value using [member Window.max_size] instead. [b]Note:[/b] Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. </description> @@ -1612,7 +1642,7 @@ <param index="0" name="min_size" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the minimum size for the given window to [param min_size] (in pixels). Normally, the user will not be able to drag the window to make it larger than the specified size. See also [method window_get_min_size]. + Sets the minimum size for the given window to [param min_size] in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also [method window_get_min_size]. [b]Note:[/b] It's recommended to change this value using [member Window.min_size] instead. [b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size. [b]Note:[/b] Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. @@ -1674,7 +1704,7 @@ <param index="1" name="window_id" type="int" default="0" /> <description> Sets the position of the given window to [param position]. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: - [codeblock] + [codeblock lang=text] * (0, 0) +-------+ | | +-------------+ | | @@ -2022,7 +2052,7 @@ </constant> <constant name="WINDOW_FLAG_TRANSPARENT" value="3" enum="WindowFlags"> The window background can be transparent. - [b]Note:[/b] This flag has no effect if [member ProjectSettings.display/window/per_pixel_transparency/allowed] is set to [code]false[/code]. + [b]Note:[/b] This flag has no effect if [method is_window_transparency_available] returns [code]false[/code]. [b]Note:[/b] Transparency support is implemented on Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. </constant> <constant name="WINDOW_FLAG_NO_FOCUS" value="4" enum="WindowFlags"> diff --git a/doc/classes/EditorExportPlatformPC.xml b/doc/classes/EditorExportPlatformPC.xml index 3c2a27deab..def14e5955 100644 --- a/doc/classes/EditorExportPlatformPC.xml +++ b/doc/classes/EditorExportPlatformPC.xml @@ -4,7 +4,10 @@ Base class for the desktop platform exporter (Windows and Linux/BSD). </brief_description> <description> + The base class for the desktop platform exporters. These include Windows and Linux/BSD, but not macOS. See the classes inheriting this one for more details. </description> <tutorials> + <link title="Exporting for Windows">$DOCS_URL/tutorials/export/exporting_for_windows.html</link> + <link title="Exporting for Linux">$DOCS_URL/tutorials/export/exporting_for_linux.html</link> </tutorials> </class> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 4befcf5e69..d5c2ed55d7 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -90,6 +90,12 @@ Notify the [EditorFileDialog] that its view of the data is no longer accurate. Updates the view contents on next view update. </description> </method> + <method name="popup_file_dialog"> + <return type="void" /> + <description> + Shows the [EditorFileDialog] at the default size and position for file dialogs in the editor, and selects the file name if there is a current file. + </description> + </method> <method name="set_option_default"> <return type="void" /> <param index="0" name="option" type="int" /> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 6b25be490e..cfdc172fd1 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -28,7 +28,6 @@ </method> </methods> <members> - <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" /> <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" /> </members> <signals> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index efa881591c..4f6ef76c4c 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -78,8 +78,11 @@ <param index="0" name="property" type="String" /> <param index="1" name="editor" type="Control" /> <param index="2" name="add_to_end" type="bool" default="false" /> + <param index="3" name="label" type="String" default="""" /> <description> Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty]. + There can be multiple property editors for a property. If [param add_to_end] is [code]true[/code], this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is [code]false[/code]. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor. + [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead. </description> </method> <method name="add_property_editor_for_multiple_properties"> diff --git a/doc/classes/EditorPaths.xml b/doc/classes/EditorPaths.xml index 94ddb37658..f57e728c93 100644 --- a/doc/classes/EditorPaths.xml +++ b/doc/classes/EditorPaths.xml @@ -17,7 +17,7 @@ <description> Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails). [b]Default paths per platform:[/b] - [codeblock] + [codeblock lang=text] - Windows: %LOCALAPPDATA%\Godot\ - macOS: ~/Library/Caches/Godot/ - Linux: ~/.cache/godot/ @@ -29,7 +29,7 @@ <description> Returns the absolute path to the user's configuration folder. This folder should be used for [i]persistent[/i] user configuration files. [b]Default paths per platform:[/b] - [codeblock] + [codeblock lang=text] - Windows: %APPDATA%\Godot\ (same as `get_data_dir()`) - macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`) - Linux: ~/.config/godot/ @@ -41,7 +41,7 @@ <description> Returns the absolute path to the user's data folder. This folder should be used for [i]persistent[/i] user data files such as installed export templates. [b]Default paths per platform:[/b] - [codeblock] + [codeblock lang=text] - Windows: %APPDATA%\Godot\ (same as `get_config_dir()`) - macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`) - Linux: ~/.local/share/godot/ diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index e874b44cfc..89b9e7d6c2 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -727,6 +727,14 @@ Removes a callback previously added by [method add_undo_redo_inspector_hook_callback]. </description> </method> + <method name="set_dock_tab_icon"> + <return type="void" /> + <param index="0" name="control" type="Control" /> + <param index="1" name="icon" type="Texture2D" /> + <description> + Sets the tab icon for the given control in a dock slot. Setting to [code]null[/code] removes the icon. + </description> + </method> <method name="set_force_draw_over_forwarding_enabled"> <return type="void" /> <description> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 573171b7e1..e0a14e990b 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -384,15 +384,15 @@ <member name="editors/3d/selection_box_color" type="Color" setter="" getter=""> The color to use for the selection box that surrounds selected nodes in the 3D editor viewport. The color's alpha channel influences the selection box's opacity. </member> + <member name="editors/3d_gizmos/gizmo_colors/aabb" type="Color" setter="" getter=""> + The color to use for the AABB gizmo that displays the [GeometryInstance3D]'s custom [AABB]. + </member> <member name="editors/3d_gizmos/gizmo_colors/instantiated" type="Color" setter="" getter=""> The color override to use for 3D editor gizmos if the [Node3D] in question is part of an instantiated scene file (from the perspective of the current scene). </member> <member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter=""> The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s. </member> - <member name="editors/3d_gizmos/gizmo_colors/shape" type="Color" setter="" getter=""> - The 3D editor gizmo color for [CollisionShape3D]s, [VehicleWheel3D]s, [RayCast3D]s and [SpringArm3D]s. - </member> <member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter=""> If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock. </member> @@ -632,6 +632,9 @@ If set to [b]Auto[/b], the editor scale is automatically determined based on the screen resolution and reported display DPI. This heuristic is not always ideal, which means you can get better results by setting the editor scale manually. If set to [b]Custom[/b], the scaling value in [member interface/editor/custom_display_scale] will be used. </member> + <member name="interface/editor/dock_tab_style" type="int" setter="" getter=""> + Tab style of editor docks. + </member> <member name="interface/editor/editor_language" type="String" setter="" getter=""> The language to use for the editor interface. Translations are provided by the community. If you spot a mistake, [url=$DOCS_URL/contributing/documentation/editor_and_docs_localization.html]contribute to editor translations on Weblate![/url] @@ -646,6 +649,9 @@ <member name="interface/editor/font_antialiasing" type="int" setter="" getter=""> FreeType's font anti-aliasing mode used to render the editor fonts. Most fonts are not designed to look good with anti-aliasing disabled, so it's recommended to leave this enabled unless you're using a pixel art font. </member> + <member name="interface/editor/font_disable_embedded_bitmaps" type="bool" setter="" getter=""> + If set to [code]true[/code], embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property). + </member> <member name="interface/editor/font_hinting" type="int" setter="" getter=""> The font hinting mode to use for the editor fonts. FreeType supports the following font hinting modes: - [b]None:[/b] Don't use font hinting when rasterizing the font. This results in a smooth font, but it can look blurry. @@ -656,6 +662,9 @@ <member name="interface/editor/font_subpixel_positioning" type="int" setter="" getter=""> The subpixel positioning mode to use when rendering editor font glyphs. This affects both the main and code fonts. [b]Disabled[/b] is the fastest to render and uses the least memory. [b]Auto[/b] only uses subpixel positioning for small font sizes (where the benefit is the most noticeable). [b]One Half of a Pixel[/b] and [b]One Quarter of a Pixel[/b] force the same subpixel positioning mode for all editor fonts, regardless of their size (with [b]One Quarter of a Pixel[/b] being the highest-quality option). </member> + <member name="interface/editor/import_resources_when_unfocused" type="bool" setter="" getter=""> + If [code]true[/code], (re)imports resources even if the editor window is unfocused or minimized. If [code]false[/code], resources are only (re)imported when the editor window is focused. This can be set to [code]true[/code] to speed up iteration by starting the import process earlier when saving files in the project folder. This also allows getting visual feedback on changes without having to click the editor window, which is useful with multi-monitor setups. The downside of setting this to [code]true[/code] is that it increases idle CPU usage and may steal CPU time from other applications when importing resources. + </member> <member name="interface/editor/localize_settings" type="bool" setter="" getter=""> If [code]true[/code], setting names in the editor are localized when possible. [b]Note:[/b] This setting affects most [EditorInspector]s in the editor UI, primarily Project Settings and Editor Settings. To control names displayed in the Inspector dock, use [member interface/inspector/default_property_name_style] instead. @@ -744,6 +753,10 @@ - [b]Localized:[/b] Displays the localized string for the current editor language if a translation is available for the given property. If no translation is available, falls back to [b]Capitalized[/b]. [b]Note:[/b] To display translated setting names in Project Settings and Editor Settings, use [member interface/editor/localize_settings] instead. </member> + <member name="interface/inspector/delimitate_all_container_and_resources" type="bool" setter="" getter=""> + If [code]true[/code], add a margin around Array, Dictionary, and Resource Editors that are not already colored. + [b]Note:[/b] If [member interface/inspector/nested_color_mode] is set to [b]Containers & Resources[/b] this parameter will have no effect since those editors will already be colored + </member> <member name="interface/inspector/disable_folding" type="bool" setter="" getter=""> If [code]true[/code], forces all property groups to be expanded in the Inspector dock and prevents collapsing them. </member> @@ -759,6 +772,12 @@ <member name="interface/inspector/max_array_dictionary_items_per_page" type="int" setter="" getter=""> The number of [Array] or [Dictionary] items to display on each "page" in the inspector. Higher values allow viewing more values per page, but take more time to load. This increased load time is noticeable when selecting nodes that have array or dictionary properties in the editor. </member> + <member name="interface/inspector/nested_color_mode" type="int" setter="" getter=""> + Control which property editors are colored when they are opened. + - [b]Containers & Resources:[/b] Color all Array, Dictionary, and Resource Editors. + - [b]Resources:[/b] Color all Resource Editors. + - [b]External Resources:[/b] Color Resource Editors that edits an external resource. + </member> <member name="interface/inspector/open_resources_in_current_inspector" type="bool" setter="" getter=""> If [code]true[/code], subresources can be edited in the current inspector view. If the resource type is defined in [member interface/inspector/resources_to_open_in_new_inspector] or if this setting is [code]false[/code], attempting to edit a subresource always opens a new inspector view. </member> @@ -830,7 +849,7 @@ <member name="interface/theme/icon_and_font_color" type="int" setter="" getter=""> The icon and font color scheme to use in the editor. - [b]Auto[/b] determines the color scheme to use automatically based on [member interface/theme/base_color]. - - [b]Dark[/b] makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following the set of rules defined in [url=https://github.com/godotengine/godot/blob/master/editor/editor_themes.cpp]this file[/url]. + - [b]Dark[/b] makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following the set of rules defined in [url=https://github.com/godotengine/godot/blob/master/editor/themes/editor_theme_manager.cpp]this file[/url]. - [b]Light[/b] makes fonts and icons light (suitable for dark themes). </member> <member name="interface/theme/icon_saturation" type="float" setter="" getter=""> @@ -866,8 +885,16 @@ Specify the multiplier to apply to the scale for the editor gizmo handles to improve usability on touchscreen devices. [b]Note:[/b] Defaults to [code]1[/code] on non-touchscreen devices. </member> + <member name="network/connection/engine_version_update_mode" type="int" setter="" getter=""> + Specifies how the engine should check for updates. + - [b]Disable Update Checks[/b] will block the engine from checking updates (see also [member network/connection/network_mode]). + - [b]Check Newest Preview[/b] (default for preview versions) will check for the newest available development snapshot. + - [b]Check Newest Stable[/b] (default for stable versions) will check for the newest available stable version. + - [b]Check Newest Patch[/b] will check for the latest available stable version, but only within the same minor version. E.g. if your version is [code]4.3.stable[/code], you will be notified about [code]4.3.1.stable[/code], but not [code]4.4.stable[/code]. + All update modes will ignore builds with different major versions (e.g. Godot 4 -> Godot 5). + </member> <member name="network/connection/network_mode" type="int" setter="" getter=""> - Determines whether online features are enabled in the editor, such as the Asset Library. Setting this property to "Offline" is recommended to limit editor's internet activity, especially if privacy is a concern. + Determines whether online features are enabled in the editor, such as the Asset Library or update checks. Disabling these online features helps alleviate privacy concerns by preventing the editor from making HTTP requests to the Godot website or third-party platforms hosting assets from the Asset Library. </member> <member name="network/debug/remote_host" type="String" setter="" getter=""> The address to listen to when starting the remote debugger. This can be set to [code]0.0.0.0[/code] to allow external clients to connect to the remote debugger (instead of restricting the remote debugger to connections from [code]localhost[/code]). @@ -898,18 +925,21 @@ <member name="run/auto_save/save_before_running" type="bool" setter="" getter=""> If [code]true[/code], saves all scenes and scripts automatically before running the project. Setting this to [code]false[/code] prevents the editor from saving if there are no changes which can speed up the project startup slightly, but it makes it possible to run a project that has unsaved changes. (Unsaved changes will not be visible in the running project.) </member> - <member name="run/output/always_clear_output_on_play" type="bool" setter="" getter=""> - If [code]true[/code], the editor will clear the Output panel when running the project. + <member name="run/bottom_panel/action_on_play" type="int" setter="" getter=""> + The action to execute on the bottom panel when running the project. </member> - <member name="run/output/always_close_output_on_stop" type="bool" setter="" getter=""> - If [code]true[/code], the editor will collapse the Output panel when stopping the project. + <member name="run/bottom_panel/action_on_stop" type="int" setter="" getter=""> + The action to execute on the bottom panel when stopping the project. </member> - <member name="run/output/always_open_output_on_play" type="bool" setter="" getter=""> - If [code]true[/code], the editor will expand the Output panel when running the project. + <member name="run/output/always_clear_output_on_play" type="bool" setter="" getter=""> + If [code]true[/code], the editor will clear the Output panel when running the project. </member> <member name="run/output/font_size" type="int" setter="" getter=""> The size of the font in the [b]Output[/b] panel at the bottom of the editor. This setting does not impact the font size of the script editor (see [member interface/editor/code_font_size]). </member> + <member name="run/output/max_lines" type="int" setter="" getter=""> + Maximum number of lines to show at any one time in the Output panel. + </member> <member name="run/platforms/linuxbsd/prefer_wayland" type="bool" setter="" getter=""> If [code]true[/code], on Linux/BSD, the editor will check for Wayland first instead of X11 (if available). </member> @@ -998,6 +1028,9 @@ <member name="text_editor/behavior/files/restore_scripts_on_load" type="bool" setter="" getter=""> If [code]true[/code], reopens scripts that were opened in the last session when the editor is reopened on a given project. </member> + <member name="text_editor/behavior/files/trim_final_newlines_on_save" type="bool" setter="" getter=""> + If [code]true[/code], trims all empty newlines after the final newline when saving a script. Final newlines refer to the empty newlines found at the end of files. Since these serve no practical purpose, they can and should be removed to make version control diffs less noisy. + </member> <member name="text_editor/behavior/files/trim_trailing_whitespace_on_save" type="bool" setter="" getter=""> If [code]true[/code], trims trailing whitespace when saving a script. Trailing whitespace refers to tab and space characters placed at the end of lines. Since these serve no practical purpose, they can and should be removed to make version control diffs less noisy. </member> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 189517c392..c28476aa3c 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -13,9 +13,8 @@ <tutorials> <link title="Environment and post-processing">$DOCS_URL/tutorials/3d/environment_and_post_processing.html</link> <link title="High dynamic range lighting">$DOCS_URL/tutorials/3d/high_dynamic_range.html</link> - <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> - <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="get_glow_level" qualifiers="const"> diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml index fad6cbcc93..99574da808 100644 --- a/doc/classes/FileAccess.xml +++ b/doc/classes/FileAccess.xml @@ -8,23 +8,23 @@ Here's a sample on how to write and read from a file: [codeblocks] [gdscript] - func save(content): + func save_to_file(content): var file = FileAccess.open("user://save_game.dat", FileAccess.WRITE) file.store_string(content) - func load(): + func load_from_file(): var file = FileAccess.open("user://save_game.dat", FileAccess.READ) var content = file.get_as_text() return content [/gdscript] [csharp] - public void Save(string content) + public void SaveToFile(string content) { using var file = FileAccess.Open("user://save_game.dat", FileAccess.ModeFlags.Write); file.StoreString(content); } - public string Load() + public string LoadFromFile() { using var file = FileAccess.Open("user://save_game.dat", FileAccess.ModeFlags.Read); string content = file.GetAsText(); @@ -40,7 +40,7 @@ <tutorials> <link title="File system">$DOCS_URL/tutorials/scripting/filesystem.html</link> <link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="close"> @@ -131,7 +131,7 @@ Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long, and cannot be a double quotation mark. Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. For example, the following CSV lines are valid and will be properly parsed as two strings each: - [codeblock] + [codeblock lang=text] Alice,"Hello, Bob!" Bob,Alice! What a surprise! Alice,"I thought you'd reply with ""Hello, world""." @@ -190,7 +190,7 @@ <method name="get_line" qualifiers="const"> <return type="String" /> <description> - Returns the next line of the file as a [String]. + Returns the next line of the file as a [String]. The returned string doesn't include newline ([code]\n[/code]) or carriage return ([code]\r[/code]) characters, but does include any other leading or trailing whitespace. Text is interpreted as being UTF-8 encoded. </description> </method> @@ -324,6 +324,13 @@ Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that occurred. </description> </method> + <method name="resize"> + <return type="int" enum="Error" /> + <param index="0" name="length" type="int" /> + <description> + Resizes the file to a specified length. The file must be open in a mode that permits writing. If the file is extended, NUL characters are appended. If the file is truncated, all data from the end file to the original length of the file is lost. + </description> + </method> <method name="seek"> <return type="void" /> <param index="0" name="position" type="int" /> diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml index 9028dd4b9f..b3dc51ffaa 100644 --- a/doc/classes/FileSystemDock.xml +++ b/doc/classes/FileSystemDock.xml @@ -51,6 +51,11 @@ Emitted when a file is moved from [param old_file] path to [param new_file] path. </description> </signal> + <signal name="folder_color_changed"> + <description> + Emitted when folders change color. + </description> + </signal> <signal name="folder_moved"> <param index="0" name="old_folder" type="String" /> <param index="1" name="new_folder" type="String" /> diff --git a/doc/classes/FlowContainer.xml b/doc/classes/FlowContainer.xml index 5e767acf7d..2839143960 100644 --- a/doc/classes/FlowContainer.xml +++ b/doc/classes/FlowContainer.xml @@ -21,6 +21,9 @@ <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="FlowContainer.AlignmentMode" default="0"> The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). </member> + <member name="last_wrap_alignment" type="int" setter="set_last_wrap_alignment" getter="get_last_wrap_alignment" enum="FlowContainer.LastWrapAlignmentMode" default="0"> + The wrap behavior of the last, partially filled row or column (must be one of [constant LAST_WRAP_ALIGNMENT_INHERIT], [constant LAST_WRAP_ALIGNMENT_BEGIN], [constant LAST_WRAP_ALIGNMENT_CENTER], or [constant LAST_WRAP_ALIGNMENT_END]). + </member> <member name="reverse_fill" type="bool" setter="set_reverse_fill" getter="is_reverse_fill" default="false"> If [code]true[/code], reverses fill direction. Horizontal [FlowContainer]s will fill rows bottom to top, vertical [FlowContainer]s will fill columns right to left. When using a vertical [FlowContainer] with a right to left [member Control.layout_direction], columns will fill left to right instead. @@ -40,6 +43,18 @@ <constant name="ALIGNMENT_END" value="2" enum="AlignmentMode"> The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). </constant> + <constant name="LAST_WRAP_ALIGNMENT_INHERIT" value="0" enum="LastWrapAlignmentMode"> + The last partially filled row or column will wrap aligned to the previous row or column in accordance with [member alignment]. + </constant> + <constant name="LAST_WRAP_ALIGNMENT_BEGIN" value="1" enum="LastWrapAlignmentMode"> + The last partially filled row or column will wrap aligned to the beginning of the previous row or column. + </constant> + <constant name="LAST_WRAP_ALIGNMENT_CENTER" value="2" enum="LastWrapAlignmentMode"> + The last partially filled row or column will wrap aligned to the center of the previous row or column. + </constant> + <constant name="LAST_WRAP_ALIGNMENT_END" value="3" enum="LastWrapAlignmentMode"> + The last partially filled row or column will wrap aligned to the end of the previous row or column. + </constant> </constants> <theme_items> <theme_item name="h_separation" data_type="constant" type="int" default="4"> diff --git a/doc/classes/GDExtensionManager.xml b/doc/classes/GDExtensionManager.xml index 1ecb23a03b..211bc023c0 100644 --- a/doc/classes/GDExtensionManager.xml +++ b/doc/classes/GDExtensionManager.xml @@ -43,7 +43,7 @@ <return type="int" enum="GDExtensionManager.LoadStatus" /> <param index="0" name="path" type="String" /> <description> - Reloads the extension at the given file path. The [param path] needs to point to a valid [GDExtension], otherwise this method may return either [constant LOAD_STATUS_NOT_LOADED] or [constant LOAD_STATUS_FAILED]. + Reloads the extension at the given file path. The [param path] needs to point to a valid [GDExtension], otherwise this method may return either [constant LOAD_STATUS_NOT_LOADED] or [constant LOAD_STATUS_FAILED]. [b]Note:[/b] You can only reload extensions in the editor. In release builds, this method always fails and returns [constant LOAD_STATUS_FAILED]. </description> </method> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index f4ba305f8b..3c48f5ba31 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -10,8 +10,8 @@ </description> <tutorials> <link title="Particle systems (2D)">$DOCS_URL/tutorials/2d/particle_systems_2d.html</link> - <link title="2D Particles Demo">https://godotengine.org/asset-library/asset/118</link> - <link title="2D Dodge The Creeps Demo (uses GPUParticles2D for the trail behind the player)">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Particles Demo">https://godotengine.org/asset-library/asset/2724</link> + <link title="2D Dodge The Creeps Demo (uses GPUParticles2D for the trail behind the player)">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="capture_rect" qualifiers="const"> @@ -43,7 +43,8 @@ <method name="restart"> <return type="void" /> <description> - Restarts all the existing particles. + Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. + [b]Note:[/b] The [signal finished] signal is only emitted by [member one_shot] emitters. </description> </method> </methods> @@ -64,7 +65,9 @@ Particle draw order. Uses [enum DrawOrder] values. </member> <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true"> - If [code]true[/code], particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is [code]true[/code] setting [member emitting] to [code]true[/code] will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. + If [code]true[/code], particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is [code]true[/code] setting [member emitting] to [code]true[/code] will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. + [b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to [code]true[/code] will not restart the emission cycle. + [b]Tip:[/b] If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. </member> <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0"> How rapidly particles in an emission cycle are emitted. If greater than [code]0[/code], there will be a gap in emissions before the next cycle begins. @@ -132,8 +135,9 @@ <signals> <signal name="finished"> <description> - Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. - [b]Note:[/b] Due to the particles being computed on the GPU there might be a delay before the signal gets emitted. + Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart]. + Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. + [b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to [code]true[/code] will not restart the emission cycle. This delay is avoided by instead calling [method restart]. </description> </signal> </signals> diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index d1903b85cd..61a3b467f1 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -10,7 +10,7 @@ <tutorials> <link title="Particle systems (3D)">$DOCS_URL/tutorials/3d/particles/index.html</link> <link title="Controlling thousands of fish with Particles">$DOCS_URL/tutorials/performance/vertex_animation/controlling_thousands_of_fish.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="capture_aabb" qualifiers="const"> @@ -48,7 +48,8 @@ <method name="restart"> <return type="void" /> <description> - Restarts the particle emission, clearing existing particles. + Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. + [b]Note:[/b] The [signal finished] signal is only emitted by [member one_shot] emitters. </description> </method> <method name="set_draw_pass_mesh"> @@ -95,7 +96,9 @@ <member name="draw_skin" type="Skin" setter="set_skin" getter="get_skin"> </member> <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true"> - If [code]true[/code], particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is [code]true[/code] setting [member emitting] to [code]true[/code] will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. + If [code]true[/code], particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is [code]true[/code] setting [member emitting] to [code]true[/code] will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. + [b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to [code]true[/code] will not restart the emission cycle. + [b]Tip:[/b] If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. </member> <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0"> Time ratio between each emission. If [code]0[/code], particles are emitted continuously. If [code]1[/code], all particles are emitted simultaneously. @@ -157,8 +160,9 @@ <signals> <signal name="finished"> <description> - Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. - [b]Note:[/b] Due to the particles being computed on the GPU there might be a delay before the signal gets emitted. + Emitted when all active particles have finished processing. To immediately emit new particles, call [method restart]. + Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. + [b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to [code]true[/code] will not restart the emission cycle. This delay is avoided by instead calling [method restart]. </description> </signal> </signals> diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index dfcf299fe6..f21696d02c 100644 --- a/doc/classes/Geometry2D.xml +++ b/doc/classes/Geometry2D.xml @@ -116,6 +116,7 @@ <param index="0" name="polygon" type="PackedVector2Array" /> <description> Returns [code]true[/code] if [param polygon]'s vertices are ordered in clockwise order, otherwise returns [code]false[/code]. + [b]Note:[/b] Assumes a Cartesian coordinate system where [code]+x[/code] is right and [code]+y[/code] is up. If using screen coordinates ([code]+y[/code] is down), the result will need to be flipped (i.e. a [code]true[/code] result will indicate counter-clockwise). </description> </method> <method name="line_intersects_line"> diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index e52a3d7683..f4075af186 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -66,6 +66,7 @@ The transparency applied to the whole geometry (as a multiplier of the materials' existing transparency). [code]0.0[/code] is fully opaque, while [code]1.0[/code] is fully transparent. Values greater than [code]0.0[/code] (exclusive) will force the geometry's materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting [member transparency] to a value greater than [code]0.0[/code] (exclusive) will [i]not[/i] disable shadow rendering. In spatial shaders, [code]1.0 - transparency[/code] is set as the default value of the [code]ALPHA[/code] built-in. [b]Note:[/b] [member transparency] is clamped between [code]0.0[/code] and [code]1.0[/code], so this property cannot be used to make transparent materials more opaque than they originally are. + [b]Note:[/b] Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, [member transparency] is ignored and is considered as always being [code]0.0[/code]. </member> <member name="visibility_range_begin" type="float" setter="set_visibility_range_begin" getter="get_visibility_range_begin" default="0.0" keywords="lod_begin, hlod_begin"> Starting distance from which the GeometryInstance3D will be visible, taking [member visibility_range_begin_margin] into account as well. The default value of 0 is used to disable the range check. @@ -130,9 +131,11 @@ </constant> <constant name="VISIBILITY_RANGE_FADE_SELF" value="1" enum="VisibilityRangeFadeMode"> Will fade-out itself when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. + [b]Note:[/b] Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [constant VISIBILITY_RANGE_FADE_DISABLED] but with hysteresis disabled. </constant> <constant name="VISIBILITY_RANGE_FADE_DEPENDENCIES" value="2" enum="VisibilityRangeFadeMode"> Will fade-in its visibility dependencies (see [member Node3D.visibility_parent]) when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. + [b]Note:[/b] Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [constant VISIBILITY_RANGE_FADE_DISABLED] but with hysteresis disabled. </constant> </constants> </class> diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index c7fa1f40e0..c85b3acafa 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -78,8 +78,8 @@ </methods> <members> <member name="colors" type="PackedColorArray" setter="set_colors" getter="get_colors" default="PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1)"> - Gradient's colors returned as a [PackedColorArray]. - [b]Note:[/b] This property returns a copy, modifying the return value does not update the gradient. To update the gradient use [method set_color] method (for updating colors individually) or assign to this property directly (for bulk-updating all colors at once). + Gradient's colors as a [PackedColorArray]. + [b]Note:[/b] Setting this property updates all colors at once. To update any color individually use [method set_color]. </member> <member name="interpolation_color_space" type="int" setter="set_interpolation_color_space" getter="get_interpolation_color_space" enum="Gradient.ColorSpace" default="0"> The color space used to interpolate between points of the gradient. It does not affect the returned colors, which will always be in sRGB space. See [enum ColorSpace] for available modes. @@ -89,8 +89,8 @@ The algorithm used to interpolate between points of the gradient. See [enum InterpolationMode] for available modes. </member> <member name="offsets" type="PackedFloat32Array" setter="set_offsets" getter="get_offsets" default="PackedFloat32Array(0, 1)"> - Gradient's offsets returned as a [PackedFloat32Array]. - [b]Note:[/b] This property returns a copy, modifying the return value does not update the gradient. To update the gradient use [method set_offset] method (for updating offsets individually) or assign to this property directly (for bulk-updating all offsets at once). + Gradient's offsets as a [PackedFloat32Array]. + [b]Note:[/b] Setting this property updates all offsets at once. To update any offset individually use [method set_offset]. </member> </members> <constants> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index ad1028d7f4..cc3acad6d6 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -267,6 +267,9 @@ </method> </methods> <members> + <member name="ignore_invalid_connection_type" type="bool" setter="set_ignore_invalid_connection_type" getter="is_ignoring_valid_connection_type" default="false"> + If [code]true[/code], you can connect ports with different types, even if the connection was not explicitly allowed in the parent [GraphEdit]. + </member> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" /> <member name="title" type="String" setter="set_title" getter="get_title" default=""""> The text displayed in the GraphNode's title bar. diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index d69f4a10d2..76f789a058 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -9,7 +9,7 @@ </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <members> <member name="columns" type="int" setter="set_columns" getter="get_columns" default="1"> diff --git a/doc/classes/HingeJoint3D.xml b/doc/classes/HingeJoint3D.xml index d150c79b78..f794853caf 100644 --- a/doc/classes/HingeJoint3D.xml +++ b/doc/classes/HingeJoint3D.xml @@ -53,7 +53,7 @@ <member name="angular_limit/relaxation" type="float" setter="set_param" getter="get_param" default="1.0"> The lower this value, the more the rotation gets slowed down. </member> - <member name="angular_limit/softness" type="float" setter="set_param" getter="get_param" default="0.9"> + <member name="angular_limit/softness" type="float" setter="set_param" getter="get_param" default="0.9" deprecated="This property is never set by the engine and is kept for compatibility purposes."> </member> <member name="angular_limit/upper" type="float" setter="set_param" getter="get_param" default="1.5708"> The maximum rotation. Only active if [member angular_limit/enable] is [code]true[/code]. @@ -84,7 +84,7 @@ <constant name="PARAM_LIMIT_BIAS" value="3" enum="Param"> The speed with which the rotation across the axis perpendicular to the hinge gets corrected. </constant> - <constant name="PARAM_LIMIT_SOFTNESS" value="4" enum="Param"> + <constant name="PARAM_LIMIT_SOFTNESS" value="4" enum="Param" deprecated="This property is never used by the engine and is kept for compatibility purpose."> </constant> <constant name="PARAM_LIMIT_RELAXATION" value="5" enum="Param"> The lower this value, the more the rotation gets slowed down. diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index e622a6bce3..642bb76e75 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -9,8 +9,8 @@ </description> <tutorials> <link title="Inputs documentation index">$DOCS_URL/tutorials/inputs/index.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="action_press"> @@ -397,11 +397,14 @@ <method name="vibrate_handheld"> <return type="void" /> <param index="0" name="duration_ms" type="int" default="500" /> + <param index="1" name="amplitude" type="float" default="-1.0" /> <description> + [b]Note:[/b] While [code skip-lint]amplitude[/code] expects a value between 0 and 1, -1 does the default amplitude for the device. Vibrate the handheld device for the specified duration in milliseconds. [b]Note:[/b] This method is implemented on Android, iOS, and Web. It has no effect on other platforms. [b]Note:[/b] For Android, [method vibrate_handheld] requires enabling the [code]VIBRATE[/code] permission in the export preset. Otherwise, [method vibrate_handheld] will have no effect. [b]Note:[/b] For iOS, specifying the duration is only supported in iOS 13 and later. + [b]Note:[/b] For Web, the amplitude cannot be changed. [b]Note:[/b] Some web browsers such as Safari and Firefox for Android do not support [method vibrate_handheld]. </description> </method> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 96a4612466..6f2e6aac20 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -9,8 +9,8 @@ <tutorials> <link title="Using InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="accumulate"> diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml index 1fe4cfcd79..4715f9fe95 100644 --- a/doc/classes/InputEventAction.xml +++ b/doc/classes/InputEventAction.xml @@ -9,8 +9,8 @@ </description> <tutorials> <link title="Using InputEvent: Actions">$DOCS_URL/tutorials/inputs/inputevent.html#actions</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="action" type="StringName" setter="set_action" getter="get_action" default="&"""> diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml index 7b6fc3f216..dc4872ba03 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -66,7 +66,7 @@ Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character. For keyboard layouts with a single label on the key, it is equivalent to [member keycode]. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.key_label)[/code] where [code]event[/code] is the [InputEventKey]. - [codeblock] + [codeblock lang=text] +-----+ +-----+ | Q | | Q | - "Q" - keycode | Й | | ض | - "Й" and "ض" - key_label @@ -76,7 +76,7 @@ <member name="keycode" type="int" setter="set_keycode" getter="get_keycode" enum="Key" default="0"> Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey]. - [codeblock] + [codeblock lang=text] +-----+ +-----+ | Q | | Q | - "Q" - keycode | Й | | ض | - "Й" and "ض" - key_label diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index e6ec674975..98a0221fe8 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -10,7 +10,7 @@ <tutorials> <link title="Using InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link> <link title="Mouse and input coordinates">$DOCS_URL/tutorials/inputs/mouse_and_input_coordinates.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="pen_inverted" type="bool" setter="set_pen_inverted" getter="get_pen_inverted" default="false"> diff --git a/doc/classes/JSONRPC.xml b/doc/classes/JSONRPC.xml index 348688f7f8..e5ee93cb93 100644 --- a/doc/classes/JSONRPC.xml +++ b/doc/classes/JSONRPC.xml @@ -79,15 +79,19 @@ </methods> <constants> <constant name="PARSE_ERROR" value="-32700" enum="ErrorCode"> + The request could not be parsed as it was not valid by JSON standard ([method JSON.parse] failed). </constant> <constant name="INVALID_REQUEST" value="-32600" enum="ErrorCode"> + A method call was requested but the request's format is not valid. </constant> <constant name="METHOD_NOT_FOUND" value="-32601" enum="ErrorCode"> A method call was requested but no function of that name existed in the JSONRPC subclass. </constant> <constant name="INVALID_PARAMS" value="-32602" enum="ErrorCode"> + A method call was requested but the given method parameters are not valid. Not used by the built-in JSONRPC. </constant> <constant name="INTERNAL_ERROR" value="-32603" enum="ErrorCode"> + An internal error occurred while processing the request. Not used by the built-in JSONRPC. </constant> </constants> </class> diff --git a/doc/classes/JavaClass.xml b/doc/classes/JavaClass.xml index 541f23013d..ecfcaa8781 100644 --- a/doc/classes/JavaClass.xml +++ b/doc/classes/JavaClass.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="JavaClass" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Represents an object from the Java Native Interface. </brief_description> <description> + Represents an object from the Java Native Interface. It is returned from [method JavaClassWrapper.wrap]. + [b]Note:[/b] This class only works on Android. For any other build, this class does nothing. + [b]Note:[/b] This class is not to be confused with [JavaScriptObject]. </description> <tutorials> </tutorials> diff --git a/doc/classes/JavaClassWrapper.xml b/doc/classes/JavaClassWrapper.xml index e197b1e97e..01c3392b04 100644 --- a/doc/classes/JavaClassWrapper.xml +++ b/doc/classes/JavaClassWrapper.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="JavaClassWrapper" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Provides access to the Java Native Interface. </brief_description> <description> + The JavaClassWrapper singleton provides a way for the Godot application to send and receive data through the [url=https://developer.android.com/training/articles/perf-jni]Java Native Interface[/url] (JNI). + [b]Note:[/b] This singleton is only available in Android builds. </description> <tutorials> </tutorials> @@ -11,6 +14,8 @@ <return type="JavaClass" /> <param index="0" name="name" type="String" /> <description> + Wraps a class defined in Java, and returns it as a [JavaClass] [Object] type that Godot can interact with. + [b]Note:[/b] This method only works on Android. On every other platform, this method does nothing and returns an empty [JavaClass]. </description> </method> </methods> diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml index af0a54815f..0099c76d08 100644 --- a/doc/classes/Joint2D.xml +++ b/doc/classes/Joint2D.xml @@ -4,7 +4,7 @@ Abstract base class for all 2D physics joints. </brief_description> <description> - Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies and apply a constraint. + Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies ([member node_a] and [member node_b]) and apply a constraint. </description> <tutorials> </tutorials> @@ -12,7 +12,7 @@ <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> - Returns the joint's [RID]. + Returns the joint's internal [RID] from the [PhysicsServer2D]. </description> </method> </methods> @@ -22,13 +22,13 @@ When set to [code]0[/code], the default value from [member ProjectSettings.physics/2d/solver/default_constraint_bias] is used. </member> <member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true"> - If [code]true[/code], [member node_a] and [member node_b] can not collide. + If [code]true[/code], the two bodies bound together do not collide with each other. </member> <member name="node_a" type="NodePath" setter="set_node_a" getter="get_node_a" default="NodePath("")"> - The first body attached to the joint. Must derive from [PhysicsBody2D]. + Path to the first body (A) attached to the joint. The node must inherit [PhysicsBody2D]. </member> <member name="node_b" type="NodePath" setter="set_node_b" getter="get_node_b" default="NodePath("")"> - The second body attached to the joint. Must derive from [PhysicsBody2D]. + Path to the second body (B) attached to the joint. The node must inherit [PhysicsBody2D]. </member> </members> </class> diff --git a/doc/classes/Joint3D.xml b/doc/classes/Joint3D.xml index 9e0b753701..950129806a 100644 --- a/doc/classes/Joint3D.xml +++ b/doc/classes/Joint3D.xml @@ -4,28 +4,30 @@ Abstract base class for all 3D physics joints. </brief_description> <description> - Abstract base class for all joints in 3D physics. 3D joints bind together two physics bodies and apply a constraint. + Abstract base class for all joints in 3D physics. 3D joints bind together two physics bodies ([member node_a] and [member node_b]) and apply a constraint. If only one body is defined, it is attached to a fixed [StaticBody3D] without collision shapes. </description> <tutorials> - <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> + <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/2752</link> </tutorials> <methods> <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> - Returns the joint's [RID]. + Returns the joint's internal [RID] from the [PhysicsServer3D]. </description> </method> </methods> <members> <member name="exclude_nodes_from_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true"> - If [code]true[/code], the two bodies of the nodes are not able to collide with each other. + If [code]true[/code], the two bodies bound together do not collide with each other. </member> <member name="node_a" type="NodePath" setter="set_node_a" getter="get_node_a" default="NodePath("")"> - The node attached to the first side (A) of the joint. + Path to the first node (A) attached to the joint. The node must inherit [PhysicsBody3D]. + If left empty and [member node_b] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. </member> <member name="node_b" type="NodePath" setter="set_node_b" getter="get_node_b" default="NodePath("")"> - The node attached to the second side (B) of the joint. + Path to the second node (B) attached to the joint. The node must inherit [PhysicsBody3D]. + If left empty and [member node_a] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. </member> <member name="solver_priority" type="int" setter="set_solver_priority" getter="get_solver_priority" default="1"> The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index f39f5616f0..8acd05cbd1 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -7,7 +7,7 @@ A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use [RichTextLabel] instead. </description> <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_character_bounds" qualifiers="const"> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index bffa20bf23..bda5fb69de 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -9,7 +9,7 @@ <tutorials> <link title="3D lights and shadows">$DOCS_URL/tutorials/3d/lights_and_shadows.html</link> <link title="Faking global illumination">$DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="get_correlated_color" qualifiers="const"> @@ -199,7 +199,7 @@ </constant> <constant name="BAKE_DISABLED" value="0" enum="BakeMode"> Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. - [b]Note:[/b] Hiding a light does [i]not[/i] affect baking [LightmapGI]. Hiding a light will still affect baking [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled). + [b]Note:[/b] Hiding a light does [i]not[/i] affect baking [LightmapGI]. Hiding a light will still affect baking [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). </constant> <constant name="BAKE_STATIC" value="1" enum="BakeMode"> Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([member Environment.sdfgi_enabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off. diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index 13d48d8650..6fb15e4d21 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -28,6 +28,9 @@ <member name="camera_attributes" type="CameraAttributes" setter="set_camera_attributes" getter="get_camera_attributes"> The [CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the [LightmapGI] will have banding artifacts or may have over-exposure artifacts. </member> + <member name="denoiser_range" type="int" setter="set_denoiser_range" getter="get_denoiser_range" default="10"> + The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if [member use_denoiser] is [code]true[/code] and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. + </member> <member name="denoiser_strength" type="float" setter="set_denoiser_strength" getter="get_denoiser_strength" default="0.1"> The strength of denoising step applied to the generated lightmaps. Only effective if [member use_denoiser] is [code]true[/code] and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. </member> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index 283d847a93..a553e79746 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -9,8 +9,8 @@ [b]Note:[/b] [Line2D] is drawn using a 2D mesh. </description> <tutorials> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> - <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> + <link title="2.5D Game Demo">https://godotengine.org/asset-library/asset/2783</link> </tutorials> <methods> <method name="add_point"> diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index 87fa3fd676..4a73bc2271 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -8,8 +8,8 @@ Importantly, you can inherit from [Material] to create your own custom material type in script or in GDExtension. </description> <tutorials> - <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="_can_do_next_pass" qualifiers="virtual const"> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 3f8ed91ad7..6b5a50d97b 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -4,13 +4,13 @@ A [Resource] that contains vertex array-based geometry. </brief_description> <description> - Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. + Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. The maximum number of surfaces per mesh is [constant RenderingServer.MAX_MESH_SURFACES]. </description> <tutorials> - <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="_get_aabb" qualifiers="virtual const"> diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml index 4645435f55..abbb4c4eeb 100644 --- a/doc/classes/MeshInstance3D.xml +++ b/doc/classes/MeshInstance3D.xml @@ -7,12 +7,20 @@ MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reusing geometry, which can save on resources. When a [Mesh] has to be instantiated more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead. </description> <tutorials> - <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> + <method name="bake_mesh_from_current_blend_shape_mix"> + <return type="ArrayMesh" /> + <param index="0" name="existing" type="ArrayMesh" default="null" /> + <description> + Takes a snapshot from the current [ArrayMesh] with all blend shapes applied according to their current weights and bakes it to the provided [param existing] mesh. If no [param existing] mesh is provided a new [ArrayMesh] is created, baked and returned. Mesh surface materials are not copied. + [b]Performance:[/b] [Mesh] data needs to be received from the GPU, stalling the [RenderingServer] in the process. + </description> + </method> <method name="create_convex_collision"> <return type="void" /> <param index="0" name="clean" type="bool" default="true" /> @@ -70,6 +78,12 @@ Returns the value of the blend shape at the given [param blend_shape_idx]. Returns [code]0.0[/code] and produces an error if [member mesh] is [code]null[/code] or doesn't have a blend shape at that index. </description> </method> + <method name="get_skin_reference" qualifiers="const"> + <return type="SkinReference" /> + <description> + Returns the internal [SkinReference] containing the skeleton's [RID] attached to this RID. See also [method Resource.get_rid], [method SkinReference.get_skeleton], and [method RenderingServer.instance_attach_skeleton]. + </description> + </method> <method name="get_surface_override_material" qualifiers="const"> <return type="Material" /> <param index="0" name="surface" type="int" /> diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index f7099e569f..f65e29af8e 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -7,8 +7,8 @@ A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [GridMap]. </description> <tutorials> - <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> + <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> </tutorials> <methods> <method name="clear"> @@ -29,7 +29,7 @@ <return type="int" /> <param index="0" name="name" type="String" /> <description> - Returns the first item with the given name. + Returns the first item with the given name, or [code]-1[/code] if no item is found. </description> </method> <method name="get_item_list" qualifiers="const"> diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml index 04fd282457..edb2c39e24 100644 --- a/doc/classes/MultiplayerPeer.xml +++ b/doc/classes/MultiplayerPeer.xml @@ -10,7 +10,6 @@ </description> <tutorials> <link title="High-level multiplayer">$DOCS_URL/tutorials/networking/high_level_multiplayer.html</link> - <link title="WebRTC Signaling Demo">https://godotengine.org/asset-library/asset/537</link> </tutorials> <methods> <method name="close"> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index 132ece53b0..94c372106b 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -198,6 +198,13 @@ The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> + <member name="simplify_epsilon" type="float" setter="set_simplify_epsilon" getter="get_simplify_epsilon" default="0.0"> + The path simplification amount in worlds units. + </member> + <member name="simplify_path" type="bool" setter="set_simplify_path" getter="get_simplify_path" default="false"> + If [code]true[/code] a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="10.0"> The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). @@ -254,7 +261,7 @@ <signal name="velocity_computed"> <param index="0" name="safe_velocity" type="Vector2" /> <description> - Notifies when the collision avoidance velocity is calculated. Emitted when [member velocity] is set. Only emitted when [member avoidance_enabled] is true. + Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is [code]true[/code] and the agent has a navigation map. </description> </signal> <signal name="waypoint_reached"> diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index dd75cedf61..5f9f4991d1 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -204,6 +204,13 @@ The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> + <member name="simplify_epsilon" type="float" setter="set_simplify_epsilon" getter="get_simplify_epsilon" default="0.0"> + The path simplification amount in worlds units. + </member> + <member name="simplify_path" type="bool" setter="set_simplify_path" getter="get_simplify_path" default="false"> + If [code]true[/code] a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). @@ -264,7 +271,7 @@ <signal name="velocity_computed"> <param index="0" name="safe_velocity" type="Vector3" /> <description> - Notifies when the collision avoidance velocity is calculated. Emitted when [member velocity] is set. Only emitted when [member avoidance_enabled] is true. + Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is [code]true[/code] and the agent has a navigation map. </description> </signal> <signal name="waypoint_reached"> diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 42ef354bc8..8be8a89543 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -8,7 +8,7 @@ </description> <tutorials> <link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link> - <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link> + <link title="3D Navigation Demo">https://godotengine.org/asset-library/asset/2743</link> </tutorials> <methods> <method name="add_polygon"> diff --git a/doc/classes/NavigationMeshSourceGeometryData2D.xml b/doc/classes/NavigationMeshSourceGeometryData2D.xml index 609877fadc..1d8689420b 100644 --- a/doc/classes/NavigationMeshSourceGeometryData2D.xml +++ b/doc/classes/NavigationMeshSourceGeometryData2D.xml @@ -31,6 +31,20 @@ Adds the outline points of a shape as traversable area. </description> </method> + <method name="append_obstruction_outlines"> + <return type="void" /> + <param index="0" name="obstruction_outlines" type="PackedVector2Array[]" /> + <description> + Appends another array of [param obstruction_outlines] at the end of the existing obstruction outlines array. + </description> + </method> + <method name="append_traversable_outlines"> + <return type="void" /> + <param index="0" name="traversable_outlines" type="PackedVector2Array[]" /> + <description> + Appends another array of [param traversable_outlines] at the end of the existing traversable outlines array. + </description> + </method> <method name="clear"> <return type="void" /> <description> diff --git a/doc/classes/NavigationMeshSourceGeometryData3D.xml b/doc/classes/NavigationMeshSourceGeometryData3D.xml index 322e2e7c66..0b3126a63b 100644 --- a/doc/classes/NavigationMeshSourceGeometryData3D.xml +++ b/doc/classes/NavigationMeshSourceGeometryData3D.xml @@ -43,6 +43,14 @@ Adds a projected obstruction shape to the source geometry. The [param vertices] are considered projected on a xz-axes plane, placed at the global y-axis [param elevation] and extruded by [param height]. If [param carve] is [code]true[/code] the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process. </description> </method> + <method name="append_arrays"> + <return type="void" /> + <param index="0" name="vertices" type="PackedFloat32Array" /> + <param index="1" name="indices" type="PackedInt32Array" /> + <description> + Appends arrays of [param vertices] and [param indices] at the end of the existing arrays. Adds the existing index as an offset to the appended indices. + </description> + </method> <method name="clear"> <return type="void" /> <description> diff --git a/doc/classes/NavigationPathQueryParameters2D.xml b/doc/classes/NavigationPathQueryParameters2D.xml index 7d9ecf61b0..ce0a00bc83 100644 --- a/doc/classes/NavigationPathQueryParameters2D.xml +++ b/doc/classes/NavigationPathQueryParameters2D.xml @@ -25,6 +25,13 @@ <member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters2D.PathfindingAlgorithm" default="0"> The pathfinding algorithm used in the path query. </member> + <member name="simplify_epsilon" type="float" setter="set_simplify_epsilon" getter="get_simplify_epsilon" default="0.0"> + The path simplification amount in worlds units. + </member> + <member name="simplify_path" type="bool" setter="set_simplify_path" getter="get_simplify_path" default="false"> + If [code]true[/code] a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </member> <member name="start_position" type="Vector2" setter="set_start_position" getter="get_start_position" default="Vector2(0, 0)"> The pathfinding start position in global coordinates. </member> diff --git a/doc/classes/NavigationPathQueryParameters3D.xml b/doc/classes/NavigationPathQueryParameters3D.xml index 862f8a8347..fcd913f73b 100644 --- a/doc/classes/NavigationPathQueryParameters3D.xml +++ b/doc/classes/NavigationPathQueryParameters3D.xml @@ -25,6 +25,13 @@ <member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters3D.PathfindingAlgorithm" default="0"> The pathfinding algorithm used in the path query. </member> + <member name="simplify_epsilon" type="float" setter="set_simplify_epsilon" getter="get_simplify_epsilon" default="0.0"> + The path simplification amount in worlds units. + </member> + <member name="simplify_path" type="bool" setter="set_simplify_path" getter="get_simplify_path" default="false"> + If [code]true[/code] a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </member> <member name="start_position" type="Vector3" setter="set_start_position" getter="get_start_position" default="Vector3(0, 0, 0)"> The pathfinding start position in global coordinates. </member> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 9c4e8169b0..eebdc817a7 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -43,8 +43,8 @@ [/codeblocks] </description> <tutorials> - <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link> <link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link> + <link title="Navigation Polygon 2D Demo">https://godotengine.org/asset-library/asset/2722</link> </tutorials> <methods> <method name="add_outline"> diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml index c490620fc0..31ce1dba4a 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -23,13 +23,6 @@ Bakes the [NavigationPolygon]. If [param on_thread] is set to [code]true[/code] (default), the baking is done on a separate thread. </description> </method> - <method name="get_avoidance_layer_value" qualifiers="const"> - <return type="bool" /> - <param index="0" name="layer_number" type="int" /> - <description> - Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. - </description> - </method> <method name="get_navigation_layer_value" qualifiers="const"> <return type="bool" /> <param index="0" name="layer_number" type="int" /> @@ -61,14 +54,6 @@ Returns [code]true[/code] when the [NavigationPolygon] is being baked on a background thread. </description> </method> - <method name="set_avoidance_layer_value"> - <return type="void" /> - <param index="0" name="layer_number" type="int" /> - <param index="1" name="value" type="bool" /> - <description> - Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. - </description> - </method> <method name="set_navigation_layer_value"> <return type="void" /> <param index="0" name="layer_number" type="int" /> @@ -86,12 +71,6 @@ </method> </methods> <members> - <member name="avoidance_layers" type="int" setter="set_avoidance_layers" getter="get_avoidance_layers" default="1"> - A bitfield determining all avoidance layers for the avoidance constrain. - </member> - <member name="constrain_avoidance" type="bool" setter="set_constrain_avoidance" getter="get_constrain_avoidance" default="false" experimental="When enabled, agents are known to get stuck on the navigation polygon corners and edges, especially at a high frame rate. Not recommended for use in production at this stage."> - If [code]true[/code] constraints avoidance agent's with an avoidance mask bit that matches with a bit of the [member avoidance_layers] to the navigation polygon. Due to each navigation polygon outline creating an obstacle and each polygon edge creating an avoidance line constrain keep the navigation polygon shape as simple as possible for performance. - </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> Determines if the [NavigationRegion2D] is enabled or disabled. </member> diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index 91d69edf29..a0d03d7a01 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -14,8 +14,8 @@ This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. </description> <tutorials> - <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link> <link title="Using NavigationServer">$DOCS_URL/tutorials/navigation/navigation_using_navigationservers.html</link> + <link title="Navigation Polygon 2D Demo">https://godotengine.org/asset-library/asset/2722</link> </tutorials> <methods> <method name="agent_create"> @@ -947,6 +947,32 @@ If [code]true[/code] enables debug mode on the NavigationServer. </description> </method> + <method name="simplify_path"> + <return type="PackedVector2Array" /> + <param index="0" name="path" type="PackedVector2Array" /> + <param index="1" name="epsilon" type="float" /> + <description> + Returns a simplified version of [param path] with less critical path points removed. The simplification amount is in worlds units and controlled by [param epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </description> + </method> + <method name="source_geometry_parser_create"> + <return type="RID" /> + <description> + Creates a new source geometry parser. If a [Callable] is set for the parser with [method source_geometry_parser_set_callback] the callback will be called for every single node that gets parsed whenever [method parse_source_geometry_data] is used. + </description> + </method> + <method name="source_geometry_parser_set_callback"> + <return type="void" /> + <param index="0" name="parser" type="RID" /> + <param index="1" name="callback" type="Callable" /> + <description> + Sets the [param callback] [Callable] for the specific source geometry [param parser]. The [Callable] will receive a call with the following parameters: + - [code]navigation_mesh[/code] - The [NavigationPolygon] reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh. + - [code]source_geometry_data[/code] - The [NavigationMeshSourceGeometryData2D] reference. Add custom source geometry for navigation mesh baking to this object. + - [code]node[/code] - The [Node] that is parsed. + </description> + </method> </methods> <signals> <signal name="map_changed"> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index 29d9f5424a..ff3e6fd8a6 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -14,8 +14,8 @@ This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. </description> <tutorials> - <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link> <link title="Using NavigationServer">$DOCS_URL/tutorials/navigation/navigation_using_navigationservers.html</link> + <link title="3D Navigation Demo">https://godotengine.org/asset-library/asset/2743</link> </tutorials> <methods> <method name="agent_create"> @@ -1094,6 +1094,32 @@ If [code]true[/code] enables debug mode on the NavigationServer. </description> </method> + <method name="simplify_path"> + <return type="PackedVector3Array" /> + <param index="0" name="path" type="PackedVector3Array" /> + <param index="1" name="epsilon" type="float" /> + <description> + Returns a simplified version of [param path] with less critical path points removed. The simplification amount is in worlds units and controlled by [param epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + </description> + </method> + <method name="source_geometry_parser_create"> + <return type="RID" /> + <description> + Creates a new source geometry parser. If a [Callable] is set for the parser with [method source_geometry_parser_set_callback] the callback will be called for every single node that gets parsed whenever [method parse_source_geometry_data] is used. + </description> + </method> + <method name="source_geometry_parser_set_callback"> + <return type="void" /> + <param index="0" name="parser" type="RID" /> + <param index="1" name="callback" type="Callable" /> + <description> + Sets the [param callback] [Callable] for the specific source geometry [param parser]. The [Callable] will receive a call with the following parameters: + - [code]navigation_mesh[/code] - The [NavigationMesh] reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh. + - [code]source_geometry_data[/code] - The [NavigationMeshSourceGeometryData3D] reference. Add custom source geometry for navigation mesh baking to this object. + - [code]node[/code] - The [Node] that is parsed. + </description> + </method> </methods> <signals> <signal name="avoidance_debug_changed"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index ae6cd9596c..176bdea4a1 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -383,7 +383,7 @@ Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns [code]null[/code]. Attempts to access methods on the return value will result in an [i]"Attempt to call <method> on a null instance."[/i] error. [b]Note:[/b] Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]). [b]Example:[/b] Assume this method is called from the Character node, inside the following tree: - [codeblock] + [codeblock lang=text] ┖╴root ┠╴Character (you are here!) ┃ ┠╴Sword @@ -514,8 +514,8 @@ <return type="String" /> <description> Returns the tree as a [String]. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the [method get_node] function. It also can be used in game UI/UX. - [b]Example output:[/b] - [codeblock] + May print, for example: + [codeblock lang=text] TheGame TheGame/Menu TheGame/Menu/Label @@ -529,8 +529,8 @@ <return type="String" /> <description> Similar to [method get_tree_string], this returns the tree as a [String]. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees. - [b]Example output:[/b] - [codeblock] + May print, for example: + [codeblock lang=text] ┖╴TheGame ┠╴Menu ┃ ┠╴Label @@ -619,6 +619,12 @@ [method request_ready] resets it back to [code]false[/code]. </description> </method> + <method name="is_part_of_edited_scene" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the node is part of the scene currently opened in the editor. + </description> + </method> <method name="is_physics_interpolated" qualifiers="const"> <return type="bool" /> <description> @@ -716,8 +722,8 @@ <return type="void" /> <description> Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs [NodePath]s relative to this node, and is good for copy/pasting into [method get_node]. See also [method print_tree_pretty]. - [b]Example output:[/b] - [codeblock] + May print, for example: + [codeblock lang=text] . Menu Menu/Label @@ -731,8 +737,8 @@ <return type="void" /> <description> Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to [method print_tree], but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees. - [b]Example output:[/b] - [codeblock] + May print, for example: + [codeblock lang=text] ┖╴TheGame ┠╴Menu ┃ ┠╴Label @@ -795,9 +801,8 @@ <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]. If [param keep_children] is [code]true[/code] all children of this node are moved to [param node]. + Replaces this node by the given [param node]. 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> @@ -971,8 +976,8 @@ </methods> <members> <member name="auto_translate_mode" type="int" setter="set_auto_translate_mode" getter="get_auto_translate_mode" enum="Node.AutoTranslateMode" default="0"> - Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as [Label], [RichTextLabel], [Window], etc.). See [enum AutoTranslateMode]. - Also decides if the node's strings should be parsed for POT generation. + Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as [Label], [RichTextLabel], [Window], etc.). Also decides if the node's strings should be parsed for POT generation. + [b]Note:[/b] For the root node, auto translate mode can also be set via [member ProjectSettings.internationalization/rendering/root_node_auto_translate]. </member> <member name="editor_description" type="String" setter="set_editor_description" getter="get_editor_description" default=""""> An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock. @@ -986,7 +991,7 @@ [b]Note:[/b] When changing the name, the following characters will be replaced with an underscore: ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]). In particular, the [code]@[/code] character is reserved for auto-generated names. See also [method String.validate_node_name]. </member> <member name="owner" type="Node" setter="set_owner" getter="get_owner"> - 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. + 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"> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 091acdf6f2..851290de7b 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -44,7 +44,8 @@ <return type="void" /> <param index="0" name="point" type="Vector2" /> <description> - Rotates the node so it points towards the [param point], which is expected to use global coordinates. + Rotates the node so that its local +X axis points towards the [param point], which is expected to use global coordinates. + [param point] should not be the same as the node's position, otherwise the node always looks to the right. </description> </method> <method name="move_local_x"> diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 6e0799e796..b4969b8906 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -30,11 +30,11 @@ [/codeblock] Node paths cannot check whether they are valid and may point to nodes or properties that do not exist. Their meaning depends entirely on the context in which they're used. You usually do not have to worry about the [NodePath] type, as strings are automatically converted to the type when necessary. There are still times when defining node paths is useful. For example, exported [NodePath] properties allow you to easily select any node within the currently edited scene. They are also automatically updated when moving, renaming or deleting nodes in the scene tree editor. See also [annotation @GDScript.@export_node_path]. - See also [StringName], which is a similar type designed for optimised strings. + See also [StringName], which is a similar type designed for optimized strings. [b]Note:[/b] In a boolean context, a [NodePath] will evaluate to [code]false[/code] if it is empty ([code]NodePath("")[/code]). Otherwise, a [NodePath] will always evaluate to [code]true[/code]. </description> <tutorials> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> </tutorials> <constructors> <constructor name="NodePath"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index bd1bd9afa7..7c69bc6ed2 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -8,7 +8,7 @@ [b]Note:[/b] In Godot 4, [OS] functions related to window management, clipboard, and TTS were moved to the [DisplayServer] singleton (and the [Window] class). Functions related to time were removed and are only available in the [Time] class. </description> <tutorials> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <methods> <method name="alert"> @@ -189,26 +189,26 @@ for argument in OS.get_cmdline_args(): if argument.contains("="): var key_value = argument.split("=") - arguments[key_value[0].lstrip("--")] = key_value[1] + arguments[key_value[0].trim_prefix("--")] = key_value[1] else: # Options without an argument will be present in the dictionary, # with the value set to an empty string. - arguments[argument.lstrip("--")] = "" + arguments[argument.trim_prefix("--")] = "" [/gdscript] [csharp] - var arguments = new Godot.Collections.Dictionary(); + var arguments = new Dictionary<string, string>(); foreach (var argument in OS.GetCmdlineArgs()) { if (argument.Contains('=')) { string[] keyValue = argument.Split("="); - arguments[keyValue[0].LStrip("--")] = keyValue[1]; + arguments[keyValue[0].TrimPrefix("--")] = keyValue[1]; } else { // Options without an argument will be present in the dictionary, // with the value set to an empty string. - arguments[keyValue[0].LStrip("--")] = ""; + arguments[argument.TrimPrefix("--")] = ""; } } [/csharp] @@ -408,11 +408,20 @@ [b]Note:[/b] On Web platforms, it is still possible to determine the host platform's OS with feature tags. See [method has_feature]. </description> </method> + <method name="get_process_exit_code" qualifiers="const"> + <return type="int" /> + <param index="0" name="pid" type="int" /> + <description> + Returns the exit code of a spawned process once it has finished running (see [method is_process_running]). + Returns [code]-1[/code] if the [param pid] is not a PID of a spawned child process, the process is still running, or the method is not implemented for the current platform. + [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. + </description> + </method> <method name="get_process_id" qualifiers="const"> <return type="int" /> <description> Returns the number used by the host machine to uniquely identify this application. - [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS, and Windows. </description> </method> <method name="get_processor_count" qualifiers="const"> @@ -592,7 +601,7 @@ <param index="0" name="pid" type="int" /> <description> Returns [code]true[/code] if the child process ID ([param pid]) is still running or [code]false[/code] if it has terminated. [param pid] must be a valid ID generated from [method create_process]. - [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS, and Windows. </description> </method> <method name="is_restart_on_exit_set" qualifiers="const"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index b69326b6e0..b0dec2d00a 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -357,7 +357,7 @@ <param index="0" name="signal" type="String" /> <param index="1" name="arguments" type="Array" default="[]" /> <description> - Adds a user-defined [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a [code]name[/code] [String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also [method has_user_signal]. + Adds a user-defined [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a [code]name[/code] [String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal]. [codeblocks] [gdscript] add_user_signal("hurt", [ @@ -556,7 +556,7 @@ While all options have the same outcome ([code]button[/code]'s [signal BaseButton.button_down] signal will be connected to [code]_on_button_down[/code]), [b]option 3[/b] offers the best validation: it will print a compile-time error if either the [code]button_down[/code] [Signal] or the [code]_on_button_down[/code] [Callable] are not defined. On the other hand, [b]option 2[/b] only relies on string names and will only be able to validate either names at runtime: it will print a runtime error if [code]"button_down"[/code] doesn't correspond to a signal, or if [code]"_on_button_down"[/code] is not a registered method in the object [code]self[/code]. The main reason for using options 1, 2, or 4 would be if you actually need to use strings (e.g. to connect signals programmatically based on strings read from a configuration file). Otherwise, option 3 is the recommended (and fastest) method. [b]Binding and passing parameters:[/b] The syntax to bind parameters is through [method Callable.bind], which returns a copy of the [Callable] with its parameters bound. - When calling [method emit_signal], the signal parameters can be also passed. The examples below show the relationship between these signal parameters and bound parameters. + When calling [method emit_signal] or [method Signal.emit], the signal parameters can be also passed. The examples below show the relationship between these signal parameters and bound parameters. [codeblocks] [gdscript] func _ready(): @@ -566,7 +566,7 @@ player.hit.connect(_on_player_hit.bind("sword", 100)) # Parameters added when emitting the signal are passed first. - player.emit_signal("hit", "Dark lord", 5) + player.hit.emit("Dark lord", 5) # We pass two arguments when emitting (`hit_by`, `level`), # and bind two more arguments when connecting (`weapon_type`, `damage`). @@ -797,7 +797,7 @@ <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> - Returns [code]true[/code] if the given user-defined [param signal] name exists. Only signals added with [method add_user_signal] are included. + Returns [code]true[/code] if the given user-defined [param signal] name exists. Only signals added with [method add_user_signal] are included. See also [method remove_user_signal]. </description> </method> <method name="is_blocking_signals" qualifiers="const"> @@ -905,6 +905,13 @@ [b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method. </description> </method> + <method name="remove_user_signal"> + <return type="void" /> + <param index="0" name="signal" type="StringName" /> + <description> + Removes the given user signal [param signal] from the object. See also [method add_user_signal] and [method has_user_signal]. + </description> + </method> <method name="set"> <return type="void" /> <param index="0" name="property" type="StringName" /> @@ -1027,6 +1034,7 @@ 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]. + [b]Note:[/b] This method can't be used without an [Object] instance, as it requires the [method can_translate_messages] method. To translate strings in a static context, use [method TranslationServer.translate]. </description> </method> <method name="tr_n" qualifiers="const"> @@ -1041,6 +1049,7 @@ The [param n] is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language. For detailed examples, see [url=$DOCS_URL/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url]. [b]Note:[/b] Negative and [float] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with [method tr]. + [b]Note:[/b] This method can't be used without an [Object] instance, as it requires the [method can_translate_messages] method. To translate strings in a static context, use [method TranslationServer.translate_plural]. </description> </method> </methods> diff --git a/doc/classes/OccluderPolygon2D.xml b/doc/classes/OccluderPolygon2D.xml index a78375ad01..36e1540b39 100644 --- a/doc/classes/OccluderPolygon2D.xml +++ b/doc/classes/OccluderPolygon2D.xml @@ -17,7 +17,6 @@ </member> <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> A [Vector2] array with the index for polygon's vertices positions. - [b]Note:[/b] The returned value is a copy of the underlying array, rather than a reference. </member> </members> <constants> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 0c1532f61a..e179c111a2 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -6,6 +6,7 @@ <description> An array specifically designed to hold bytes. Packs data tightly, so it saves memory for large array sizes. [PackedByteArray] also provides methods to encode/decode various types to/from bytes. The way values are encoded is an implementation detail and shouldn't be relied upon when interacting with external apps. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index ad96ba2490..57295cb1e3 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -5,6 +5,8 @@ </brief_description> <description> An array specifically designed to hold [Color]. Packs data tightly, so it saves memory for large array sizes. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedColorArray] versus [code]Array[Color][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 6f1ecacca4..2db1386fd0 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -6,6 +6,7 @@ <description> An array specifically designed to hold 32-bit floating-point values (float). Packs data tightly, so it saves memory for large array sizes. If you need to pack 64-bit floats tightly, see [PackedFloat64Array]. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index aef5ab90ac..0bcee918ed 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -6,6 +6,8 @@ <description> An array specifically designed to hold 64-bit floating-point values (double). Packs data tightly, so it saves memory for large array sizes. If you only need to pack 32-bit floats tightly, see [PackedFloat32Array] for a more memory-friendly alternative. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedFloat64Array] versus [code]Array[float][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index e6396e2a93..93b2ae7394 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -6,6 +6,7 @@ <description> An array specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 32-bit integers, which means it can take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. If you need to pack 64-bit integers tightly, see [PackedInt64Array]. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 55024341c1..3d34165915 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -6,6 +6,8 @@ <description> An array specifically designed to hold 64-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 64-bit integers, which means it can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. If you only need to pack 32-bit integers tightly, see [PackedInt32Array] for a more memory-friendly alternative. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt32Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 9324f99535..26d8fa8d5f 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -73,7 +73,7 @@ [/codeblocks] </description> <tutorials> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> </tutorials> <methods> <method name="can_instantiate" qualifiers="const"> @@ -99,14 +99,14 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="Node" /> <description> - Pack will ignore any sub-nodes not owned by given node. See [member Node.owner]. + Packs the [param path] node, and all owned sub-nodes, into this [PackedScene]. Any existing data will be cleared. See [member Node.owner]. </description> </method> </methods> <members> <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ "conn_count": 0, "conns": PackedInt32Array(), "editable_instances": [], "names": PackedStringArray(), "node_count": 0, "node_paths": [], "nodes": PackedInt32Array(), "variants": [], "version": 3 }"> A dictionary representation of the scene contents. - Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for paths to overridden nodes, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. + Available keys include "names" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for paths to overridden nodes, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. </member> </members> <constants> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index f1b02272f3..621831c7a3 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -11,9 +11,11 @@ var string = " ".join(string_array) print(string) # "hello world" [/codeblock] + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedStringArray] versus [code]Array[String][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <constructors> <constructor name="PackedStringArray"> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index c73fea9114..14a3816353 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -5,9 +5,11 @@ </brief_description> <description> An array specifically designed to hold [Vector2]. Packs data tightly, so it saves memory for large array sizes. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector3Array] versus [code]Array[Vector2][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> - <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> + <link title="Grid-based Navigation with AStarGrid2D Demo">https://godotengine.org/asset-library/asset/2723</link> </tutorials> <constructors> <constructor name="PackedVector2Array"> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 89f258eaea..49220c6fd6 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -5,6 +5,8 @@ </brief_description> <description> An array specifically designed to hold [Vector3]. Packs data tightly, so it saves memory for large array sizes. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector3Array] versus [code]Array[Vector3][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> diff --git a/doc/classes/PackedVector4Array.xml b/doc/classes/PackedVector4Array.xml new file mode 100644 index 0000000000..fd0cfeb74b --- /dev/null +++ b/doc/classes/PackedVector4Array.xml @@ -0,0 +1,225 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PackedVector4Array" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A packed array of [Vector4]s. + </brief_description> + <description> + An array specifically designed to hold [Vector4]. Packs data tightly, so it saves memory for large array sizes. + [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. + </description> + <tutorials> + </tutorials> + <constructors> + <constructor name="PackedVector4Array"> + <return type="PackedVector4Array" /> + <description> + Constructs an empty [PackedVector4Array]. + </description> + </constructor> + <constructor name="PackedVector4Array"> + <return type="PackedVector4Array" /> + <param index="0" name="from" type="PackedVector4Array" /> + <description> + Constructs a [PackedVector4Array] as a copy of the given [PackedVector4Array]. + </description> + </constructor> + <constructor name="PackedVector4Array"> + <return type="PackedVector4Array" /> + <param index="0" name="from" type="Array" /> + <description> + Constructs a new [PackedVector4Array]. Optionally, you can pass in a generic [Array] that will be converted. + [b]Note:[/b] When initializing a [PackedVector4Array] with elements, it must be initialized with an [Array] of [Vector4] values: + [codeblock] + var array = PackedVector4Array([Vector4(12, 34, 56, 78), Vector4(90, 12, 34, 56)]) + [/codeblock] + </description> + </constructor> + </constructors> + <methods> + <method name="append"> + <return type="bool" /> + <param index="0" name="value" type="Vector4" /> + <description> + Appends an element at the end of the array (alias of [method push_back]). + </description> + </method> + <method name="append_array"> + <return type="void" /> + <param index="0" name="array" type="PackedVector4Array" /> + <description> + Appends a [PackedVector4Array] at the end of this array. + </description> + </method> + <method name="bsearch"> + <return type="int" /> + <param index="0" name="value" type="Vector4" /> + <param index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="clear"> + <return type="void" /> + <description> + Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code]. + </description> + </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <param index="0" name="value" type="Vector4" /> + <description> + Returns the number of times an element is in the array. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="duplicate"> + <return type="PackedVector4Array" /> + <description> + Creates a copy of the array, and returns it. + </description> + </method> + <method name="fill"> + <return type="void" /> + <param index="0" name="value" type="Vector4" /> + <description> + Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. + </description> + </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <param index="0" name="value" type="Vector4" /> + <param index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="has" qualifiers="const"> + <return type="bool" /> + <param index="0" name="value" type="Vector4" /> + <description> + Returns [code]true[/code] if the array contains [param value]. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="insert"> + <return type="int" /> + <param index="0" name="at_index" type="int" /> + <param index="1" name="value" type="Vector4" /> + <description> + Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). + </description> + </method> + <method name="is_empty" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> + <method name="push_back"> + <return type="bool" /> + <param index="0" name="value" type="Vector4" /> + <description> + Inserts a [Vector4] at the end. + </description> + </method> + <method name="remove_at"> + <return type="void" /> + <param index="0" name="index" type="int" /> + <description> + Removes an element from the array by index. + </description> + </method> + <method name="resize"> + <return type="int" /> + <param index="0" name="new_size" type="int" /> + <description> + Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + </description> + </method> + <method name="reverse"> + <return type="void" /> + <description> + Reverses the order of the elements in the array. + </description> + </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <param index="0" name="value" type="Vector4" /> + <param index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="set"> + <return type="void" /> + <param index="0" name="index" type="int" /> + <param index="1" name="value" type="Vector4" /> + <description> + Changes the [Vector4] at the given index. + </description> + </method> + <method name="size" qualifiers="const"> + <return type="int" /> + <description> + Returns the number of elements in the array. + </description> + </method> + <method name="slice" qualifiers="const"> + <return type="PackedVector4Array" /> + <param index="0" name="begin" type="int" /> + <param index="1" name="end" type="int" default="2147483647" /> + <description> + Returns the slice of the [PackedVector4Array], from [param begin] (inclusive) to [param end] (exclusive), as a new [PackedVector4Array]. + The absolute value of [param begin] and [param end] will be clamped to the array size, so the default value for [param end] makes it slice to the size of the array by default (i.e. [code]arr.slice(1)[/code] is a shorthand for [code]arr.slice(1, arr.size())[/code]). + If either [param begin] or [param end] are negative, they will be relative to the end of the array (i.e. [code]arr.slice(0, -2)[/code] is a shorthand for [code]arr.slice(0, arr.size() - 2)[/code]). + </description> + </method> + <method name="sort"> + <return type="void" /> + <description> + Sorts the elements of the array in ascending order. + [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included. + </description> + </method> + <method name="to_byte_array" qualifiers="const"> + <return type="PackedByteArray" /> + <description> + Returns a [PackedByteArray] with each vector encoded as bytes. + </description> + </method> + </methods> + <operators> + <operator name="operator !="> + <return type="bool" /> + <param index="0" name="right" type="PackedVector4Array" /> + <description> + Returns [code]true[/code] if contents of the arrays differ. + </description> + </operator> + <operator name="operator +"> + <return type="PackedVector4Array" /> + <param index="0" name="right" type="PackedVector4Array" /> + <description> + Returns a new [PackedVector4Array] with contents of [param right] added at the end of this array. For better performance, consider using [method append_array] instead. + </description> + </operator> + <operator name="operator =="> + <return type="bool" /> + <param index="0" name="right" type="PackedVector4Array" /> + <description> + Returns [code]true[/code] if contents of both arrays are the same, i.e. they have all equal [Vector4]s at the corresponding indices. + </description> + </operator> + <operator name="operator []"> + <return type="Vector4" /> + <param index="0" name="index" type="int" /> + <description> + Returns the [Vector4] at index [param index]. Negative indices can be used to access the elements starting from the end. Using index out of array's bounds will result in an error. + </description> + </operator> + </operators> +</class> diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml index db1fa1ccda..993c383c70 100644 --- a/doc/classes/Panel.xml +++ b/doc/classes/Panel.xml @@ -7,9 +7,8 @@ [Panel] is a GUI control that displays a [StyleBox]. See also [PanelContainer]. </description> <tutorials> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> - <link title="2D Finite State Machine Demo">https://godotengine.org/asset-library/asset/516</link> - <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> + <link title="Hierarchical Finite State Machine Demo">https://godotengine.org/asset-library/asset/2714</link> </tutorials> <theme_items> <theme_item name="panel" data_type="style" type="StyleBox"> diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml index c6b3604cc4..c2972abc14 100644 --- a/doc/classes/PanelContainer.xml +++ b/doc/classes/PanelContainer.xml @@ -8,7 +8,7 @@ </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> </tutorials> <members> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" /> diff --git a/doc/classes/ParticleProcessMaterial.xml b/doc/classes/ParticleProcessMaterial.xml index 8d0ae317b9..1502690b45 100644 --- a/doc/classes/ParticleProcessMaterial.xml +++ b/doc/classes/ParticleProcessMaterial.xml @@ -185,6 +185,7 @@ </member> <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents"> The box's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. + [b]Note:[/b] [member emission_box_extents] starts from the center point and applies the X, Y, and Z values in both directions. The size is twice the area of the extents. </member> <member name="emission_color_texture" type="Texture2D" setter="set_emission_color_texture" getter="get_emission_color_texture"> Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture]. diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index c3b202e0a5..bce1a80526 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -13,7 +13,7 @@ <return type="void" /> <param index="0" name="state" type="PhysicsDirectBodyState3D" /> <description> - Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [member custom_integrator] property allows you to disable the default behavior and do fully custom force integration for a body. + Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. </description> </method> <method name="apply_central_impulse"> @@ -67,7 +67,8 @@ If [code]true[/code], the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force. </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" default="false"> - If [code]true[/code], internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined. + If [code]true[/code], the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. + Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" default="1.0"> The body's friction, from [code]0[/code] (frictionless) to [code]1[/code] (max friction). diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index 7051663a78..d60cc1ee6b 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -202,7 +202,7 @@ <method name="integrate_forces"> <return type="void" /> <description> - Calls the built-in force integration code. + Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. </description> </method> <method name="set_constant_force"> diff --git a/doc/classes/PhysicsDirectBodyState2DExtension.xml b/doc/classes/PhysicsDirectBodyState2DExtension.xml index 04612b461e..932c1c8352 100644 --- a/doc/classes/PhysicsDirectBodyState2DExtension.xml +++ b/doc/classes/PhysicsDirectBodyState2DExtension.xml @@ -14,6 +14,7 @@ <return type="void" /> <param index="0" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.add_constant_central_force]. </description> </method> <method name="_add_constant_force" qualifiers="virtual"> @@ -21,24 +22,28 @@ <param index="0" name="force" type="Vector2" /> <param index="1" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.add_constant_force]. </description> </method> <method name="_add_constant_torque" qualifiers="virtual"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.add_constant_torque]. </description> </method> <method name="_apply_central_force" qualifiers="virtual"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_central_force]. </description> </method> <method name="_apply_central_impulse" qualifiers="virtual"> <return type="void" /> <param index="0" name="impulse" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_central_impulse]. </description> </method> <method name="_apply_force" qualifiers="virtual"> @@ -46,6 +51,7 @@ <param index="0" name="force" type="Vector2" /> <param index="1" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_force]. </description> </method> <method name="_apply_impulse" qualifiers="virtual"> @@ -53,211 +59,249 @@ <param index="0" name="impulse" type="Vector2" /> <param index="1" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_impulse]. </description> </method> <method name="_apply_torque" qualifiers="virtual"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_torque]. </description> </method> <method name="_apply_torque_impulse" qualifiers="virtual"> <return type="void" /> <param index="0" name="impulse" type="float" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.apply_torque_impulse]. </description> </method> <method name="_get_angular_velocity" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective getter. </description> </method> <method name="_get_center_of_mass" qualifiers="virtual const"> <return type="Vector2" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass] and its respective getter. </description> </method> <method name="_get_center_of_mass_local" qualifiers="virtual const"> <return type="Vector2" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass_local] and its respective getter. </description> </method> <method name="_get_constant_force" qualifiers="virtual const"> <return type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_constant_force]. </description> </method> <method name="_get_constant_torque" qualifiers="virtual const"> <return type="float" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_constant_torque]. </description> </method> <method name="_get_contact_collider" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider]. </description> </method> <method name="_get_contact_collider_id" qualifiers="virtual const"> <return type="int" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_id]. </description> </method> <method name="_get_contact_collider_object" qualifiers="virtual const"> <return type="Object" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_object]. </description> </method> <method name="_get_contact_collider_position" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_position]. </description> </method> <method name="_get_contact_collider_shape" qualifiers="virtual const"> <return type="int" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_shape]. </description> </method> <method name="_get_contact_collider_velocity_at_position" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_velocity_at_position]. </description> </method> <method name="_get_contact_count" qualifiers="virtual const"> <return type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_count]. </description> </method> <method name="_get_contact_impulse" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_impulse]. </description> </method> <method name="_get_contact_local_normal" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_normal]. </description> </method> <method name="_get_contact_local_position" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_position]. </description> </method> <method name="_get_contact_local_shape" qualifiers="virtual const"> <return type="int" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_shape]. </description> </method> <method name="_get_contact_local_velocity_at_position" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="contact_idx" type="int" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_velocity_at_position]. </description> </method> <method name="_get_inverse_inertia" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_inertia] and its respective getter. </description> </method> <method name="_get_inverse_mass" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_mass] and its respective getter. </description> </method> <method name="_get_linear_velocity" qualifiers="virtual const"> <return type="Vector2" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective getter. </description> </method> <method name="_get_space_state" qualifiers="virtual"> <return type="PhysicsDirectSpaceState2D" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_space_state]. </description> </method> <method name="_get_step" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.step] and its respective getter. </description> </method> <method name="_get_total_angular_damp" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.total_angular_damp] and its respective getter. </description> </method> <method name="_get_total_gravity" qualifiers="virtual const"> <return type="Vector2" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.total_gravity] and its respective getter. </description> </method> <method name="_get_total_linear_damp" qualifiers="virtual const"> <return type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.total_linear_damp] and its respective getter. </description> </method> <method name="_get_transform" qualifiers="virtual const"> <return type="Transform2D" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective getter. </description> </method> <method name="_get_velocity_at_local_position" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="local_position" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.get_velocity_at_local_position]. </description> </method> <method name="_integrate_forces" qualifiers="virtual"> <return type="void" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.integrate_forces]. </description> </method> <method name="_is_sleeping" qualifiers="virtual const"> <return type="bool" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective getter. </description> </method> <method name="_set_angular_velocity" qualifiers="virtual"> <return type="void" /> <param index="0" name="velocity" type="float" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective setter. </description> </method> <method name="_set_constant_force" qualifiers="virtual"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.set_constant_force]. </description> </method> <method name="_set_constant_torque" qualifiers="virtual"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> + Overridable version of [method PhysicsDirectBodyState2D.set_constant_torque]. </description> </method> <method name="_set_linear_velocity" qualifiers="virtual"> <return type="void" /> <param index="0" name="velocity" type="Vector2" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective setter. </description> </method> <method name="_set_sleep_state" qualifiers="virtual"> <return type="void" /> <param index="0" name="enabled" type="bool" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective setter. </description> </method> <method name="_set_transform" qualifiers="virtual"> <return type="void" /> <param index="0" name="transform" type="Transform2D" /> <description> + Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective setter. </description> </method> </methods> diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml index 42c65763aa..e8c3f3f89d 100644 --- a/doc/classes/PhysicsDirectBodyState3D.xml +++ b/doc/classes/PhysicsDirectBodyState3D.xml @@ -202,7 +202,7 @@ <method name="integrate_forces"> <return type="void" /> <description> - Calls the built-in force integration code. + Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. </description> </method> <method name="set_constant_force"> diff --git a/doc/classes/PhysicsMaterial.xml b/doc/classes/PhysicsMaterial.xml index 1601a1040e..03cbfb4ce7 100644 --- a/doc/classes/PhysicsMaterial.xml +++ b/doc/classes/PhysicsMaterial.xml @@ -14,7 +14,7 @@ </member> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0"> The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness). - [b]Note:[/b] Even with [member bounce] set to [code]1.0[/code], some energy will be lost over time due to linear and angular damping. To have a [PhysicsBody3D] that preserves all its energy over time, set [member bounce] to [code]1.0[/code], the body's linear damp mode to [b]Replace[/b] (if applicable), its linear damp to [code]0.0[/code], its angular damp mode to [b]Replace[/b] (if applicable), and its angular damp to [code]0.0[/code]. + [b]Note:[/b] Even with [member bounce] set to [code]1.0[/code], some energy will be lost over time due to linear and angular damping. To have a physics body that preserves all its energy over time, set [member bounce] to [code]1.0[/code], the body's linear damp mode to [b]Replace[/b] (if applicable), its linear damp to [code]0.0[/code], its angular damp mode to [b]Replace[/b] (if applicable), and its angular damp to [code]0.0[/code]. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" default="1.0"> The body's friction. Values range from [code]0[/code] (frictionless) to [code]1[/code] (maximum friction). diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 8be92edbad..c0672cc503 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -52,7 +52,8 @@ <method name="area_create"> <return type="RID" /> <description> - Creates a 2D area object in the physics server, and returns the [RID] that identifies it. Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. + Creates a 2D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and [code]monitorable[/code] set to [code]false[/code]. + Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. </description> </method> <method name="area_get_canvas_instance_id" qualifiers="const"> @@ -369,7 +370,8 @@ <method name="body_create"> <return type="RID" /> <description> - Creates a 2D body object in the physics server, and returns the [RID] that identifies it. Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. + Creates a 2D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and body mode set to [constant BODY_MODE_RIGID]. + Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. </description> </method> <method name="body_get_canvas_instance_id" qualifiers="const"> @@ -501,7 +503,7 @@ <return type="bool" /> <param index="0" name="body" type="RID" /> <description> - Returns [code]true[/code] if the body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). + Returns [code]true[/code] if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. </description> </method> <method name="body_remove_collision_exception"> @@ -592,11 +594,12 @@ <param index="1" name="callable" type="Callable" /> <param index="2" name="userdata" type="Variant" default="null" /> <description> - Sets the function used to calculate physics for the body, if that body allows it (see [method body_set_omit_force_integration]). - The force integration function takes the following two parameters: - 1. a [PhysicsDirectBodyState2D] [code]state[/code]: used to retrieve and modify the body's state, - 2. a [Variant] [param userdata]: optional user data. - [b]Note:[/b] This callback is currently not called in Godot Physics. + Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. + The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. + If [param userdata] is not [code]null[/code], the function [param callable] must take the following two parameters: + 1. [code]state[/code]: a [PhysicsDirectBodyState2D] used to retrieve and modify the body's state, + 2. [code skip-lint]userdata[/code]: a [Variant]; its value will be the [param userdata] passed into this method. + If [param userdata] is [code]null[/code], then [param callable] must take only the [code]state[/code] parameter. </description> </method> <method name="body_set_max_contacts_reported"> @@ -620,7 +623,8 @@ <param index="0" name="body" type="RID" /> <param index="1" name="enable" type="bool" /> <description> - Sets whether the body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). + Sets whether the body omits the standard force integration. If [param enable] is [code]true[/code], the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. + This method is called when the property [member RigidBody2D.custom_integrator] is set. </description> </method> <method name="body_set_param"> diff --git a/doc/classes/PhysicsServer2DExtension.xml b/doc/classes/PhysicsServer2DExtension.xml index 8d9a171337..41826ea7c2 100644 --- a/doc/classes/PhysicsServer2DExtension.xml +++ b/doc/classes/PhysicsServer2DExtension.xml @@ -17,6 +17,7 @@ <param index="2" name="transform" type="Transform2D" /> <param index="3" name="disabled" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.area_add_shape]. </description> </method> <method name="_area_attach_canvas_instance_id" qualifiers="virtual"> @@ -24,6 +25,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="id" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_attach_canvas_instance_id]. </description> </method> <method name="_area_attach_object_instance_id" qualifiers="virtual"> @@ -31,41 +33,48 @@ <param index="0" name="area" type="RID" /> <param index="1" name="id" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_attach_object_instance_id]. </description> </method> <method name="_area_clear_shapes" qualifiers="virtual"> <return type="void" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_clear_shapes]. </description> </method> <method name="_area_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_create]. </description> </method> <method name="_area_get_canvas_instance_id" qualifiers="virtual const"> <return type="int" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_canvas_instance_id]. </description> </method> <method name="_area_get_collision_layer" qualifiers="virtual const"> <return type="int" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_collision_layer]. </description> </method> <method name="_area_get_collision_mask" qualifiers="virtual const"> <return type="int" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_collision_mask]. </description> </method> <method name="_area_get_object_instance_id" qualifiers="virtual const"> <return type="int" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_object_instance_id]. </description> </method> <method name="_area_get_param" qualifiers="virtual const"> @@ -73,6 +82,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.AreaParameter" /> <description> + Overridable version of [method PhysicsServer2D.area_get_param]. </description> </method> <method name="_area_get_shape" qualifiers="virtual const"> @@ -80,12 +90,14 @@ <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_get_shape]. </description> </method> <method name="_area_get_shape_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_shape_count]. </description> </method> <method name="_area_get_shape_transform" qualifiers="virtual const"> @@ -93,18 +105,21 @@ <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_get_shape_transform]. </description> </method> <method name="_area_get_space" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_space]. </description> </method> <method name="_area_get_transform" qualifiers="virtual const"> <return type="Transform2D" /> <param index="0" name="area" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_get_transform]. </description> </method> <method name="_area_remove_shape" qualifiers="virtual"> @@ -112,6 +127,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_remove_shape]. </description> </method> <method name="_area_set_area_monitor_callback" qualifiers="virtual"> @@ -119,6 +135,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="callback" type="Callable" /> <description> + Overridable version of [method PhysicsServer2D.area_set_area_monitor_callback]. </description> </method> <method name="_area_set_collision_layer" qualifiers="virtual"> @@ -126,6 +143,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="layer" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_set_collision_layer]. </description> </method> <method name="_area_set_collision_mask" qualifiers="virtual"> @@ -133,6 +151,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="mask" type="int" /> <description> + Overridable version of [method PhysicsServer2D.area_set_collision_mask]. </description> </method> <method name="_area_set_monitor_callback" qualifiers="virtual"> @@ -140,6 +159,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="callback" type="Callable" /> <description> + Overridable version of [method PhysicsServer2D.area_set_monitor_callback]. </description> </method> <method name="_area_set_monitorable" qualifiers="virtual"> @@ -147,6 +167,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="monitorable" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.area_set_monitorable]. </description> </method> <method name="_area_set_param" qualifiers="virtual"> @@ -155,6 +176,7 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.AreaParameter" /> <param index="2" name="value" type="Variant" /> <description> + Overridable version of [method PhysicsServer2D.area_set_param]. </description> </method> <method name="_area_set_pickable" qualifiers="virtual"> @@ -162,6 +184,8 @@ <param index="0" name="area" type="RID" /> <param index="1" name="pickable" type="bool" /> <description> + If set to [code]true[/code], allows the area with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. + Overridable version of [PhysicsServer2D]'s internal [code]area_set_pickable[/code] method. Corresponds to [member CollisionObject2D.input_pickable]. </description> </method> <method name="_area_set_shape" qualifiers="virtual"> @@ -170,6 +194,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="shape" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_set_shape]. </description> </method> <method name="_area_set_shape_disabled" qualifiers="virtual"> @@ -178,6 +203,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="disabled" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.area_set_shape_disabled]. </description> </method> <method name="_area_set_shape_transform" qualifiers="virtual"> @@ -186,6 +212,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="transform" type="Transform2D" /> <description> + Overridable version of [method PhysicsServer2D.area_set_shape_transform]. </description> </method> <method name="_area_set_space" qualifiers="virtual"> @@ -193,6 +220,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="space" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.area_set_space]. </description> </method> <method name="_area_set_transform" qualifiers="virtual"> @@ -200,6 +228,7 @@ <param index="0" name="area" type="RID" /> <param index="1" name="transform" type="Transform2D" /> <description> + Overridable version of [method PhysicsServer2D.area_set_transform]. </description> </method> <method name="_body_add_collision_exception" qualifiers="virtual"> @@ -207,6 +236,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="excepted_body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_add_collision_exception]. </description> </method> <method name="_body_add_constant_central_force" qualifiers="virtual"> @@ -214,6 +244,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_add_constant_central_force]. </description> </method> <method name="_body_add_constant_force" qualifiers="virtual"> @@ -222,6 +253,7 @@ <param index="1" name="force" type="Vector2" /> <param index="2" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_add_constant_force]. </description> </method> <method name="_body_add_constant_torque" qualifiers="virtual"> @@ -229,6 +261,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="torque" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_add_constant_torque]. </description> </method> <method name="_body_add_shape" qualifiers="virtual"> @@ -238,6 +271,7 @@ <param index="2" name="transform" type="Transform2D" /> <param index="3" name="disabled" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.body_add_shape]. </description> </method> <method name="_body_apply_central_force" qualifiers="virtual"> @@ -245,6 +279,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_central_force]. </description> </method> <method name="_body_apply_central_impulse" qualifiers="virtual"> @@ -252,6 +287,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="impulse" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_central_impulse]. </description> </method> <method name="_body_apply_force" qualifiers="virtual"> @@ -260,6 +296,7 @@ <param index="1" name="force" type="Vector2" /> <param index="2" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_force]. </description> </method> <method name="_body_apply_impulse" qualifiers="virtual"> @@ -268,6 +305,7 @@ <param index="1" name="impulse" type="Vector2" /> <param index="2" name="position" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_impulse]. </description> </method> <method name="_body_apply_torque" qualifiers="virtual"> @@ -275,6 +313,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="torque" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_torque]. </description> </method> <method name="_body_apply_torque_impulse" qualifiers="virtual"> @@ -282,6 +321,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="impulse" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_apply_torque_impulse]. </description> </method> <method name="_body_attach_canvas_instance_id" qualifiers="virtual"> @@ -289,6 +329,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="id" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_attach_canvas_instance_id]. </description> </method> <method name="_body_attach_object_instance_id" qualifiers="virtual"> @@ -296,12 +337,14 @@ <param index="0" name="body" type="RID" /> <param index="1" name="id" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_attach_object_instance_id]. </description> </method> <method name="_body_clear_shapes" qualifiers="virtual"> <return type="void" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_clear_shapes]. </description> </method> <method name="_body_collide_shape" qualifiers="virtual"> @@ -315,89 +358,107 @@ <param index="6" name="result_max" type="int" /> <param index="7" name="result_count" type="int32_t*" /> <description> + Given a [param body], a [param shape], and their respective parameters, this method should return [code]true[/code] if a collision between the two would occur, with additional details passed in [param results]. + Overridable version of [PhysicsServer2D]'s internal [code]shape_collide[/code] method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. </description> </method> <method name="_body_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_create]. </description> </method> <method name="_body_get_canvas_instance_id" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_canvas_instance_id]. </description> </method> <method name="_body_get_collision_exceptions" qualifiers="virtual const"> <return type="RID[]" /> <param index="0" name="body" type="RID" /> <description> + Returns the [RID]s of all bodies added as collision exceptions for the given [param body]. See also [method _body_add_collision_exception] and [method _body_remove_collision_exception]. + Overridable version of [PhysicsServer2D]'s internal [code]body_get_collision_exceptions[/code] method. Corresponds to [method PhysicsBody2D.get_collision_exceptions]. </description> </method> <method name="_body_get_collision_layer" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_collision_layer]. </description> </method> <method name="_body_get_collision_mask" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_collision_mask]. </description> </method> <method name="_body_get_collision_priority" qualifiers="virtual const"> <return type="float" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_collision_priority]. </description> </method> <method name="_body_get_constant_force" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_constant_force]. </description> </method> <method name="_body_get_constant_torque" qualifiers="virtual const"> <return type="float" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_constant_torque]. </description> </method> <method name="_body_get_contacts_reported_depth_threshold" qualifiers="virtual const"> <return type="float" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [PhysicsServer2D]'s internal [code]body_get_contacts_reported_depth_threshold[/code] method. + [b]Note:[/b] This method is currently unused by Godot's default physics implementation. </description> </method> <method name="_body_get_continuous_collision_detection_mode" qualifiers="virtual const"> <return type="int" enum="PhysicsServer2D.CCDMode" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_continuous_collision_detection_mode]. </description> </method> <method name="_body_get_direct_state" qualifiers="virtual"> <return type="PhysicsDirectBodyState2D" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_direct_state]. </description> </method> <method name="_body_get_max_contacts_reported" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_max_contacts_reported]. </description> </method> <method name="_body_get_mode" qualifiers="virtual const"> <return type="int" enum="PhysicsServer2D.BodyMode" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_mode]. </description> </method> <method name="_body_get_object_instance_id" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_object_instance_id]. </description> </method> <method name="_body_get_param" qualifiers="virtual const"> @@ -405,6 +466,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.BodyParameter" /> <description> + Overridable version of [method PhysicsServer2D.body_get_param]. </description> </method> <method name="_body_get_shape" qualifiers="virtual const"> @@ -412,12 +474,14 @@ <param index="0" name="body" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_get_shape]. </description> </method> <method name="_body_get_shape_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_shape_count]. </description> </method> <method name="_body_get_shape_transform" qualifiers="virtual const"> @@ -425,12 +489,14 @@ <param index="0" name="body" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_get_shape_transform]. </description> </method> <method name="_body_get_space" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_get_space]. </description> </method> <method name="_body_get_state" qualifiers="virtual const"> @@ -438,12 +504,14 @@ <param index="0" name="body" type="RID" /> <param index="1" name="state" type="int" enum="PhysicsServer2D.BodyState" /> <description> + Overridable version of [method PhysicsServer2D.body_get_state]. </description> </method> <method name="_body_is_omitting_force_integration" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_is_omitting_force_integration]. </description> </method> <method name="_body_remove_collision_exception" qualifiers="virtual"> @@ -451,6 +519,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="excepted_body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_remove_collision_exception]. </description> </method> <method name="_body_remove_shape" qualifiers="virtual"> @@ -458,12 +527,14 @@ <param index="0" name="body" type="RID" /> <param index="1" name="shape_idx" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_remove_shape]. </description> </method> <method name="_body_reset_mass_properties" qualifiers="virtual"> <return type="void" /> <param index="0" name="body" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_reset_mass_properties]. </description> </method> <method name="_body_set_axis_velocity" qualifiers="virtual"> @@ -471,6 +542,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="axis_velocity" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_set_axis_velocity]. </description> </method> <method name="_body_set_collision_layer" qualifiers="virtual"> @@ -478,6 +550,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="layer" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_set_collision_layer]. </description> </method> <method name="_body_set_collision_mask" qualifiers="virtual"> @@ -485,6 +558,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="mask" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_set_collision_mask]. </description> </method> <method name="_body_set_collision_priority" qualifiers="virtual"> @@ -492,6 +566,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="priority" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_set_collision_priority]. </description> </method> <method name="_body_set_constant_force" qualifiers="virtual"> @@ -499,6 +574,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector2" /> <description> + Overridable version of [method PhysicsServer2D.body_set_constant_force]. </description> </method> <method name="_body_set_constant_torque" qualifiers="virtual"> @@ -506,6 +582,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="torque" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_set_constant_torque]. </description> </method> <method name="_body_set_contacts_reported_depth_threshold" qualifiers="virtual"> @@ -513,6 +590,8 @@ <param index="0" name="body" type="RID" /> <param index="1" name="threshold" type="float" /> <description> + Overridable version of [PhysicsServer2D]'s internal [code]body_set_contacts_reported_depth_threshold[/code] method. + [b]Note:[/b] This method is currently unused by Godot's default physics implementation. </description> </method> <method name="_body_set_continuous_collision_detection_mode" qualifiers="virtual"> @@ -520,6 +599,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="mode" type="int" enum="PhysicsServer2D.CCDMode" /> <description> + Overridable version of [method PhysicsServer2D.body_set_continuous_collision_detection_mode]. </description> </method> <method name="_body_set_force_integration_callback" qualifiers="virtual"> @@ -528,6 +608,7 @@ <param index="1" name="callable" type="Callable" /> <param index="2" name="userdata" type="Variant" /> <description> + Overridable version of [method PhysicsServer2D.body_set_force_integration_callback]. </description> </method> <method name="_body_set_max_contacts_reported" qualifiers="virtual"> @@ -535,6 +616,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="amount" type="int" /> <description> + Overridable version of [method PhysicsServer2D.body_set_max_contacts_reported]. </description> </method> <method name="_body_set_mode" qualifiers="virtual"> @@ -542,6 +624,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="mode" type="int" enum="PhysicsServer2D.BodyMode" /> <description> + Overridable version of [method PhysicsServer2D.body_set_mode]. </description> </method> <method name="_body_set_omit_force_integration" qualifiers="virtual"> @@ -549,6 +632,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="enable" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.body_set_omit_force_integration]. </description> </method> <method name="_body_set_param" qualifiers="virtual"> @@ -557,6 +641,7 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.BodyParameter" /> <param index="2" name="value" type="Variant" /> <description> + Overridable version of [method PhysicsServer2D.body_set_param]. </description> </method> <method name="_body_set_pickable" qualifiers="virtual"> @@ -564,6 +649,8 @@ <param index="0" name="body" type="RID" /> <param index="1" name="pickable" type="bool" /> <description> + If set to [code]true[/code], allows the body with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. + Overridable version of [PhysicsServer2D]'s internal [code]body_set_pickable[/code] method. Corresponds to [member CollisionObject2D.input_pickable]. </description> </method> <method name="_body_set_shape" qualifiers="virtual"> @@ -572,6 +659,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="shape" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_set_shape]. </description> </method> <method name="_body_set_shape_as_one_way_collision" qualifiers="virtual"> @@ -581,6 +669,7 @@ <param index="2" name="enable" type="bool" /> <param index="3" name="margin" type="float" /> <description> + Overridable version of [method PhysicsServer2D.body_set_shape_as_one_way_collision]. </description> </method> <method name="_body_set_shape_disabled" qualifiers="virtual"> @@ -589,6 +678,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="disabled" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.body_set_shape_disabled]. </description> </method> <method name="_body_set_shape_transform" qualifiers="virtual"> @@ -597,6 +687,7 @@ <param index="1" name="shape_idx" type="int" /> <param index="2" name="transform" type="Transform2D" /> <description> + Overridable version of [method PhysicsServer2D.body_set_shape_transform]. </description> </method> <method name="_body_set_space" qualifiers="virtual"> @@ -604,6 +695,7 @@ <param index="0" name="body" type="RID" /> <param index="1" name="space" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.body_set_space]. </description> </method> <method name="_body_set_state" qualifiers="virtual"> @@ -612,6 +704,7 @@ <param index="1" name="state" type="int" enum="PhysicsServer2D.BodyState" /> <param index="2" name="value" type="Variant" /> <description> + Overridable version of [method PhysicsServer2D.body_set_state]. </description> </method> <method name="_body_set_state_sync_callback" qualifiers="virtual"> @@ -619,6 +712,8 @@ <param index="0" name="body" type="RID" /> <param index="1" name="callable" type="Callable" /> <description> + Assigns the [param body] to call the given [param callable] during the synchronization phase of the loop, before [method _step] is called. See also [method _sync]. + Overridable version of [PhysicsServer2D]'s internal [code]body_set_state_sync_callback[/code] method. </description> </method> <method name="_body_test_motion" qualifiers="virtual const"> @@ -631,26 +726,31 @@ <param index="5" name="recovery_as_collision" type="bool" /> <param index="6" name="result" type="PhysicsServer2DExtensionMotionResult*" /> <description> + Overridable version of [method PhysicsServer2D.body_test_motion]. Unlike the exposed implementation, this method does not receive all of the arguments inside a [PhysicsTestMotionParameters2D]. </description> </method> <method name="_capsule_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.capsule_shape_create]. </description> </method> <method name="_circle_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.circle_shape_create]. </description> </method> <method name="_concave_polygon_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.concave_polygon_shape_create]. </description> </method> <method name="_convex_polygon_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.convex_polygon_shape_create]. </description> </method> <method name="_damped_spring_joint_get_param" qualifiers="virtual const"> @@ -658,6 +758,7 @@ <param index="0" name="joint" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam" /> <description> + Overridable version of [method PhysicsServer2D.damped_spring_joint_get_param]. </description> </method> <method name="_damped_spring_joint_set_param" qualifiers="virtual"> @@ -666,54 +767,69 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam" /> <param index="2" name="value" type="float" /> <description> + Overridable version of [method PhysicsServer2D.damped_spring_joint_set_param]. </description> </method> <method name="_end_sync" qualifiers="virtual"> <return type="void" /> <description> + Called to indicate that the physics server has stopped synchronizing. It is in the loop's iteration/physics phase, and can access physics objects even if running on a separate thread. See also [method _sync]. + Overridable version of [PhysicsServer2D]'s internal [code]end_sync[/code] method. </description> </method> <method name="_finish" qualifiers="virtual"> <return type="void" /> <description> + Called when the main loop finalizes to shut down the physics server. See also [method MainLoop._finalize] and [method _init]. + Overridable version of [PhysicsServer2D]'s internal [code]finish[/code] method. </description> </method> <method name="_flush_queries" qualifiers="virtual"> <return type="void" /> <description> + Called every physics step before [method _step] to process all remaining queries. + Overridable version of [PhysicsServer2D]'s internal [code]flush_queries[/code] method. </description> </method> <method name="_free_rid" qualifiers="virtual"> <return type="void" /> <param index="0" name="rid" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.free_rid]. </description> </method> <method name="_get_process_info" qualifiers="virtual"> <return type="int" /> <param index="0" name="process_info" type="int" enum="PhysicsServer2D.ProcessInfo" /> <description> + Overridable version of [method PhysicsServer2D.get_process_info]. </description> </method> <method name="_init" qualifiers="virtual"> <return type="void" /> <description> + Called when the main loop is initialized and creates a new instance of this physics server. See also [method MainLoop._initialize] and [method _finish]. + Overridable version of [PhysicsServer2D]'s internal [code]init[/code] method. </description> </method> <method name="_is_flushing_queries" qualifiers="virtual const"> <return type="bool" /> <description> + Overridable method that should return [code]true[/code] when the physics server is processing queries. See also [method _flush_queries]. + Overridable version of [PhysicsServer2D]'s internal [code]is_flushing_queries[/code] method. </description> </method> <method name="_joint_clear" qualifiers="virtual"> <return type="void" /> <param index="0" name="joint" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_clear]. </description> </method> <method name="_joint_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_create]. </description> </method> <method name="_joint_disable_collisions_between_bodies" qualifiers="virtual"> @@ -721,6 +837,7 @@ <param index="0" name="joint" type="RID" /> <param index="1" name="disable" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.joint_disable_collisions_between_bodies]. </description> </method> <method name="_joint_get_param" qualifiers="virtual const"> @@ -728,18 +845,21 @@ <param index="0" name="joint" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.JointParam" /> <description> + Overridable version of [method PhysicsServer2D.joint_get_param]. </description> </method> <method name="_joint_get_type" qualifiers="virtual const"> <return type="int" enum="PhysicsServer2D.JointType" /> <param index="0" name="joint" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_get_type]. </description> </method> <method name="_joint_is_disabled_collisions_between_bodies" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="joint" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_is_disabled_collisions_between_bodies]. </description> </method> <method name="_joint_make_damped_spring" qualifiers="virtual"> @@ -750,6 +870,7 @@ <param index="3" name="body_a" type="RID" /> <param index="4" name="body_b" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_make_damped_spring]. </description> </method> <method name="_joint_make_groove" qualifiers="virtual"> @@ -761,6 +882,7 @@ <param index="4" name="body_a" type="RID" /> <param index="5" name="body_b" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_make_groove]. </description> </method> <method name="_joint_make_pin" qualifiers="virtual"> @@ -770,6 +892,7 @@ <param index="2" name="body_a" type="RID" /> <param index="3" name="body_b" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.joint_make_pin]. </description> </method> <method name="_joint_set_param" qualifiers="virtual"> @@ -778,6 +901,7 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.JointParam" /> <param index="2" name="value" type="float" /> <description> + Overridable version of [method PhysicsServer2D.joint_set_param]. </description> </method> <method name="_pin_joint_get_flag" qualifiers="virtual const"> @@ -785,6 +909,7 @@ <param index="0" name="joint" type="RID" /> <param index="1" name="flag" type="int" enum="PhysicsServer2D.PinJointFlag" /> <description> + Overridable version of [method PhysicsServer2D.pin_joint_get_flag]. </description> </method> <method name="_pin_joint_get_param" qualifiers="virtual const"> @@ -792,6 +917,7 @@ <param index="0" name="joint" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.PinJointParam" /> <description> + Overridable version of [method PhysicsServer2D.pin_joint_get_param]. </description> </method> <method name="_pin_joint_set_flag" qualifiers="virtual"> @@ -800,6 +926,7 @@ <param index="1" name="flag" type="int" enum="PhysicsServer2D.PinJointFlag" /> <param index="2" name="enabled" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.pin_joint_set_flag]. </description> </method> <method name="_pin_joint_set_param" qualifiers="virtual"> @@ -808,27 +935,32 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.PinJointParam" /> <param index="2" name="value" type="float" /> <description> + Overridable version of [method PhysicsServer2D.pin_joint_set_param]. </description> </method> <method name="_rectangle_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.rectangle_shape_create]. </description> </method> <method name="_segment_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.segment_shape_create]. </description> </method> <method name="_separation_ray_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.separation_ray_shape_create]. </description> </method> <method name="_set_active" qualifiers="virtual"> <return type="void" /> <param index="0" name="active" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.set_active]. </description> </method> <method name="_shape_collide" qualifiers="virtual"> @@ -843,24 +975,30 @@ <param index="7" name="result_max" type="int" /> <param index="8" name="result_count" type="int32_t*" /> <description> + Given two shapes and their parameters, should return [code]true[/code] if a collision between the two would occur, with additional details passed in [param results]. + Overridable version of [PhysicsServer2D]'s internal [code]shape_collide[/code] method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. </description> </method> <method name="_shape_get_custom_solver_bias" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shape" type="RID" /> <description> + Should return the custom solver bias of the given [param shape], which defines how much bodies are forced to separate on contact when this shape is involved. + Overridable version of [PhysicsServer2D]'s internal [code]shape_get_custom_solver_bias[/code] method. Corresponds to [member Shape2D.custom_solver_bias]. </description> </method> <method name="_shape_get_data" qualifiers="virtual const"> <return type="Variant" /> <param index="0" name="shape" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.shape_get_data]. </description> </method> <method name="_shape_get_type" qualifiers="virtual const"> <return type="int" enum="PhysicsServer2D.ShapeType" /> <param index="0" name="shape" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.shape_get_type]. </description> </method> <method name="_shape_set_custom_solver_bias" qualifiers="virtual"> @@ -868,6 +1006,8 @@ <param index="0" name="shape" type="RID" /> <param index="1" name="bias" type="float" /> <description> + Should set the custom solver bias for the given [param shape]. It defines how much bodies are forced to separate on contact. + Overridable version of [PhysicsServer2D]'s internal [code]shape_get_custom_solver_bias[/code] method. Corresponds to [member Shape2D.custom_solver_bias]. </description> </method> <method name="_shape_set_data" qualifiers="virtual"> @@ -875,29 +1015,36 @@ <param index="0" name="shape" type="RID" /> <param index="1" name="data" type="Variant" /> <description> + Overridable version of [method PhysicsServer2D.shape_set_data]. </description> </method> <method name="_space_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.space_create]. </description> </method> <method name="_space_get_contact_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="space" type="RID" /> <description> + Should return how many contacts have occurred during the last physics step in the given [param space]. See also [method _space_get_contacts] and [method _space_set_debug_contacts]. + Overridable version of [PhysicsServer2D]'s internal [code]space_get_contact_count[/code] method. </description> </method> <method name="_space_get_contacts" qualifiers="virtual const"> <return type="PackedVector2Array" /> <param index="0" name="space" type="RID" /> <description> + Should return the positions of all contacts that have occurred during the last physics step in the given [param space]. See also [method _space_get_contact_count] and [method _space_set_debug_contacts]. + Overridable version of [PhysicsServer2D]'s internal [code]space_get_contacts[/code] method. </description> </method> <method name="_space_get_direct_state" qualifiers="virtual"> <return type="PhysicsDirectSpaceState2D" /> <param index="0" name="space" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.space_get_direct_state]. </description> </method> <method name="_space_get_param" qualifiers="virtual const"> @@ -905,12 +1052,14 @@ <param index="0" name="space" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer2D.SpaceParameter" /> <description> + Overridable version of [method PhysicsServer2D.space_get_param]. </description> </method> <method name="_space_is_active" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="space" type="RID" /> <description> + Overridable version of [method PhysicsServer2D.space_is_active]. </description> </method> <method name="_space_set_active" qualifiers="virtual"> @@ -918,6 +1067,7 @@ <param index="0" name="space" type="RID" /> <param index="1" name="active" type="bool" /> <description> + Overridable version of [method PhysicsServer2D.space_set_active]. </description> </method> <method name="_space_set_debug_contacts" qualifiers="virtual"> @@ -925,6 +1075,8 @@ <param index="0" name="space" type="RID" /> <param index="1" name="max_contacts" type="int" /> <description> + Used internally to allow the given [param space] to store contact points, up to [param max_contacts]. This is automatically set for the main [World2D]'s space when [member SceneTree.debug_collisions_hint] is [code]true[/code], or by checking "Visible Collision Shapes" in the editor. Only works in debug builds. + Overridable version of [PhysicsServer2D]'s internal [code]space_set_debug_contacts[/code] method. </description> </method> <method name="_space_set_param" qualifiers="virtual"> @@ -933,34 +1085,42 @@ <param index="1" name="param" type="int" enum="PhysicsServer2D.SpaceParameter" /> <param index="2" name="value" type="float" /> <description> + Overridable version of [method PhysicsServer2D.space_set_param]. </description> </method> <method name="_step" qualifiers="virtual"> <return type="void" /> <param index="0" name="step" type="float" /> <description> + Called every physics step to process the physics simulation. [param step] is the time elapsed since the last physics step, in seconds. It is usually the same as [method Node.get_physics_process_delta_time]. + Overridable version of [PhysicsServer2D]'s internal [code skip-lint]step[/code] method. </description> </method> <method name="_sync" qualifiers="virtual"> <return type="void" /> <description> + Called to indicate that the physics server is synchronizing and cannot access physics states if running on a separate thread. See also [method _end_sync]. + Overridable version of [PhysicsServer2D]'s internal [code]sync[/code] method. </description> </method> <method name="_world_boundary_shape_create" qualifiers="virtual"> <return type="RID" /> <description> + Overridable version of [method PhysicsServer2D.world_boundary_shape_create]. </description> </method> <method name="body_test_motion_is_excluding_body" qualifiers="const"> <return type="bool" /> <param index="0" name="body" type="RID" /> <description> + Returns [code]true[/code] if the body with the given [RID] is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. </description> </method> <method name="body_test_motion_is_excluding_object" qualifiers="const"> <return type="bool" /> <param index="0" name="object" type="int" /> <description> + Returns [code]true[/code] if the object with the given instance ID is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. </description> </method> </methods> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index e40d73862b..e835724e36 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -44,7 +44,8 @@ <method name="area_create"> <return type="RID" /> <description> - Creates an [Area3D]. + Creates a 3D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and [code]monitorable[/code] set to [code]false[/code]. + Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. </description> </method> <method name="area_get_collision_layer" qualifiers="const"> @@ -351,6 +352,8 @@ <method name="body_create"> <return type="RID" /> <description> + Creates a 3D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and body mode set to [constant BODY_MODE_RIGID]. + Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. </description> </method> <method name="body_get_collision_layer" qualifiers="const"> @@ -482,7 +485,7 @@ <return type="bool" /> <param index="0" name="body" type="RID" /> <description> - Returns whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). + Returns [code]true[/code] if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. </description> </method> <method name="body_remove_collision_exception"> @@ -582,9 +585,12 @@ <param index="1" name="callable" type="Callable" /> <param index="2" name="userdata" type="Variant" default="null" /> <description> - Sets the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force_integration]). The force integration function takes 2 arguments: - - [code]state[/code] — [PhysicsDirectBodyState3D] used to retrieve and modify the body's state. - - [code skip-lint]userdata[/code] — optional user data passed to [method body_set_force_integration_callback]. + Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. + The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. + If [param userdata] is not [code]null[/code], the function [param callable] must take the following two parameters: + 1. [code]state[/code]: a [PhysicsDirectBodyState3D], used to retrieve and modify the body's state, + 2. [code skip-lint]userdata[/code]: a [Variant]; its value will be the [param userdata] passed into this method. + If [param userdata] is [code]null[/code], then [param callable] must take only the [code]state[/code] parameter. </description> </method> <method name="body_set_max_contacts_reported"> @@ -608,7 +614,8 @@ <param index="0" name="body" type="RID" /> <param index="1" name="enable" type="bool" /> <description> - Sets whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). + Sets whether the body omits the standard force integration. If [param enable] is [code]true[/code], the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. + This method is called when the property [member RigidBody3D.custom_integrator] is set. </description> </method> <method name="body_set_param"> @@ -1624,7 +1631,7 @@ Constant to set/get the priority (order of processing) of an area. </constant> <constant name="AREA_PARAM_WIND_FORCE_MAGNITUDE" value="10" enum="AreaParameter"> - Constant to set/get the magnitude of area-specific wind force. + Constant to set/get the magnitude of area-specific wind force. This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. </constant> <constant name="AREA_PARAM_WIND_SOURCE" value="11" enum="AreaParameter"> Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows. diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 029a69a399..90d3522002 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -91,7 +91,6 @@ </member> <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> The polygon's list of vertices. The final point will be connected to the first. - [b]Note:[/b] This returns a copy of the [PackedVector2Array] rather than a reference. </member> <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[]"> The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in. diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index c435f3d291..29b44a98f2 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -23,9 +23,4 @@ </description> </signal> </signals> - <theme_items> - <theme_item name="panel" data_type="style" type="StyleBox"> - Default [StyleBox] for the [Popup]. - </theme_item> - </theme_items> </class> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 7831ebd1b9..0f5687f091 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -768,6 +768,9 @@ <theme_item name="labeled_separator_right" data_type="style" type="StyleBox"> [StyleBox] for the right side of labeled separator. See [method add_separator]. </theme_item> + <theme_item name="panel" data_type="style" type="StyleBox"> + [StyleBox] for the the background panel. + </theme_item> <theme_item name="separator" data_type="style" type="StyleBox"> [StyleBox] used for the separators. See [method add_separator]. </theme_item> diff --git a/doc/classes/PopupPanel.xml b/doc/classes/PopupPanel.xml index b86972e8af..399e285402 100644 --- a/doc/classes/PopupPanel.xml +++ b/doc/classes/PopupPanel.xml @@ -8,4 +8,9 @@ </description> <tutorials> </tutorials> + <theme_items> + <theme_item name="panel" data_type="style" type="StyleBox"> + [StyleBox] for the the background panel. + </theme_item> + </theme_items> </class> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 6a6f53ac60..32e71ce030 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -10,9 +10,9 @@ [b]Overriding:[/b] Any project setting can be overridden by creating a file named [code]override.cfg[/code] in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' [url=$DOCS_URL/tutorials/export/feature_tags.html]feature tags[/url] in account. Therefore, make sure to [i]also[/i] override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <methods> <method name="add_property_info"> @@ -254,6 +254,7 @@ Path to an image used as the boot splash. If left empty, the default Godot Engine splash will be displayed instead. [b]Note:[/b] Only effective if [member application/boot_splash/show_image] is [code]true[/code]. [b]Note:[/b] The only supported format is PNG. Using another image format will result in an error. + [b]Note:[/b] The image will also show when opening the project in the editor. If you want to display the default splash image in the editor, add an empty override for [code]editor_hint[/code] feature. </member> <member name="application/boot_splash/minimum_display_time" type="int" setter="" getter="" default="0"> Minimum boot splash display time (in milliseconds). It is not recommended to set too high values for this setting. @@ -323,6 +324,11 @@ If [code]true[/code], disables printing to standard output. This is equivalent to starting the editor or project with the [code]--quiet[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. See also [member application/run/disable_stderr]. Changes to this setting will only be applied upon restarting the application. </member> + <member name="application/run/enable_alt_space_menu" type="bool" setter="" getter="" default="false"> + If [code]true[/code], allows the [kbd]Alt + Space[/kbd] keys to display the window menu. This menu allows the user to perform various window management operations such as moving, resizing, or minimizing the window. + [b]Note:[/b] When the menu is displayed, project execution will pause until the menu is [i]fully[/i] closed due to Windows behavior. Consider this when enabling this setting in a networked multiplayer game. The menu is only considered fully closed when an option is selected, when the user clicks outside, or when [kbd]Escape[/kbd] is pressed after bringing up the window menu [i]and[/i] another key is pressed afterwards. + [b]Note:[/b] This setting is implemented only on Windows. + </member> <member name="application/run/flush_stdout_on_print" type="bool" setter="" getter="" default="false"> If [code]true[/code], flushes the standard output stream every time a line is printed. This affects both terminal logging and file logging. When running a project, this setting must be enabled if you want logs to be collected by service managers such as systemd/journalctl. This setting is disabled by default on release builds, since flushing on every printed line will negatively affect performance if lots of lines are printed in a rapid succession. Also, if this setting is enabled, logged files will still be written successfully if the application crashes or is otherwise killed by the user (without being closed "normally"). @@ -338,7 +344,7 @@ This setting can be overridden using the [code]--frame-delay <ms;>[/code] command line argument. </member> <member name="application/run/low_processor_mode" type="bool" setter="" getter="" default="false"> - If [code]true[/code], enables low-processor usage mode. This setting only works on desktop platforms. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games. + If [code]true[/code], enables low-processor usage mode. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games. </member> <member name="application/run/low_processor_mode_sleep_usec" type="int" setter="" getter="" default="6900"> Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. @@ -483,6 +489,9 @@ <member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings. </member> + <member name="debug/gdscript/warnings/enum_variable_without_default" type="int" setter="" getter="" default="1"> + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a variable has an enum type but no explicit default value, but only if the enum does not contain [code]0[/code] as a valid value. + </member> <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true"> If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings. </member> @@ -545,10 +554,10 @@ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when defining a local or subclass member variable that would shadow a variable that is inherited from a parent class. </member> <member name="debug/gdscript/warnings/standalone_expression" type="int" setter="" getter="" default="1"> - When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement. + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling an expression that may have no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement. </member> <member name="debug/gdscript/warnings/standalone_ternary" type="int" setter="" getter="" default="1"> - When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a ternary expression that has no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement. + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a ternary expression that may have no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement. </member> <member name="debug/gdscript/warnings/static_called_on_instance" type="int" setter="" getter="" default="1"> When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a static method from an instance of a class instead of from the class directly. @@ -569,7 +578,7 @@ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when using an expression whose type may not be compatible with the function parameter expected. </member> <member name="debug/gdscript/warnings/unsafe_cast" type="int" setter="" getter="" default="0"> - When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when performing an unsafe cast. + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a [Variant] value is cast to a non-Variant. </member> <member name="debug/gdscript/warnings/unsafe_method_access" type="int" setter="" getter="" default="0"> When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a method whose presence is not guaranteed at compile-time in the class. @@ -632,6 +641,9 @@ <member name="debug/shader_language/warnings/formatting_error" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning upon encountering certain formatting errors. Currently this only checks for empty statements. More formatting errors may be added over time. </member> + <member name="debug/shader_language/warnings/magic_position_write" type="bool" setter="" getter="" default="true"> + When set to [code]true[/code], produces a warning when the shader contains [code]POSITION = vec4(vertex,[/code] as this was very common code written in Godot 4.2 and earlier that was paired with a QuadMesh to produce a full screen post processes pass. With the switch to reversed z in 4.3, this trick no longer works, as it implicitly relied on the [code]VERTEX.z[/code] being 0. + </member> <member name="debug/shader_language/warnings/treat_warnings_as_errors" type="bool" setter="" getter="" default="false"> When set to [code]true[/code], warnings are treated as errors. </member> @@ -786,8 +798,8 @@ <member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true"> If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms. </member> - <member name="display/window/energy_saving/keep_screen_on.editor" type="bool" setter="" getter="" default="false"> - Editor-only override for [member display/window/energy_saving/keep_screen_on]. Does not affect exported projects in debug or release mode. + <member name="display/window/energy_saving/keep_screen_on.editor_hint" type="bool" setter="" getter="" default="false"> + Editor-only override for [member display/window/energy_saving/keep_screen_on]. Does not affect running project. </member> <member name="display/window/handheld/orientation" type="int" setter="" getter="" default="0"> The default screen orientation to use on mobile devices. See [enum DisplayServer.ScreenOrientation] for possible values. @@ -890,8 +902,9 @@ <member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1"> Sets the V-Sync mode for the main game window. The editor's own V-Sync mode can be set using [member EditorSettings.interface/editor/vsync_mode]. See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application. - Depending on the platform and used renderer, the engine will fall back to [b]Enabled[/b] if the desired mode is not supported. - [b]Note:[/b] V-Sync modes other than [b]Enabled[/b] are only supported in the Forward+ and Mobile rendering methods, not Compatibility. + Depending on the platform and rendering method, the engine will fall back to [b]Enabled[/b] if the desired mode is not supported. + V-Sync can be disabled on the command line using the [code]--disable-vsync[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. + [b]Note:[/b] The [b]Adaptive[/b] and [b]Mailbox[/b] V-Sync modes are only supported in the Forward+ and Mobile rendering methods, not Compatibility. [b]Note:[/b] This property is only read when the project starts. To change the V-Sync mode at runtime, call [method DisplayServer.window_set_vsync_mode] instead. </member> <member name="dotnet/project/assembly_name" type="String" setter="" getter="" default=""""> @@ -964,7 +977,7 @@ The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself. It is possible to make another executable run Godot by using the [code]%command%[/code] placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed [i]before[/i] the placeholder, whereas Godot-specific arguments should be placed [i]after[/i] the placeholder. For example, this can be used to force the project to run on the dedicated GPU in an NVIDIA Optimus system on Linux: - [codeblock] + [codeblock lang=text] prime-run %command% [/codeblock] </member> @@ -1060,6 +1073,9 @@ <member name="gui/timers/tooltip_delay_sec" type="float" setter="" getter="" default="0.5"> Default delay for tooltips (in seconds). </member> + <member name="gui/timers/tooltip_delay_sec.editor_hint" type="float" setter="" getter="" default="0.5"> + Delay for tooltips in the editor. + </member> <member name="input/ui_accept" type="Dictionary" setter="" getter=""> Default [InputEventAction] to confirm a focused button, menu or list item, or validate input. [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. @@ -1431,6 +1447,10 @@ <member name="internationalization/rendering/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false"> Force layout direction and text writing direction to RTL for all controls. </member> + <member name="internationalization/rendering/root_node_auto_translate" type="bool" setter="" getter="" default="true"> + If [code]true[/code], root node will use [constant Node.AUTO_TRANSLATE_MODE_ALWAYS], otherwise [constant Node.AUTO_TRANSLATE_MODE_DISABLED] will be used. + [b]Note:[/b] This property is only read when the project starts. To change the auto translate mode at runtime, set [member Node.auto_translate_mode] of [member SceneTree.root] instead. + </member> <member name="internationalization/rendering/root_node_layout_direction" type="int" setter="" getter="" default="0"> Root node default layout direction. </member> @@ -2694,8 +2714,8 @@ <member name="rendering/renderer/rendering_method.web" type="String" setter="" getter="" default=""gl_compatibility""> Override for [member rendering/renderer/rendering_method] on web. </member> - <member name="rendering/rendering_device/d3d12/agility_sdk_version" type="int" setter="" getter="" default="610"> - Version code of the Direct3D 12 Agility SDK to use ([code]D3D12SDKVersion[/code]). + <member name="rendering/rendering_device/d3d12/agility_sdk_version" type="int" setter="" getter="" default="613"> + Version code of the [url=https://devblogs.microsoft.com/directx/directx12agility/]Direct3D 12 Agility SDK[/url] to use ([code]D3D12SDKVersion[/code]). This must match the [i]minor[/i] version that is installed next to the editor binary and in the export templates directory for the current editor version. For example, if you have [code]1.613.3[/code] installed, you need to input [code]613[/code] here. </member> <member name="rendering/rendering_device/d3d12/max_misc_descriptors_per_frame" type="int" setter="" getter="" default="512"> The number of entries in the miscellaneous descriptors heap the Direct3D 12 rendering driver uses each frame, used for various operations like clearing a texture. @@ -2850,7 +2870,7 @@ <member name="rendering/vrs/texture" type="String" setter="" getter="" default=""""> If [member rendering/vrs/mode] is set to [b]Texture[/b], this is the path to default texture loaded as the VRS image. The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision: - [codeblock] + [codeblock lang=text] - 1×1 = rgb(0, 0, 0) - #000000 - 1×2 = rgb(0, 85, 0) - #005500 - 2×1 = rgb(85, 0, 0) - #550000 @@ -2881,6 +2901,9 @@ <member name="xr/openxr/extensions/eye_gaze_interaction" type="bool" setter="" getter="" default="false"> Specify whether to enable eye tracking for this project. Depending on the platform, additional export configuration may be needed. </member> + <member name="xr/openxr/extensions/hand_interaction_profile" type="bool" setter="" getter="" default="false"> + If true the hand interaction profile extension will be activated if supported by the platform. + </member> <member name="xr/openxr/extensions/hand_tracking" type="bool" setter="" getter="" default="true"> If true we enable the hand tracking extension if available. </member> diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml index c5164e9feb..d840616fdd 100644 --- a/doc/classes/QuadMesh.xml +++ b/doc/classes/QuadMesh.xml @@ -7,8 +7,8 @@ Class representing a square [PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this rotation is more suited for use with billboarded materials. A [QuadMesh] is equivalent to a [PlaneMesh] except its default [member PlaneMesh.orientation] is [constant PlaneMesh.FACE_Z]. </description> <tutorials> - <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> - <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link> + <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> + <link title="2D in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2803</link> </tutorials> <members> <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" overrides="PlaneMesh" enum="PlaneMesh.Orientation" default="2" /> diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index 8b59448555..665c6335f2 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -14,7 +14,7 @@ <link title="3Blue1Brown's video on Quaternions">https://www.youtube.com/watch?v=d4EgbgTm0Bg</link> <link title="Online Quaternion Visualization">https://quaternions.online/</link> <link title="Using 3D transforms">$DOCS_URL/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> <link title="Advanced Quaternion Visualization">https://iwatake2222.github.io/rotation_master/rotation_master.html</link> </tutorials> <constructors> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 31daaab417..16643b0a71 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -56,6 +56,21 @@ <return type="int" /> <description> Returns the shape ID of the first object that the ray intersects, or [code]0[/code] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]). + To get the intersected shape node, for a [CollisionObject2D] target, use: + [codeblocks] + [gdscript] + var target = get_collider() # A CollisionObject2D. + var shape_id = get_collider_shape() # The shape index in the collider. + var owner_id = target.shape_find_owner(shape_id) # The owner ID in the collider. + var shape = target.shape_owner_get_owner(owner_id) + [/gdscript] + [csharp] + var target = (CollisionObject2D)GetCollider(); // A CollisionObject2D. + var shapeId = GetColliderShape(); // The shape index in the collider. + var ownerId = target.ShapeFindOwner(shapeId); // The owner ID in the collider. + var shape = target.ShapeOwnerGetOwner(ownerId); + [/csharp] + [/codeblocks] </description> </method> <method name="get_collision_mask_value" qualifiers="const"> diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml index f9f94e5cfc..18a544d114 100644 --- a/doc/classes/RayCast3D.xml +++ b/doc/classes/RayCast3D.xml @@ -11,7 +11,7 @@ </description> <tutorials> <link title="Ray-casting">$DOCS_URL/tutorials/physics/ray-casting.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="add_exception"> @@ -57,6 +57,21 @@ <return type="int" /> <description> Returns the shape ID of the first object that the ray intersects, or [code]0[/code] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]). + To get the intersected shape node, for a [CollisionObject3D] target, use: + [codeblocks] + [gdscript] + var target = get_collider() # A CollisionObject3D. + var shape_id = get_collider_shape() # The shape index in the collider. + var owner_id = target.shape_find_owner(shape_id) # The owner ID in the collider. + var shape = target.shape_owner_get_owner(owner_id) + [/gdscript] + [csharp] + var target = (CollisionObject3D)GetCollider(); // A CollisionObject3D. + var shapeId = GetColliderShape(); // The shape index in the collider. + var ownerId = target.ShapeFindOwner(shapeId); // The owner ID in the collider. + var shape = target.ShapeOwnerGetOwner(ownerId); + [/csharp] + [/codeblocks] </description> </method> <method name="get_collision_face_index" qualifiers="const"> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 0471d73749..ba7dcab2d7 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -89,13 +89,13 @@ var rect = Rect2(0, 0, 5, 2) rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2) - rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 10, 5) + rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 15, 5) [/gdscript] [csharp] var rect = new Rect2(0, 0, 5, 2); rect = rect.Expand(new Vector2(10, 0)); // rect is Rect2(0, 0, 10, 2) - rect = rect.Expand(new Vector2(-5, 5)); // rect is Rect2(-5, 0, 10, 5) + rect = rect.Expand(new Vector2(-5, 5)); // rect is Rect2(-5, 0, 15, 5) [/csharp] [/codeblocks] </description> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index c021a1be26..cbd09f8430 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -88,13 +88,13 @@ var rect = Rect2i(0, 0, 5, 2) rect = rect.expand(Vector2i(10, 0)) # rect is Rect2i(0, 0, 10, 2) - rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 10, 5) + rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 15, 5) [/gdscript] [csharp] var rect = new Rect2I(0, 0, 5, 2); rect = rect.Expand(new Vector2I(10, 0)); // rect is Rect2I(0, 0, 10, 2) - rect = rect.Expand(new Vector2I(-5, 5)); // rect is Rect2I(-5, 0, 10, 5) + rect = rect.Expand(new Vector2I(-5, 5)); // rect is Rect2I(-5, 0, 15, 5) [/csharp] [/codeblocks] </description> diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml index 721d73dc14..a62b997a0a 100644 --- a/doc/classes/RectangleShape2D.xml +++ b/doc/classes/RectangleShape2D.xml @@ -8,8 +8,8 @@ [b]Performance:[/b] [RectangleShape2D] is fast to check collisions against. It is faster than [CapsuleShape2D], but slower than [CircleShape2D]. </description> <tutorials> - <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link> - <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> + <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/2728</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> </tutorials> <members> <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(20, 20)"> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 33cd831175..3c1061dee9 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -138,6 +138,15 @@ Submits the compute list for processing on the GPU. This is the compute equivalent to [method draw_list_draw]. </description> </method> + <method name="compute_list_dispatch_indirect"> + <return type="void" /> + <param index="0" name="compute_list" type="int" /> + <param index="1" name="buffer" type="RID" /> + <param index="2" name="offset" type="int" /> + <description> + Submits the compute list for processing on the GPU with the given group counts stored in the [param buffer] at [param offset]. Buffer must have been created with [constant STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT] flag. + </description> + </method> <method name="compute_list_end"> <return type="void" /> <description> @@ -2129,8 +2138,10 @@ Represents the size of the [enum BlendOperation] enum. </constant> <constant name="DYNAMIC_STATE_LINE_WIDTH" value="1" enum="PipelineDynamicStateFlags" is_bitfield="true"> + Allows dynamically changing the width of rendering lines. </constant> <constant name="DYNAMIC_STATE_DEPTH_BIAS" value="2" enum="PipelineDynamicStateFlags" is_bitfield="true"> + Allows dynamically changing the depth bias. </constant> <constant name="DYNAMIC_STATE_BLEND_CONSTANTS" value="4" enum="PipelineDynamicStateFlags" is_bitfield="true"> </constant> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index c74d61ab88..3c9f0fc7af 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -92,13 +92,13 @@ Sets the exposure values that will be used by the renderers. The normalization amount is used to bake a given Exposure Value (EV) into rendering calculations to reduce the dynamic range of the scene. The normalization factor can be calculated from exposure value (EV100) as follows: [codeblock] - func get_exposure_normalization(float ev100): - return 1.0 / (pow(2.0, ev100) * 1.2) + func get_exposure_normalization(ev100: float): + return 1.0 / (pow(2.0, ev100) * 1.2) [/codeblock] The exposure value can be calculated from aperture (in f-stops), shutter speed (in seconds), and sensitivity (in ISO) as follows: [codeblock] - func get_exposure(float aperture, float shutter_speed, float sensitivity): - return log2((aperture * aperture) / shutterSpeed * (100.0 / sensitivity)) + func get_exposure(aperture: float, shutter_speed: float, sensitivity: float): + return log((aperture * aperture) / shutter_speed * (100.0 / sensitivity)) / log(2) [/codeblock] </description> </method> @@ -214,6 +214,7 @@ <param index="1" name="pos" type="Vector2" /> <param index="2" name="radius" type="float" /> <param index="3" name="color" type="Color" /> + <param index="4" name="antialiased" type="bool" default="false" /> <description> Draws a circle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_circle]. </description> @@ -280,6 +281,7 @@ <param index="1" name="points" type="PackedVector2Array" /> <param index="2" name="colors" type="PackedColorArray" /> <param index="3" name="width" type="float" default="-1.0" /> + <param index="4" name="antialiased" type="bool" default="false" /> <description> Draws a 2D multiline on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_multiline] and [method CanvasItem.draw_multiline_colors]. </description> @@ -356,6 +358,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="color" type="Color" /> + <param index="3" name="antialiased" type="bool" default="false" /> <description> Draws a rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_rect]. </description> @@ -634,7 +637,7 @@ <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. + This allows transforming a canvas item without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin. </description> </method> <method name="canvas_light_attach_to_canvas"> @@ -730,7 +733,7 @@ <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. + This allows transforming an occluder without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin. </description> </method> <method name="canvas_light_reset_physics_interpolation"> @@ -901,7 +904,7 @@ <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. + This allows transforming a light without creating a "glitch" in the interpolation, which is is particularly useful for large worlds utilizing a shifting origin. </description> </method> <method name="canvas_occluder_polygon_create"> @@ -1932,7 +1935,7 @@ <param index="0" name="instance" type="RID" /> <param index="1" name="transform" type="Transform3D" /> <description> - Sets the world space transform of the instance. Equivalent to [member Node3D.transform]. + Sets the world space transform of the instance. Equivalent to [member Node3D.global_transform]. </description> </method> <method name="instance_set_visibility_parent"> @@ -1979,6 +1982,12 @@ [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. </description> </method> + <method name="is_on_render_thread"> + <return type="bool" /> + <description> + Returns [code]true[/code] if our code is currently executing on the rendering thread. + </description> + </method> <method name="light_directional_set_blend_splits"> <return type="void" /> <param index="0" name="light" type="RID" /> @@ -2576,7 +2585,7 @@ <description> Set the entire data to use for drawing the [param multimesh] at once to [param buffer] (such as instance transforms and colors). [param buffer]'s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also [method multimesh_get_buffer]. The per-instance data size and expected data order is: - [codeblock] + [codeblock lang=text] 2D: - Position: 8 floats (8 floats for Transform2D) - Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color) @@ -4030,6 +4039,15 @@ The texture to use when the VRS mode is set to [constant RenderingServer.VIEWPORT_VRS_TEXTURE]. Equivalent to [member ProjectSettings.rendering/vrs/texture]. </description> </method> + <method name="viewport_set_vrs_update_mode"> + <return type="void" /> + <param index="0" name="viewport" type="RID" /> + <param index="1" name="mode" type="int" enum="RenderingServer.ViewportVRSUpdateMode" /> + <description> + Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored. + If set to [constant RenderingServer.VIEWPORT_VRS_UPDATE_ONCE], the input texture is copied once and the mode is changed to [constant RenderingServer.VIEWPORT_VRS_UPDATE_DISABLED]. + </description> + </method> <method name="visibility_notifier_create"> <return type="RID" /> <description> @@ -4221,6 +4239,9 @@ <constant name="MAX_2D_DIRECTIONAL_LIGHTS" value="8"> The maximum number of directional lights that can be rendered at a given time in 2D. </constant> + <constant name="MAX_MESH_SURFACES" value="256"> + The maximum number of surfaces a mesh can have. + </constant> <constant name="TEXTURE_LAYERED_2D_ARRAY" value="0" enum="TextureLayeredType"> Array of 2-dimensional textures (see [Texture2DArray]). </constant> @@ -4970,11 +4991,23 @@ Variable rate shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. </constant> <constant name="VIEWPORT_VRS_XR" value="2" enum="ViewportVRSMode"> - Variable rate shading texture is supplied by the primary [XRInterface]. + Variable rate shading texture is supplied by the primary [XRInterface]. Note that this may override the update mode. </constant> <constant name="VIEWPORT_VRS_MAX" value="3" enum="ViewportVRSMode"> Represents the size of the [enum ViewportVRSMode] enum. </constant> + <constant name="VIEWPORT_VRS_UPDATE_DISABLED" value="0" enum="ViewportVRSUpdateMode"> + The input texture for variable rate shading will not be processed. + </constant> + <constant name="VIEWPORT_VRS_UPDATE_ONCE" value="1" enum="ViewportVRSUpdateMode"> + The input texture for variable rate shading will be processed once. + </constant> + <constant name="VIEWPORT_VRS_UPDATE_ALWAYS" value="2" enum="ViewportVRSUpdateMode"> + The input texture for variable rate shading will be processed each frame. + </constant> + <constant name="VIEWPORT_VRS_UPDATE_MAX" value="3" enum="ViewportVRSUpdateMode"> + Represents the size of the [enum ViewportVRSUpdateMode] enum. + </constant> <constant name="SKY_MODE_AUTOMATIC" value="0" enum="SkyMode"> Automatically selects the appropriate process mode based on your sky shader. If your shader uses [code]TIME[/code] or [code]POSITION[/code], this will use [constant SKY_MODE_REALTIME]. If your shader uses any of the [code]LIGHT_*[/code] variables or any custom uniforms, this uses [constant SKY_MODE_INCREMENTAL]. Otherwise, this defaults to [constant SKY_MODE_QUALITY]. </constant> diff --git a/doc/classes/ResourceImporterCSVTranslation.xml b/doc/classes/ResourceImporterCSVTranslation.xml index 122728e75a..578a79fdca 100644 --- a/doc/classes/ResourceImporterCSVTranslation.xml +++ b/doc/classes/ResourceImporterCSVTranslation.xml @@ -6,7 +6,7 @@ <description> Comma-separated values are a plain text table storage format. The format's simplicity makes it easy to edit in any text editor or spreadsheet software. This makes it a common choice for game localization. [b]Example CSV file:[/b] - [codeblock] + [codeblock lang=text] keys,en,es,ja GREET,"Hello, friend!","Hola, amigo!",こんにちは ASK,How are you?,Cómo está?,元気ですか diff --git a/doc/classes/ResourceImporterWAV.xml b/doc/classes/ResourceImporterWAV.xml index 5336c98d0f..d3dafb03b6 100644 --- a/doc/classes/ResourceImporterWAV.xml +++ b/doc/classes/ResourceImporterWAV.xml @@ -14,6 +14,7 @@ The compression mode to use on import. [b]Disabled:[/b] Imports audio data without any compression. This results in the highest possible quality. [b]RAM (Ima-ADPCM):[/b] Performs fast lossy compression on import. Low CPU cost, but quality is noticeably decreased compared to Ogg Vorbis or even MP3. + [b]QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]):[/b] Performs lossy compression on import. CPU cost is slightly higher than IMA-ADPCM, but quality is much higher. </member> <member name="edit/loop_begin" type="int" setter="" getter="" default="0"> The begin loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the beginning of the audio file. diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 95fbee4a24..1961ca2b0e 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -9,7 +9,7 @@ [b]Note:[/b] You have to import the files into the engine first to load them using [method load]. If you want to load [Image]s at run-time, you may use [method Image.load]. If you want to import audio files, you can use the snippet described in [member AudioStreamMP3.data]. </description> <tutorials> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <methods> <method name="add_resource_format_loader"> @@ -76,9 +76,10 @@ The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. - Returns an empty resource if no [ResourceFormatLoader] could handle the file. + Returns an empty resource if no [ResourceFormatLoader] could handle the file, and prints an error if no file is found at the specified path. GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios. [b]Note:[/b] If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to [code]false[/code]. + [b]Note:[/b] Relative paths will be prefixed with [code]"res://"[/code] before loading, to avoid unexpected results make sure your paths are absolute. </description> </method> <method name="load_threaded_get"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index b9a6b06fe3..24d2d26beb 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -12,8 +12,8 @@ </description> <tutorials> <link title="BBCode in RichTextLabel">$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link> - <link title="GUI Rich Text/BBcode Demo">https://godotengine.org/asset-library/asset/132</link> - <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> + <link title="Rich Text Label with BBCode Demo">https://godotengine.org/asset-library/asset/2774</link> + <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials> <methods> <method name="add_image"> @@ -249,6 +249,13 @@ [/codeblock] </description> </method> + <method name="invalidate_paragraph"> + <return type="bool" /> + <param index="0" name="paragraph" type="int" /> + <description> + Invalidates [param paragraph] and all subsequent paragraphs cache. + </description> + </method> <method name="is_menu_visible" qualifiers="const"> <return type="bool" /> <description> @@ -328,7 +335,7 @@ <method name="push_cell"> <return type="void" /> <description> - Adds a [code skip-lint][cell][/code] tag to the tag stack. Must be inside a [code skip-lint][table][/code] tag. See [method push_table] for details. + Adds a [code skip-lint][cell][/code] tag to the tag stack. Must be inside a [code skip-lint][table][/code] tag. See [method push_table] for details. Use [method set_table_column_expand] to set column expansion ratio, [method set_cell_border_color] to set cell border, [method set_cell_row_background_color] to set cell background, [method set_cell_size_override] to override cell size, and [method set_cell_padding] to set padding. </description> </method> <method name="push_color"> @@ -485,7 +492,7 @@ <param index="1" name="inline_align" type="int" enum="InlineAlignment" default="0" /> <param index="2" name="align_to_row" type="int" default="-1" /> <description> - Adds a [code skip-lint][table=columns,inline_align][/code] tag to the tag stack. + Adds a [code skip-lint][table=columns,inline_align][/code] tag to the tag stack. Use [method set_table_column_expand] to set column expansion ratio. Use [method push_cell] to add cells. </description> </method> <method name="push_underline"> @@ -497,9 +504,11 @@ <method name="remove_paragraph"> <return type="bool" /> <param index="0" name="paragraph" type="int" /> + <param index="1" name="no_invalidate" type="bool" default="false" /> <description> Removes a paragraph of content from the label. Returns [code]true[/code] if the paragraph exists. The [param paragraph] argument is the index of the paragraph to remove, it can take values in the interval [code][0, get_paragraph_count() - 1][/code]. + If [param no_invalidate] is set to [code]true[/code], cache for the subsequent paragraphs is not invalidated. Use it for faster updates if deleted paragraph is fully self-contained (have no unclosed tags), or this call is part of the complex edit operation and [method invalidate_paragraph] will be called at the end of operation. </description> </method> <method name="scroll_to_line"> diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 269ead1298..5661d1a276 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -11,15 +11,15 @@ [b]Note:[/b] Changing the 2D transform or [member linear_velocity] of a [RigidBody2D] very often may lead to some unpredictable behaviors. If you need to directly affect the body, prefer [method _integrate_forces] as it allows you to directly access the physics state. </description> <tutorials> - <link title="2D Physics Platformer Demo">https://godotengine.org/asset-library/asset/119</link> - <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link> + <link title="2D Physics Platformer Demo">https://godotengine.org/asset-library/asset/2725</link> + <link title="Instancing Demo">https://godotengine.org/asset-library/asset/2716</link> </tutorials> <methods> <method name="_integrate_forces" qualifiers="virtual"> <return type="void" /> <param index="0" name="state" type="PhysicsDirectBodyState2D" /> <description> - Allows you to read and safely modify the simulation state for the object. Use this instead of [method Node._physics_process] if you need to directly change the body's [code]position[/code] or other physics properties. By default, it works in addition to the usual physics behavior, but [member custom_integrator] allows you to disable the default behavior and write custom force integration for a body. + Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. </description> </method> <method name="add_constant_central_force"> @@ -159,7 +159,8 @@ Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details. </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" default="false"> - If [code]true[/code], internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the [method _integrate_forces] function. + If [code]true[/code], the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. + Setting this property will call the method [method PhysicsServer2D.body_set_omit_force_integration] internally. </member> <member name="freeze" type="bool" setter="set_freeze_enabled" getter="is_freeze_enabled" default="false"> If [code]true[/code], the body is frozen. Gravity and forces are not applied anymore. diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index c507a7c39a..dae904e2a3 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -12,15 +12,15 @@ </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> - <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> + <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/2752</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> </tutorials> <methods> <method name="_integrate_forces" qualifiers="virtual"> <return type="void" /> <param index="0" name="state" type="PhysicsDirectBodyState3D" /> <description> - Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [member custom_integrator] property allows you to disable the default behavior and do fully custom force integration for a body. + Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. </description> </method> <method name="add_constant_central_force"> @@ -166,7 +166,8 @@ Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" default="false"> - If [code]true[/code], internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined. + If [code]true[/code], the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. + Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally. </member> <member name="freeze" type="bool" setter="set_freeze_enabled" getter="is_freeze_enabled" default="false"> If [code]true[/code], the body is frozen. Gravity and forces are not applied anymore. diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml index 2c88ecd675..43ee4dda60 100644 --- a/doc/classes/ScriptEditor.xml +++ b/doc/classes/ScriptEditor.xml @@ -34,6 +34,35 @@ Returns an array with all [Script] objects which are currently open in editor. </description> </method> + <method name="goto_help"> + <return type="void" /> + <param index="0" name="topic" type="String" /> + <description> + Opens help for the given topic. The [param topic] is an encoded string that controls which class, method, constant, signal, annotation, property, or theme item should be focused. + The supported [param topic] formats include [code]class_name:class[/code], [code]class_method:class:method[/code], [code]class_constant:class:constant[/code], [code]class_signal:class:signal[/code], [code]class_annotation:class:@annotation[/code], [code]class_property:class:property[/code], and [code]class_theme_item:class:item[/code], where [code]class[/code] is the class name, [code]method[/code] is the method name, [code]constant[/code] is the constant name, [code]signal[/code] is the signal name, [code]annotation[/code] is the annotation name, [code]property[/code] is the property name, and [code]item[/code] is the theme item. + [b]Examples:[/b] + [codeblock] + # Shows help for the Node class. + class_name:Node + # Shows help for the global min function. + # Global objects are accessible in the `@GlobalScope` namespace, shown here. + class_method:@GlobalScope:min + # Shows help for get_viewport in the Node class. + class_method:Node:get_viewport + # Shows help for the Input constant MOUSE_BUTTON_MIDDLE. + class_constant:Input:MOUSE_BUTTON_MIDDLE + # Shows help for the BaseButton signal pressed. + class_signal:BaseButton:pressed + # Shows help for the CanvasItem property visible. + class_property:CanvasItem:visible + # Shows help for the GDScript annotation export. + # Annotations should be prefixed with the `@` symbol in the descriptor, as shown here. + class_annotation:@GDScript:@export + # Shows help for the GraphNode theme item named panel_selected. + class_theme_item:GraphNode:panel_selected + [/codeblock] + </description> + </method> <method name="goto_line"> <return type="void" /> <param index="0" name="line_number" type="int" /> diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml index dca4fe9276..403608355a 100644 --- a/doc/classes/ScriptEditorBase.xml +++ b/doc/classes/ScriptEditorBase.xml @@ -71,6 +71,12 @@ Emitted when the user contextual goto and the item is in the same script. </description> </signal> + <signal name="request_save_previous_state"> + <param index="0" name="line" type="int" /> + <description> + Emitted when the user changes current script or moves caret by 10 or more columns within the same script. + </description> + </signal> <signal name="search_in_files_requested"> <param index="0" name="text" type="String" /> <description> diff --git a/doc/classes/ShapeCast2D.xml b/doc/classes/ShapeCast2D.xml index d71c9ce13a..576bd62cc3 100644 --- a/doc/classes/ShapeCast2D.xml +++ b/doc/classes/ShapeCast2D.xml @@ -48,6 +48,7 @@ <return type="float" /> <description> The fraction from the [ShapeCast2D]'s origin to its [member target_position] (between 0 and 1) of how far the shape must move to trigger a collision. + In ideal conditions this would be the same as [method get_closest_collision_safe_fraction], however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions. </description> </method> <method name="get_collider" qualifiers="const"> diff --git a/doc/classes/ShapeCast3D.xml b/doc/classes/ShapeCast3D.xml index ff057e8c70..2c6efe2ebe 100644 --- a/doc/classes/ShapeCast3D.xml +++ b/doc/classes/ShapeCast3D.xml @@ -48,6 +48,7 @@ <return type="float" /> <description> The fraction from the [ShapeCast3D]'s origin to its [member target_position] (between 0 and 1) of how far the shape must move to trigger a collision. + In ideal conditions this would be the same as [method get_closest_collision_safe_fraction], however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions. </description> </method> <method name="get_collider" qualifiers="const"> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 17c93af652..610550d8bd 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -9,8 +9,7 @@ Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it is not the actual global/world transform of the bone. </description> <tutorials> - <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="add_bone"> @@ -42,7 +41,7 @@ <return type="int" /> <param index="0" name="name" type="String" /> <description> - Returns the bone index that matches [param name] as its name. + Returns the bone index that matches [param name] as its name. Returns [code]-1[/code] if no bone with this name exists. </description> </method> <method name="force_update_all_bone_transforms" deprecated="This method should only be called internally."> @@ -253,7 +252,7 @@ <param index="1" name="pose" type="Transform3D" /> <description> Sets the global pose transform, [param pose], for the bone at [param bone_idx]. - [b]Note:[/b] If other bone poses have been changed, this method executes an update process and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation. + [b]Note:[/b] If other bone poses have been changed, this method executes a dirty poses recalculation and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation. </description> </method> <method name="set_bone_global_pose_override" deprecated=""> @@ -356,15 +355,10 @@ <description> </description> </signal> - <signal name="bone_pose_changed"> - <param index="0" name="bone_idx" type="int" /> - <description> - Emitted when the bone at [param bone_idx] changes its transform/pose. This can be used to update other nodes that rely on bone positions. - </description> - </signal> <signal name="pose_updated"> <description> - Emitted when the pose is updated, after [constant NOTIFICATION_UPDATE_SKELETON] is received. + Emitted when the pose is updated. + [b]Note:[/b] During the update process, this signal is not fired, so modification by [SkeletonModifier3D] is not detected. </description> </signal> <signal name="show_rest_only_changed"> @@ -372,11 +366,16 @@ Emitted when the value of [member show_rest_only] changes. </description> </signal> + <signal name="skeleton_updated"> + <description> + Emitted when the final pose has been calculated will be applied to the skin in the update process. + This means that all [SkeletonModifier3D] processing is complete. In order to detect the completion of the processing of each [SkeletonModifier3D], use [signal SkeletonModifier3D.modification_processed]. + </description> + </signal> </signals> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> - Notification received when this skeleton's pose needs to be updated. - This notification is received [i]before[/i] the related [signal pose_updated] signal. + Notification received when this skeleton's pose needs to be updated. In that case, this is called only once per frame in a deferred process. </constant> <constant name="MODIFIER_CALLBACK_MODE_PROCESS_PHYSICS" value="0" enum="ModifierCallbackModeProcess"> Set a flag to process modification during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml index 46b3d79795..4858a6ce22 100644 --- a/doc/classes/SkeletonIK3D.xml +++ b/doc/classes/SkeletonIK3D.xml @@ -26,7 +26,6 @@ [/codeblock] </description> <tutorials> - <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link> </tutorials> <methods> <method name="get_parent_skeleton" qualifiers="const"> @@ -56,6 +55,9 @@ </method> </methods> <members> + <member name="interpolation" type="float" setter="set_interpolation" getter="get_interpolation" deprecated="Use [member SkeletonModifier3D.influence] instead."> + Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of [code]1.0[/code] will overwrite all skeleton bone transforms completely while a value of [code]0.0[/code] will visually disable the SkeletonIK. + </member> <member name="magnet" type="Vector3" setter="set_magnet_position" getter="get_magnet_position" default="Vector3(0, 0, 0)"> Secondary target position (first is [member target] property or [member target_node]) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. </member> diff --git a/doc/classes/SkeletonModifier3D.xml b/doc/classes/SkeletonModifier3D.xml index fab33750ea..c0b1b6fd53 100644 --- a/doc/classes/SkeletonModifier3D.xml +++ b/doc/classes/SkeletonModifier3D.xml @@ -6,9 +6,19 @@ <description> [SkeletonModifier3D] retrieves a target [Skeleton3D] by having a [Skeleton3D] parent. If there is [AnimationMixer], modification always performs after playback process of the [AnimationMixer]. + This node should be used to implement custom IK solvers, constraints, or skeleton physics </description> <tutorials> </tutorials> + <methods> + <method name="_process_modification" qualifiers="virtual"> + <return type="void" /> + <description> + Override this virtual method to implement a custom skeleton modifier. You should do things like get the [Skeleton3D]'s current pose and apply the pose here. + [method _process_modification] must not apply [member influence] to bone poses because the [Skeleton3D] automatically applies influence to all bone poses set by the modifier. + </description> + </method> + </methods> <members> <member name="active" type="bool" setter="set_active" getter="is_active" default="true"> If [code]true[/code], the [SkeletonModifier3D] will be processing. diff --git a/doc/classes/SkeletonProfileHumanoid.xml b/doc/classes/SkeletonProfileHumanoid.xml index 5539d1d980..9c9cc2d8c7 100644 --- a/doc/classes/SkeletonProfileHumanoid.xml +++ b/doc/classes/SkeletonProfileHumanoid.xml @@ -6,7 +6,7 @@ <description> A [SkeletonProfile] as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. A humanoid skeleton profile contains 54 bones divided in 4 groups: [code]"Body"[/code], [code]"Face"[/code], [code]"LeftHand"[/code], and [code]"RightHand"[/code]. It is structured as follows: - [codeblock] + [codeblock lang=text] Root └─ Hips ├─ LeftUpperLeg diff --git a/doc/classes/SkinReference.xml b/doc/classes/SkinReference.xml index 466dbe2500..cb0c44cefa 100644 --- a/doc/classes/SkinReference.xml +++ b/doc/classes/SkinReference.xml @@ -1,8 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SkinReference" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + A reference-counted holder object for a skeleton RID used in the [RenderingServer]. </brief_description> <description> + An internal object containing a mapping from a [Skin] used within the context of a particular [MeshInstance3D] to refer to the skeleton's [RID] in the RenderingServer. + See also [method MeshInstance3D.get_skin_reference] and [method RenderingServer.instance_attach_skeleton]. + Note that despite the similar naming, the skeleton RID used in the [RenderingServer] does not have a direct one-to-one correspondence to a [Skeleton3D] node. + In particular, a [Skeleton3D] node with no [MeshInstance3D] children may be unknown to the [RenderingServer]. + On the other hand, a [Skeleton3D] with multiple [MeshInstance3D] nodes which each have different [member MeshInstance3D.skin] objects may have multiple SkinReference instances (and hence, multiple skeleton [RID]s). </description> <tutorials> </tutorials> @@ -10,11 +16,14 @@ <method name="get_skeleton" qualifiers="const"> <return type="RID" /> <description> + Returns the [RID] owned by this SkinReference, as returned by [method RenderingServer.skeleton_create]. </description> </method> <method name="get_skin" qualifiers="const"> <return type="Skin" /> <description> + Returns the [Skin] connected to this SkinReference. In the case of [MeshInstance3D] with no [member MeshInstance3D.skin] assigned, this will reference an internal default [Skin] owned by that [MeshInstance3D]. + Note that a single [Skin] may have more than one [SkinReference] in the case that it is shared by meshes across multiple [Skeleton3D] nodes. </description> </method> </methods> diff --git a/doc/classes/SliderJoint3D.xml b/doc/classes/SliderJoint3D.xml index 49b362041b..8930514492 100644 --- a/doc/classes/SliderJoint3D.xml +++ b/doc/classes/SliderJoint3D.xml @@ -13,6 +13,7 @@ <return type="float" /> <param index="0" name="param" type="int" enum="SliderJoint3D.Param" /> <description> + Returns the value of the given parameter (see [enum Param] constants). </description> </method> <method name="set_param"> @@ -20,6 +21,7 @@ <param index="0" name="param" type="int" enum="SliderJoint3D.Param" /> <param index="1" name="value" type="float" /> <description> + Assigns [param value] to the given parameter (see [enum Param] constants). </description> </method> </methods> @@ -96,70 +98,70 @@ </members> <constants> <constant name="PARAM_LINEAR_LIMIT_UPPER" value="0" enum="Param"> - The maximum difference between the pivot points on their X axis before damping happens. + Constant for accessing [member linear_limit/upper_distance]. The maximum difference between the pivot points on their X axis before damping happens. </constant> <constant name="PARAM_LINEAR_LIMIT_LOWER" value="1" enum="Param"> - The minimum difference between the pivot points on their X axis before damping happens. + Constant for accessing [member linear_limit/lower_distance]. The minimum difference between the pivot points on their X axis before damping happens. </constant> <constant name="PARAM_LINEAR_LIMIT_SOFTNESS" value="2" enum="Param"> - A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + Constant for accessing [member linear_limit/softness]. A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. </constant> <constant name="PARAM_LINEAR_LIMIT_RESTITUTION" value="3" enum="Param"> - The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. + Constant for accessing [member linear_limit/restitution]. The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. </constant> <constant name="PARAM_LINEAR_LIMIT_DAMPING" value="4" enum="Param"> - The amount of damping once the slider limits are surpassed. + Constant for accessing [member linear_limit/damping]. The amount of damping once the slider limits are surpassed. </constant> <constant name="PARAM_LINEAR_MOTION_SOFTNESS" value="5" enum="Param"> - A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + Constant for accessing [member linear_motion/softness]. A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. </constant> <constant name="PARAM_LINEAR_MOTION_RESTITUTION" value="6" enum="Param"> - The amount of restitution inside the slider limits. + Constant for accessing [member linear_motion/restitution]. The amount of restitution inside the slider limits. </constant> <constant name="PARAM_LINEAR_MOTION_DAMPING" value="7" enum="Param"> - The amount of damping inside the slider limits. + Constant for accessing [member linear_motion/damping]. The amount of damping inside the slider limits. </constant> <constant name="PARAM_LINEAR_ORTHOGONAL_SOFTNESS" value="8" enum="Param"> - A factor applied to the movement across axes orthogonal to the slider. + Constant for accessing [member linear_ortho/softness]. A factor applied to the movement across axes orthogonal to the slider. </constant> <constant name="PARAM_LINEAR_ORTHOGONAL_RESTITUTION" value="9" enum="Param"> - The amount of restitution when movement is across axes orthogonal to the slider. + Constant for accessing [member linear_motion/restitution]. The amount of restitution when movement is across axes orthogonal to the slider. </constant> <constant name="PARAM_LINEAR_ORTHOGONAL_DAMPING" value="10" enum="Param"> - The amount of damping when movement is across axes orthogonal to the slider. + Constant for accessing [member linear_motion/damping]. The amount of damping when movement is across axes orthogonal to the slider. </constant> <constant name="PARAM_ANGULAR_LIMIT_UPPER" value="11" enum="Param"> - The upper limit of rotation in the slider. + Constant for accessing [member angular_limit/upper_angle]. The upper limit of rotation in the slider. </constant> <constant name="PARAM_ANGULAR_LIMIT_LOWER" value="12" enum="Param"> - The lower limit of rotation in the slider. + Constant for accessing [member angular_limit/lower_angle]. The lower limit of rotation in the slider. </constant> <constant name="PARAM_ANGULAR_LIMIT_SOFTNESS" value="13" enum="Param"> - A factor applied to the all rotation once the limit is surpassed. + Constant for accessing [member angular_limit/softness]. A factor applied to the all rotation once the limit is surpassed. </constant> <constant name="PARAM_ANGULAR_LIMIT_RESTITUTION" value="14" enum="Param"> - The amount of restitution of the rotation when the limit is surpassed. + Constant for accessing [member angular_limit/restitution]. The amount of restitution of the rotation when the limit is surpassed. </constant> <constant name="PARAM_ANGULAR_LIMIT_DAMPING" value="15" enum="Param"> - The amount of damping of the rotation when the limit is surpassed. + Constant for accessing [member angular_limit/damping]. The amount of damping of the rotation when the limit is surpassed. </constant> <constant name="PARAM_ANGULAR_MOTION_SOFTNESS" value="16" enum="Param"> - A factor applied to the all rotation in the limits. + Constant for accessing [member angular_motion/softness]. A factor applied to the all rotation in the limits. </constant> <constant name="PARAM_ANGULAR_MOTION_RESTITUTION" value="17" enum="Param"> - The amount of restitution of the rotation in the limits. + Constant for accessing [member angular_motion/restitution]. The amount of restitution of the rotation in the limits. </constant> <constant name="PARAM_ANGULAR_MOTION_DAMPING" value="18" enum="Param"> - The amount of damping of the rotation in the limits. + Constant for accessing [member angular_motion/damping]. The amount of damping of the rotation in the limits. </constant> <constant name="PARAM_ANGULAR_ORTHOGONAL_SOFTNESS" value="19" enum="Param"> - A factor applied to the all rotation across axes orthogonal to the slider. + Constant for accessing [member angular_ortho/softness]. A factor applied to the all rotation across axes orthogonal to the slider. </constant> <constant name="PARAM_ANGULAR_ORTHOGONAL_RESTITUTION" value="20" enum="Param"> - The amount of restitution of the rotation across axes orthogonal to the slider. + Constant for accessing [member angular_ortho/restitution]. The amount of restitution of the rotation across axes orthogonal to the slider. </constant> <constant name="PARAM_ANGULAR_ORTHOGONAL_DAMPING" value="21" enum="Param"> - The amount of damping of the rotation across axes orthogonal to the slider. + Constant for accessing [member angular_ortho/damping]. The amount of damping of the rotation across axes orthogonal to the slider. </constant> <constant name="PARAM_MAX" value="22" enum="Param"> Represents the size of the [enum Param] enum. diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml index a4d80a7c3e..195196b78c 100644 --- a/doc/classes/SoftBody3D.xml +++ b/doc/classes/SoftBody3D.xml @@ -5,6 +5,7 @@ </brief_description> <description> A deformable 3D physics mesh. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. + Additionally, [SoftBody3D] is subject to wind forces defined in [Area3D] (see [member Area3D.wind_source_path], [member Area3D.wind_force_magnitude], and [member Area3D.wind_attenuation_factor]). [b]Note:[/b] There are many known bugs in [SoftBody3D]. Therefore, it's not recommended to use them for things that can affect gameplay (such as trampolines). </description> <tutorials> diff --git a/doc/classes/SphereShape3D.xml b/doc/classes/SphereShape3D.xml index 313b05dff4..4b14c535dd 100644 --- a/doc/classes/SphereShape3D.xml +++ b/doc/classes/SphereShape3D.xml @@ -8,7 +8,7 @@ [b]Performance:[/b] [SphereShape3D] is fast to check collisions against. It is faster than [BoxShape3D], [CapsuleShape3D], and [CylinderShape3D]. </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> </tutorials> <members> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.5"> diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index ba70edb933..8d2177d3fd 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -11,7 +11,7 @@ <tutorials> <link title="3D lights and shadows">$DOCS_URL/tutorials/3d/lights_and_shadows.html</link> <link title="Faking global illumination">$DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <members> <member name="shadow_bias" type="float" setter="set_param" getter="get_param" overrides="Light3D" default="0.03" /> diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 8dcf286b3a..10ac4b0fcc 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -7,7 +7,7 @@ A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. </description> <tutorials> - <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link> + <link title="Instancing Demo">https://godotengine.org/asset-library/asset/2716</link> </tutorials> <methods> <method name="get_rect" qualifiers="const"> diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml index 81eda8505b..a2a9a97bc1 100644 --- a/doc/classes/StaticBody3D.xml +++ b/doc/classes/StaticBody3D.xml @@ -9,9 +9,9 @@ [StaticBody3D] is useful for completely static objects like floors and walls, as well as moving surfaces like conveyor belts and circular revolving platforms (by using [member constant_linear_velocity] and [member constant_angular_velocity]). </description> <tutorials> - <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="Vector3(0, 0, 0)"> diff --git a/doc/classes/StatusIndicator.xml b/doc/classes/StatusIndicator.xml index e1fcc35ad7..688840b17f 100644 --- a/doc/classes/StatusIndicator.xml +++ b/doc/classes/StatusIndicator.xml @@ -8,10 +8,22 @@ </description> <tutorials> </tutorials> + <methods> + <method name="get_rect" qualifiers="const"> + <return type="Rect2" /> + <description> + Returns the status indicator rectangle in screen coordinates. If this status indicator is not visible, returns an empty [Rect2]. + </description> + </method> + </methods> <members> - <member name="icon" type="Image" setter="set_icon" getter="get_icon"> + <member name="icon" type="Texture2D" setter="set_icon" getter="get_icon"> Status indicator icon. </member> + <member name="menu" type="NodePath" setter="set_menu" getter="get_menu" default="NodePath("")"> + Status indicator native popup menu. If this is set, the [signal pressed] signal is not emitted. + [b]Note:[/b] Native popup is only supported if [NativeMenu] supports [constant NativeMenu.FEATURE_POPUP_MENU] feature. + </member> <member name="tooltip" type="String" setter="set_tooltip" getter="get_tooltip" default=""""> Status indicator tooltip. </member> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 7592342602..450e483f69 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -126,7 +126,7 @@ [/codeblock] </description> </method> - <method name="contains" qualifiers="const" keywords="includes, has"> + <method name="contains" qualifiers="const"> <return type="bool" /> <param index="0" name="what" type="String" /> <description> @@ -142,7 +142,15 @@ GD.Print("team".Contains("I")); // Prints false [/csharp] [/codeblocks] - If you need to know where [param what] is within the string, use [method find]. + If you need to know where [param what] is within the string, use [method find]. See also [method containsn]. + </description> + </method> + <method name="containsn" qualifiers="const"> + <return type="bool" /> + <param index="0" name="what" type="String" /> + <description> + Returns [code]true[/code] if the string contains [param what], [b]ignoring case[/b]. + If you need to know where [param what] is within the string, use [method findn]. See also [method contains]. </description> </method> <method name="count" qualifiers="const"> @@ -188,7 +196,7 @@ <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. + Like [method naturalcasecmp_to] but prioritizes 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> @@ -196,7 +204,7 @@ <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. + Like [method naturalnocasecmp_to] but prioritizes 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> @@ -255,6 +263,13 @@ print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) [/codeblock] See also the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_format_string.html]GDScript format string[/url] tutorial. + [b]Note:[/b] The replacement of placeholders is not done all at once, instead each placeholder is replaced in the order they are passed, this means that if one of the replacement strings contains a key it will also be replaced. This can be very powerful, but can also cause unexpected results if you are not careful. If you do not need to perform replacement in the replacement strings, make sure your replacements do not contain placeholders to ensure reliable results. + [codeblock] + print("{0} {1}".format(["{1}", "x"])) # Prints "x x". + print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}". + print("{foo} {bar}".format({"foo": "{bar}", "bar": "baz"})) # Prints "baz baz". + print("{foo} {bar}".format({"bar": "baz", "foo": "{bar}"})) # Prints "{bar} baz". + [/codeblock] [b]Note:[/b] In C#, it's recommended to [url=https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated]interpolate strings with "$"[/url], instead. </description> </method> @@ -740,7 +755,7 @@ <method name="reverse" qualifiers="const"> <return type="String" /> <description> - Returns the copy of this string in reverse order. + Returns the copy of this string in reverse order. This operation works on unicode codepoints, rather than sequences of codepoints, and may break things like compound letters or emojis. </description> </method> <method name="rfind" qualifiers="const"> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index e837b65199..76586b7968 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -126,7 +126,15 @@ GD.Print("team".Contains("I")); // Prints false [/csharp] [/codeblocks] - If you need to know where [param what] is within the string, use [method find]. + If you need to know where [param what] is within the string, use [method find]. See also [method containsn]. + </description> + </method> + <method name="containsn" qualifiers="const"> + <return type="bool" /> + <param index="0" name="what" type="String" /> + <description> + Returns [code]true[/code] if the string contains [param what], [b]ignoring case[/b]. + If you need to know where [param what] is within the string, use [method findn]. See also [method contains]. </description> </method> <method name="count" qualifiers="const"> @@ -172,7 +180,7 @@ <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. + Like [method naturalcasecmp_to] but prioritizes 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> @@ -180,7 +188,7 @@ <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. + Like [method naturalnocasecmp_to] but prioritizes 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> @@ -648,7 +656,7 @@ <method name="reverse" qualifiers="const"> <return type="String" /> <description> - Returns the copy of this string in reverse order. + Returns the copy of this string in reverse order. This operation works on unicode codepoints, rather than sequences of codepoints, and may break things like compound letters or emojis. </description> </method> <method name="rfind" qualifiers="const"> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 2c3908a72c..181e1ff77a 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -7,13 +7,13 @@ By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew. Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. [b]Example:[/b] - [codeblock] + [codeblock lang=text] height = 30 corner_radius_top_left = 50 corner_radius_bottom_left = 100 [/codeblock] The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will [b]never[/b] be more than the height. Result: - [codeblock] + [codeblock lang=text] corner_radius_top_left: 10 corner_radius_bottom_left: 20 [/codeblock] diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml index 1a7a4f6e96..605cf949c1 100644 --- a/doc/classes/SubViewport.xml +++ b/doc/classes/SubViewport.xml @@ -10,12 +10,12 @@ <tutorials> <link title="Using Viewports">$DOCS_URL/tutorials/rendering/viewports.html</link> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> - <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> - <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link> - <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link> - <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link> - <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link> - <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link> + <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> + <link title="3D in 2D Viewport Demo">https://godotengine.org/asset-library/asset/2804</link> + <link title="2D in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2803</link> + <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/2808</link> + <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/2806</link> + <link title="3D Resolution Scaling Demo">https://godotengine.org/asset-library/asset/2805</link> </tutorials> <members> <member name="render_target_clear_mode" type="int" setter="set_clear_mode" getter="get_clear_mode" enum="SubViewport.ClearMode" default="0"> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 094275c349..a8bd068b1c 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -29,7 +29,7 @@ </description> <tutorials> <link title="Using the SurfaceTool">$DOCS_URL/tutorials/3d/procedural_geometry/surfacetool.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="add_index"> @@ -93,7 +93,7 @@ <method name="commit_to_arrays"> <return type="Array" /> <description> - Commits the data to the same format used by [method ArrayMesh.add_surface_from_arrays]. This way you can further process the mesh data using the [ArrayMesh] API. + Commits the data to the same format used by [method ArrayMesh.add_surface_from_arrays], [method ImporterMesh.add_surface], and [method create_from_arrays]. This way you can further process the mesh data using the [ArrayMesh] or [ImporterMesh] APIs. </description> </method> <method name="create_from"> @@ -104,6 +104,14 @@ Creates a vertex array from an existing [Mesh]. </description> </method> + <method name="create_from_arrays"> + <return type="void" /> + <param index="0" name="arrays" type="Array" /> + <param index="1" name="primitive_type" type="int" enum="Mesh.PrimitiveType" default="3" /> + <description> + Creates this SurfaceTool from existing vertex arrays such as returned by [method commit_to_arrays], [method Mesh.surface_get_arrays], [method Mesh.surface_get_blend_shape_arrays], [method ImporterMesh.get_surface_arrays], and [method ImporterMesh.get_surface_blend_shape_arrays]. [param primitive_type] controls the type of mesh data, defaulting to [constant Mesh.PRIMITIVE_TRIANGLES]. + </description> + </method> <method name="create_from_blend_shape"> <return type="void" /> <param index="0" name="existing" type="Mesh" /> diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index a2beef81eb..d080294c1a 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -111,6 +111,13 @@ Returns the title of the tab at index [param tab_idx]. </description> </method> + <method name="get_tab_tooltip" qualifiers="const"> + <return type="String" /> + <param index="0" name="tab_idx" type="int" /> + <description> + Returns the tooltip text of the tab at index [param tab_idx]. + </description> + </method> <method name="is_tab_disabled" qualifiers="const"> <return type="bool" /> <param index="0" name="tab_idx" type="int" /> @@ -224,6 +231,15 @@ Sets a [param title] for the tab at index [param tab_idx]. </description> </method> + <method name="set_tab_tooltip"> + <return type="void" /> + <param index="0" name="tab_idx" type="int" /> + <param index="1" name="tooltip" type="String" /> + <description> + Sets a [param tooltip] for tab at index [param tab_idx]. + [b]Note:[/b] By default, if the [param tooltip] is empty and the tab text is truncated (not all characters fit into the tab), the title will be displayed as a tooltip. To hide the tooltip, assign [code]" "[/code] as the [param tooltip] text. + </description> + </method> </methods> <members> <member name="clip_tabs" type="bool" setter="set_clip_tabs" getter="get_clip_tabs" default="true"> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index b0e3f67791..090afa0220 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -64,6 +64,13 @@ Returns the [Texture2D] for the tab at index [param tab_idx] or [code]null[/code] if the tab has no [Texture2D]. </description> </method> + <method name="get_tab_icon_max_width" qualifiers="const"> + <return type="int" /> + <param index="0" name="tab_idx" type="int" /> + <description> + Returns the maximum allowed width of the icon for the tab at index [param tab_idx]. + </description> + </method> <method name="get_tab_idx_at_point" qualifiers="const"> <return type="int" /> <param index="0" name="point" type="Vector2" /> @@ -92,6 +99,13 @@ Returns the title of the tab at index [param tab_idx]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title]. </description> </method> + <method name="get_tab_tooltip" qualifiers="const"> + <return type="String" /> + <param index="0" name="tab_idx" type="int" /> + <description> + Returns the tooltip text of the tab at index [param tab_idx]. + </description> + </method> <method name="is_tab_disabled" qualifiers="const"> <return type="bool" /> <param index="0" name="tab_idx" type="int" /> @@ -157,6 +171,14 @@ Sets an icon for the tab at index [param tab_idx]. </description> </method> + <method name="set_tab_icon_max_width"> + <return type="void" /> + <param index="0" name="tab_idx" type="int" /> + <param index="1" name="width" type="int" /> + <description> + Sets the maximum allowed width of the icon for the tab at index [param tab_idx]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio. + </description> + </method> <method name="set_tab_metadata"> <return type="void" /> <param index="0" name="tab_idx" type="int" /> @@ -173,6 +195,15 @@ Sets a custom title for the tab at index [param tab_idx] (tab titles default to the name of the indexed child node). Set it back to the child's name to make the tab default to it again. </description> </method> + <method name="set_tab_tooltip"> + <return type="void" /> + <param index="0" name="tab_idx" type="int" /> + <param index="1" name="tooltip" type="String" /> + <description> + Sets a custom tooltip text for tab at index [param tab_idx]. + [b]Note:[/b] By default, if the [param tooltip] is empty and the tab text is truncated (not all characters fit into the tab), the title will be displayed as a tooltip. To hide the tooltip, assign [code]" "[/code] as the [param tooltip] text. + </description> + </method> </methods> <members> <member name="all_tabs_in_front" type="bool" setter="set_all_tabs_in_front" getter="is_all_tabs_in_front" default="false"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index db0c1f17b0..75cad4d08b 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -5,7 +5,7 @@ </brief_description> <description> A multiline text editor. It also has limited facilities for editing code, such as syntax highlighting support. For more advanced facilities for editing code, see [CodeEdit]. - [b]Note:[/b] Most viewport, caret and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets. + [b]Note:[/b] Most viewport, caret, and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets in the order they were created. [b]Note:[/b] When holding down [kbd]Alt[/kbd], the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor. </description> <tutorials> @@ -58,7 +58,7 @@ <method name="add_caret"> <return type="int" /> <param index="0" name="line" type="int" /> - <param index="1" name="col" type="int" /> + <param index="1" name="column" type="int" /> <description> Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid. </description> @@ -67,7 +67,7 @@ <return type="void" /> <param index="0" name="below" type="bool" /> <description> - Adds an additional caret above or below every caret. If [param below] is true the new caret will be added below and above otherwise. + Adds an additional caret above or below every caret. If [param below] is [code]true[/code] the new caret will be added below and above otherwise. </description> </method> <method name="add_gutter"> @@ -83,7 +83,7 @@ Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret. </description> </method> - <method name="adjust_carets_after_edit"> + <method name="adjust_carets_after_edit" deprecated="No longer necessary since methods now adjust carets themselves."> <return type="void" /> <param index="0" name="caret" type="int" /> <param index="1" name="from_line" type="int" /> @@ -91,7 +91,7 @@ <param index="3" name="to_line" type="int" /> <param index="4" name="to_col" type="int" /> <description> - Reposition the carets affected by the edit. This assumes edits are applied in edit order, see [method get_caret_index_edit_order]. + This method does nothing. </description> </method> <method name="adjust_viewport_to_caret"> @@ -120,6 +120,23 @@ Starts a multipart edit. All edits will be treated as one action until [method end_complex_operation] is called. </description> </method> + <method name="begin_multicaret_edit"> + <return type="void" /> + <description> + Starts an edit for multiple carets. The edit must be ended with [method end_multicaret_edit]. Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. [method begin_multicaret_edit] and [method end_multicaret_edit] can be nested, and the merge will happen at the last [method end_multicaret_edit]. + Example usage: + [codeblock] + begin_complex_operation() + begin_multicaret_edit() + for i in range(get_caret_count()): + if multicaret_edit_ignore_caret(i): + continue + # Logic here. + end_multicaret_edit() + end_complex_operation() + [/codeblock] + </description> + </method> <method name="cancel_ime"> <return type="void" /> <description> @@ -145,6 +162,20 @@ Clears the undo history. </description> </method> + <method name="collapse_carets"> + <return type="void" /> + <param index="0" name="from_line" type="int" /> + <param index="1" name="from_column" type="int" /> + <param index="2" name="to_line" type="int" /> + <param index="3" name="to_column" type="int" /> + <param index="4" name="inclusive" type="bool" default="false" /> + <description> + Collapse all carets in the given range to the [param from_line] and [param from_column] position. + [param inclusive] applies to both ends. + If [method is_in_mulitcaret_edit] is [code]true[/code], carets that are collapsed will be [code]true[/code] for [method multicaret_edit_ignore_caret]. + [method merge_overlapping_carets] will be called if any carets were collapsed. + </description> + </method> <method name="copy"> <return type="void" /> <param index="0" name="caret_index" type="int" default="-1" /> @@ -185,6 +216,12 @@ Ends a multipart edit, started with [method begin_complex_operation]. If called outside a complex operation, the current operation is pushed onto the undo/redo stack. </description> </method> + <method name="end_multicaret_edit"> + <return type="void" /> + <description> + Ends an edit for multiple carets, that was started with [method begin_multicaret_edit]. If this was the last [method end_multicaret_edit] and [method merge_overlapping_carets] was called, carets will be merged. + </description> + </method> <method name="get_caret_column" qualifiers="const"> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> @@ -205,7 +242,7 @@ Returns the caret pixel draw position. </description> </method> - <method name="get_caret_index_edit_order"> + <method name="get_caret_index_edit_order" deprecated="Carets no longer need to be edited in any specific order. If the carets need to be sorted, use [method get_sorted_carets] instead."> <return type="PackedInt32Array" /> <description> Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as [method insert_text_at_caret] are applied. @@ -363,6 +400,15 @@ [b]Note:[/b] The return value is influenced by [theme_item line_spacing] and [theme_item font_size]. And it will not be less than [code]1[/code]. </description> </method> + <method name="get_line_ranges_from_carets" qualifiers="const"> + <return type="Vector2i[]" /> + <param index="0" name="only_selections" type="bool" default="false" /> + <param index="1" name="merge_adjacent" type="bool" default="true" /> + <description> + Returns an [Array] of line ranges where [code]x[/code] is the first line and [code]y[/code] is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it. + If a selection's end column ([method get_selection_to_column]) is at column [code]0[/code], that line will not be included. If a selection begins on the line after another selection ends and [param merge_adjacent] is [code]true[/code], or they begin and end on the same line, one line range will include both selections. + </description> + </method> <method name="get_line_width" qualifiers="const"> <return type="int" /> <param index="0" name="line" type="int" /> @@ -514,7 +560,18 @@ Returns the text inside the selection of a caret, or all the carets if [param caret_index] is its default value [code]-1[/code]. </description> </method> - <method name="get_selection_column" qualifiers="const"> + <method name="get_selection_at_line_column" qualifiers="const"> + <return type="int" /> + <param index="0" name="line" type="int" /> + <param index="1" name="column" type="int" /> + <param index="2" name="include_edges" type="bool" default="true" /> + <param index="3" name="only_selections" type="bool" default="true" /> + <description> + Returns the caret index of the selection at the given [param line] and [param column], or [code]-1[/code] if there is none. + If [param include_edges] is [code]false[/code], the position must be inside the selection and not at either end. If [param only_selections] is [code]false[/code], carets without a selection will also be considered. + </description> + </method> + <method name="get_selection_column" qualifiers="const" deprecated="Use [method get_selection_origin_column] instead."> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> @@ -525,17 +582,17 @@ <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> - Returns the selection begin column. + Returns the selection begin column. Returns the caret column if there is no selection. </description> </method> <method name="get_selection_from_line" qualifiers="const"> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> - Returns the selection begin line. + Returns the selection begin line. Returns the caret line if there is no selection. </description> </method> - <method name="get_selection_line" qualifiers="const"> + <method name="get_selection_line" qualifiers="const" deprecated="Use [method get_selection_origin_line] instead."> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> @@ -548,18 +605,40 @@ Returns the current selection mode. </description> </method> + <method name="get_selection_origin_column" qualifiers="const"> + <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> + <description> + Returns the origin column of the selection. This is the opposite end from the caret. + </description> + </method> + <method name="get_selection_origin_line" qualifiers="const"> + <return type="int" /> + <param index="0" name="caret_index" type="int" default="0" /> + <description> + Returns the origin line of the selection. This is the opposite end from the caret. + </description> + </method> <method name="get_selection_to_column" qualifiers="const"> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> - Returns the selection end column. + Returns the selection end column. Returns the caret column if there is no selection. </description> </method> <method name="get_selection_to_line" qualifiers="const"> <return type="int" /> <param index="0" name="caret_index" type="int" default="0" /> <description> - Returns the selection end line. + Returns the selection end line. Returns the caret line if there is no selection. + </description> + </method> + <method name="get_sorted_carets" qualifiers="const"> + <return type="PackedInt32Array" /> + <param index="0" name="include_ignored_carets" type="bool" default="false" /> + <description> + Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text). + If [param include_ignored_carets] is [code]false[/code], carets from [method multicaret_edit_ignore_caret] will be ignored. </description> </method> <method name="get_tab_size" qualifiers="const"> @@ -653,6 +732,19 @@ Inserts a new line with [param text] at [param line]. </description> </method> + <method name="insert_text"> + <return type="void" /> + <param index="0" name="text" type="String" /> + <param index="1" name="line" type="int" /> + <param index="2" name="column" type="int" /> + <param index="3" name="before_selection_begin" type="bool" default="true" /> + <param index="4" name="before_selection_end" type="bool" default="false" /> + <description> + Inserts the [param text] at [param line] and [param column]. + If [param before_selection_begin] is [code]true[/code], carets and selections that begin at [param line] and [param column] will moved to the end of the inserted text, along with all carets after it. + If [param before_selection_end] is [code]true[/code], selections that end at [param line] and [param column] will be extended to the end of the inserted text. These parameters can be used to insert text inside of or outside of selections. + </description> + </method> <method name="insert_text_at_caret"> <return type="void" /> <param index="0" name="text" type="String" /> @@ -661,6 +753,13 @@ Insert the specified text at the caret position. </description> </method> + <method name="is_caret_after_selection_origin" qualifiers="const"> + <return type="bool" /> + <param index="0" name="caret_index" type="int" default="0" /> + <description> + Returns [code]true[/code] if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection. + </description> + </method> <method name="is_caret_visible" qualifiers="const"> <return type="bool" /> <param index="0" name="caret_index" type="int" default="0" /> @@ -671,7 +770,7 @@ <method name="is_dragging_cursor" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the user is dragging their mouse for scrolling or selecting. + Returns [code]true[/code] if the user is dragging their mouse for scrolling, selecting, or text dragging. </description> </method> <method name="is_gutter_clickable" qualifiers="const"> @@ -695,6 +794,12 @@ Returns whether the gutter is overwritable. </description> </method> + <method name="is_in_mulitcaret_edit" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if a [method begin_multicaret_edit] has been called and [method end_multicaret_edit] has not yet been called. + </description> + </method> <method name="is_line_gutter_clickable" qualifiers="const"> <return type="bool" /> <param index="0" name="line" type="int" /> @@ -749,9 +854,18 @@ <return type="void" /> <description> Merges any overlapping carets. Will favor the newest caret, or the caret with a selection. + If [method is_in_mulitcaret_edit] is [code]true[/code], the merge will be queued to happen at the end of the multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit]. [b]Note:[/b] This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap. </description> </method> + <method name="multicaret_edit_ignore_caret" qualifiers="const"> + <return type="bool" /> + <param index="0" name="caret_index" type="int" /> + <description> + Returns [code]true[/code] if the given [param caret_index] should be ignored as part of a multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit]. Carets that should be ignored are ones that were part of removed text and will likely be merged at the end of the edit, or carets that were added during the edit. + It is recommended to [code]continue[/code] within a loop iterating on multiple carets if a caret should be ignored. + </description> + </method> <method name="paste"> <return type="void" /> <param index="0" name="caret_index" type="int" default="-1" /> @@ -787,6 +901,15 @@ Removes the gutter from this [TextEdit]. </description> </method> + <method name="remove_line_at"> + <return type="void" /> + <param index="0" name="line" type="int" /> + <param index="1" name="move_carets_down" type="bool" default="true" /> + <description> + Removes the line of text at [param line]. Carets on this line will attempt to match their previous visual x position. + If [param move_carets_down] is [code]true[/code] carets will move to the next line down, otherwise carets will move up. + </description> + </method> <method name="remove_secondary_carets"> <return type="void" /> <description> @@ -801,7 +924,6 @@ <param index="3" name="to_column" type="int" /> <description> Removes text between the given positions. - [b]Note:[/b] This does not adjust the caret or selection, which as a result it can end up in an invalid position. </description> </method> <method name="search" qualifiers="const"> @@ -809,7 +931,7 @@ <param index="0" name="text" type="String" /> <param index="1" name="flags" type="int" /> <param index="2" name="from_line" type="int" /> - <param index="3" name="from_colum" type="int" /> + <param index="3" name="from_column" type="int" /> <description> Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. If no results are found, both are equal to [code]-1[/code]. @@ -835,14 +957,15 @@ </method> <method name="select"> <return type="void" /> - <param index="0" name="from_line" type="int" /> - <param index="1" name="from_column" type="int" /> - <param index="2" name="to_line" type="int" /> - <param index="3" name="to_column" type="int" /> + <param index="0" name="origin_line" type="int" /> + <param index="1" name="origin_column" type="int" /> + <param index="2" name="caret_line" type="int" /> + <param index="3" name="caret_column" type="int" /> <param index="4" name="caret_index" type="int" default="0" /> <description> - Perform selection, from line/column to line/column. + Selects text from [param origin_line] and [param origin_column] to [param caret_line] and [param caret_column] for the given [param caret_index]. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected. If [member selecting_enabled] is [code]false[/code], no selection will occur. + [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets]. </description> </method> <method name="select_all"> @@ -878,9 +1001,10 @@ <param index="3" name="wrap_index" type="int" default="0" /> <param index="4" name="caret_index" type="int" default="0" /> <description> - Moves the caret to the specified [param line] index. + Moves the caret to the specified [param line] index. The caret column will be moved to the same visual position it was at the last time [method set_caret_column] was called, or clamped to the end of the line. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. If [param can_be_hidden] is [code]true[/code], the specified [param line] can be hidden. + If [param wrap_index] is [code]-1[/code], the caret column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_caret_column] was called. [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets]. </description> </method> @@ -945,7 +1069,8 @@ <param index="0" name="line" type="int" /> <param index="1" name="new_text" type="String" /> <description> - Sets the text for a specific line. + Sets the text for a specific [param line]. + Carets on the line will attempt to keep their visual x position. </description> </method> <method name="set_line_as_center_visible"> @@ -1049,13 +1174,30 @@ <method name="set_selection_mode"> <return type="void" /> <param index="0" name="mode" type="int" enum="TextEdit.SelectionMode" /> - <param index="1" name="line" type="int" default="-1" /> - <param index="2" name="column" type="int" default="-1" /> - <param index="3" name="caret_index" type="int" default="0" /> <description> Sets the current selection mode. </description> </method> + <method name="set_selection_origin_column"> + <return type="void" /> + <param index="0" name="column" type="int" /> + <param index="1" name="caret_index" type="int" default="0" /> + <description> + Sets the selection origin column to the [param column] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect. + </description> + </method> + <method name="set_selection_origin_line"> + <return type="void" /> + <param index="0" name="line" type="int" /> + <param index="1" name="can_be_hidden" type="bool" default="true" /> + <param index="2" name="wrap_index" type="int" default="-1" /> + <param index="3" name="caret_index" type="int" default="0" /> + <description> + Sets the selection origin line to the [param line] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect. + If [param can_be_hidden] is [code]false[/code], The line will be set to the nearest unhidden line below or above. + If [param wrap_index] is [code]-1[/code], the selection origin column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_selection_origin_column] or [method select] was called. + </description> + </method> <method name="set_tab_size"> <return type="void" /> <param index="0" name="size" type="int" /> @@ -1089,7 +1231,7 @@ <param index="0" name="from_line" type="int" /> <param index="1" name="to_line" type="int" /> <description> - Swaps the two lines. + Swaps the two lines. Carets will be swapped with the lines. </description> </method> <method name="tag_saved_version"> @@ -1140,7 +1282,7 @@ If [code]true[/code], the selected text will be deselected when focus is lost. </member> <member name="drag_and_drop_selection_enabled" type="bool" setter="set_drag_and_drop_selection_enabled" getter="is_drag_and_drop_selection_enabled" default="true"> - If [code]true[/code], allow drag and drop of selected text. + If [code]true[/code], allow drag and drop of selected text. Text can still be dropped from other sources. </member> <member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false"> If [code]true[/code], control characters are displayed. @@ -1172,7 +1314,7 @@ [b]Note:[/b] This method is only implemented on Linux. </member> <member name="minimap_draw" type="bool" setter="set_draw_minimap" getter="is_drawing_minimap" default="false"> - If [code]true[/code], a minimap is shown, providing an outline of your source code. + If [code]true[/code], a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size. </member> <member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80"> The width, in pixels, of the minimap. @@ -1231,7 +1373,7 @@ <signals> <signal name="caret_changed"> <description> - Emitted when the caret changes position. + Emitted when any caret changes position. </description> </signal> <signal name="gutter_added"> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index c0cd7f79e7..34137a18ef 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -5,6 +5,16 @@ </brief_description> <description> [TextServer] is the API backend for managing fonts and rendering text. + [b]Note:[/b] This is a low-level API, consider using [TextLine], [TextParagraph], and [Font] classes instead. + This is an abstract class, so to get the currently active [TextServer] instance, use the following code: + [codeblocks] + [gdscript] + var ts = TextServerManager.get_primary_interface() + [/gdscript] + [csharp] + var ts = TextServerManager.GetPrimaryInterface(); + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> @@ -1103,6 +1113,13 @@ - May contain Unicode characters of class XID_Continue in the other positions. </description> </method> + <method name="is_valid_letter" qualifiers="const"> + <return type="bool" /> + <param index="0" name="unicode" type="int" /> + <description> + Returns [code]true[/code] if the given code point is a valid letter, i.e. it belongs to the Unicode category "L". + </description> + </method> <method name="load_support_data"> <return type="bool" /> <param index="0" name="filename" type="String" /> @@ -1505,6 +1522,7 @@ <return type="PackedInt32Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" default="264" /> + <param index="2" name="skip_grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" default="4" /> <description> Breaks text into words and returns array of character ranges. Use [param grapheme_flags] to set what characters are used for breaking (see [enum GraphemeFlag]). </description> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 06a0daece6..c148cdad52 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -1217,6 +1217,12 @@ Returns [code]true[/code] if [param string] is a valid identifier. </description> </method> + <method name="_is_valid_letter" qualifiers="virtual const"> + <return type="bool" /> + <param index="0" name="unicode" type="int" /> + <description> + </description> + </method> <method name="_load_support_data" qualifiers="virtual"> <return type="bool" /> <param index="0" name="filename" type="String" /> @@ -1664,6 +1670,7 @@ <return type="PackedInt32Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" /> + <param index="2" name="skip_grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" /> <description> [b]Optional.[/b] Breaks text into words and returns array of character ranges. Use [param grapheme_flags] to set what characters are used for breaking (see [enum TextServer.GraphemeFlag]). diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index 6c0d56af05..861981f979 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -9,7 +9,7 @@ See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false"> diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index d18c4a1eee..ab268b6ea5 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -7,7 +7,7 @@ A control that displays a texture, for example an icon inside a GUI. The texture's placement can be controlled with the [member stretch_mode] property. It can scale, tile, or stay centered inside its bounding rectangle. </description> <tutorials> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <members> <member name="expand_mode" type="int" setter="set_expand_mode" getter="get_expand_mode" enum="TextureRect.ExpandMode" default="0" experimental="Using [constant EXPAND_FIT_WIDTH], [constant EXPAND_FIT_WIDTH_PROPORTIONAL], [constant EXPAND_FIT_HEIGHT], or [constant EXPAND_FIT_HEIGHT_PROPORTIONAL] may result in unstable behavior in some [Container] controls. This behavior may be re-evaluated and changed in the future."> diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index dbf63c0852..cf77b93d86 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -14,7 +14,7 @@ <tutorials> <link title="Using multiple threads">$DOCS_URL/tutorials/performance/using_multiple_threads.html</link> <link title="Thread-safe APIs">$DOCS_URL/tutorials/performance/thread_safe_apis.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="get_id" qualifiers="const"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index bc8a1d7bf1..687c7194cd 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -10,12 +10,12 @@ </description> <tutorials> <link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link> - <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> - <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link> - <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link> - <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> - <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> + <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/2718</link> + <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/2717</link> + <link title="2D Grid-based Navigation with AStarGrid2D Demo">https://godotengine.org/asset-library/asset/2723</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> </tutorials> <methods> <method name="_tile_data_runtime_update" qualifiers="virtual"> diff --git a/doc/classes/TileMapLayer.xml b/doc/classes/TileMapLayer.xml index bc8e259599..1bff6d911b 100644 --- a/doc/classes/TileMapLayer.xml +++ b/doc/classes/TileMapLayer.xml @@ -97,7 +97,7 @@ <method name="get_navigation_map" qualifiers="const"> <return type="RID" /> <description> - Returns the [RID] of the [NavigationServer2D] navigation used by this [TileMapLayer]. + 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> @@ -268,7 +268,7 @@ 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)"> + <member name="tile_map_data" type="PackedByteArray" setter="set_tile_map_data_from_array" getter="get_tile_map_data_as_array" default="PackedByteArray()"> The raw tile map data as a byte array. </member> <member name="tile_set" type="TileSet" setter="set_tile_set" getter="get_tile_set"> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 37f4cc5c0b..64cd4fb7b2 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -13,12 +13,12 @@ </description> <tutorials> <link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link> - <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> - <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link> - <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link> - <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> - <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> - <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> + <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/2718</link> + <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/2717</link> + <link title="2D Grid-based Navigation with AStarGrid2D Demo">https://godotengine.org/asset-library/asset/2723</link> + <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> </tutorials> <methods> <method name="add_custom_data_layer"> diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml index 6f212274f8..a34ca0ce91 100644 --- a/doc/classes/TileSetAtlasSource.xml +++ b/doc/classes/TileSetAtlasSource.xml @@ -295,6 +295,15 @@ # If tile is not already flipped, flip it. $TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | TileSetAtlasSource.TRANSFORM_FLIP_H) [/codeblock] + [b]Note:[/b] These transformations can be combined to do the equivalent of 0, 90, 180, and 270 degree rotations, as shown below: + [codeblock] + enum TileTransform { + ROTATE_0 = 0, + ROTATE_90 = TileSetAtlasSource.TRANSFORM_TRANSPOSE | TileSetAtlasSource.TRANSFORM_FLIP_H, + ROTATE_180 = TileSetAtlasSource.TRANSFORM_FLIP_H | TileSetAtlasSource.TRANSFORM_FLIP_V, + ROTATE_270 = TileSetAtlasSource.TRANSFORM_TRANSPOSE | TileSetAtlasSource.TRANSFORM_FLIP_V, + } + [/codeblock] </constant> <constant name="TRANSFORM_FLIP_V" value="8192"> Represents cell's vertical flip flag. See [constant TRANSFORM_FLIP_H] for usage. diff --git a/doc/classes/Time.xml b/doc/classes/Time.xml index 2948d20fbb..bf002ec6e2 100644 --- a/doc/classes/Time.xml +++ b/doc/classes/Time.xml @@ -152,7 +152,7 @@ <method name="get_time_zone_from_system" qualifiers="const"> <return type="Dictionary" /> <description> - Returns the current time zone as a dictionary of keys: [code]bias[/code] and [code]name[/code]. + Returns the current time zone as a dictionary of keys: [code]bias[/code] and [code]name[/code]. - [code]bias[/code] is the offset from UTC in minutes, since not all time zones are multiples of an hour from UTC. - [code]name[/code] is the localized name of the time zone, according to the OS locale settings of the current user. </description> diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index 6eee569443..9de1e09273 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -15,7 +15,7 @@ [b]Note:[/b] Timers are affected by [member Engine.time_scale]. The higher the time scale, the sooner timers will end. How often a timer processes may depend on the framerate or [member Engine.physics_ticks_per_second]. </description> <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="is_stopped" qualifiers="const"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 4247ff81ee..345d0512ff 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -10,8 +10,8 @@ <tutorials> <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link> <link title="Matrices and transforms">$DOCS_URL/tutorials/math/matrices_and_transforms.html</link> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> - <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> + <link title="2.5D Game Demo">https://godotengine.org/asset-library/asset/2783</link> </tutorials> <constructors> <constructor name="Transform2D"> diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 1827cdf8f0..2a0bbc46af 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -12,9 +12,9 @@ <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link> <link title="Matrices and transforms">$DOCS_URL/tutorials/math/matrices_and_transforms.html</link> <link title="Using 3D transforms">$DOCS_URL/tutorials/3d/using_transforms.html</link> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> - <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> - <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> + <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> + <link title="2.5D Game Demo">https://godotengine.org/asset-library/asset/2783</link> </tutorials> <constructors> <constructor name="Transform3D"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index d95492479c..b0cb25fafd 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -546,16 +546,16 @@ The maximum allowed width of the icon in item's cells. This limit is applied on top of the default size of the icon, but before the value set with [method TreeItem.set_icon_max_width]. The height is adjusted according to the icon's ratio. </theme_item> <theme_item name="inner_item_margin_bottom" data_type="constant" type="int" default="0"> - The inner bottom margin of an item. + The inner bottom margin of a cell. </theme_item> <theme_item name="inner_item_margin_left" data_type="constant" type="int" default="0"> - The inner left margin of an item. + The inner left margin of a cell. </theme_item> <theme_item name="inner_item_margin_right" data_type="constant" type="int" default="0"> - The inner right margin of an item. + The inner right margin of a cell. </theme_item> <theme_item name="inner_item_margin_top" data_type="constant" type="int" default="0"> - The inner top margin of an item. + The inner top margin of a cell. </theme_item> <theme_item name="item_margin" data_type="constant" type="int" default="16"> The horizontal margin at the start of an item. This is used when folding is enabled for the item. @@ -655,13 +655,13 @@ [StyleBox] used for the cursor, when the [Tree] is not being focused. </theme_item> <theme_item name="custom_button" data_type="style" type="StyleBox"> - Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell. + Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when button is enabled with [method TreeItem.set_custom_as_button]. </theme_item> <theme_item name="custom_button_hover" data_type="style" type="StyleBox"> - [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode button cell when it's hovered. </theme_item> <theme_item name="custom_button_pressed" data_type="style" type="StyleBox"> - [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed. + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode button cell when it's pressed. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> The focused style for the [Tree], drawn on top of everything. diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index c679838ec5..78a703c213 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -318,12 +318,14 @@ <return type="int" enum="TextServer.StructuredTextParser" /> <param index="0" name="column" type="int" /> <description> + Returns the BiDi algorithm override set for this cell. </description> </method> <method name="get_structured_text_bidi_override_options" qualifiers="const"> <return type="Array" /> <param index="0" name="column" type="int" /> <description> + Returns the additional BiDi options set for this cell. </description> </method> <method name="get_suffix" qualifiers="const"> @@ -401,6 +403,7 @@ <return type="bool" /> <param index="0" name="column" type="int" /> <description> + Returns [code]true[/code] if the cell was made into a button with [method set_custom_as_button]. </description> </method> <method name="is_edit_multiline" qualifiers="const"> @@ -532,7 +535,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="mode" type="int" enum="TreeItem.TreeCellMode" /> <description> - Sets the given column's cell mode to [param mode]. See [enum TreeCellMode] constants. + Sets the given column's cell mode to [param mode]. This determines how the cell is displayed and edited. See [enum TreeCellMode] constants for details. </description> </method> <method name="set_checked"> @@ -555,6 +558,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="enable" type="bool" /> <description> + Makes a cell with [constant CELL_MODE_CUSTOM] display as a non-flat button with a [StyleBox]. </description> </method> <method name="set_custom_bg_color"> @@ -589,7 +593,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="callback" type="Callable" /> <description> - Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. + Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. The cell has to be in [constant CELL_MODE_CUSTOM] to use this feature. The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2]. </description> </method> @@ -639,7 +643,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="texture" type="Texture2D" /> <description> - Sets the given column's icon [Texture2D]. + Sets the given cell's icon [Texture2D]. The cell has to be in [constant CELL_MODE_ICON] mode. </description> </method> <method name="set_icon_max_width"> @@ -724,6 +728,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="parser" type="int" enum="TextServer.StructuredTextParser" /> <description> + Set BiDi algorithm override for the structured text. Has effect for cells that display text. </description> </method> <method name="set_structured_text_bidi_override_options"> @@ -731,6 +736,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="args" type="Array" /> <description> + Set additional options for BiDi override. Has effect for cells that display text. </description> </method> <method name="set_suffix"> @@ -805,18 +811,21 @@ </members> <constants> <constant name="CELL_MODE_STRING" value="0" enum="TreeCellMode"> - Cell contains a string. + Cell shows a string label. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used. </constant> <constant name="CELL_MODE_CHECK" value="1" enum="TreeCellMode"> - Cell contains a checkbox. + Cell shows a checkbox, optionally with text. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable. </constant> <constant name="CELL_MODE_RANGE" value="2" enum="TreeCellMode"> - Cell contains a range. + Cell shows a numeric range. When editable, it can be edited using a range slider. Use [method set_range] to set the value and [method set_range_config] to configure the range. + This cell can also be used in a text dropdown mode when you assign a text with [method set_text]. Separate options with a comma, e.g. [code]"Option1,Option2,Option3"[/code]. </constant> <constant name="CELL_MODE_ICON" value="3" enum="TreeCellMode"> - Cell contains an icon. + Cell shows an icon. It can't be edited nor display text. </constant> <constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode"> + Cell shows as a clickable button. It will display an arrow similar to [OptionButton], but doesn't feature a dropdown (for that you can use [constant CELL_MODE_RANGE]). Clicking the button emits the [signal Tree.item_edited] signal. The button is flat by default, you can use [method set_custom_as_button] to display it with a [StyleBox]. + This mode also supports custom drawing using [method set_custom_draw_callback]. </constant> </constants> </class> diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml index d3ea94c0eb..62484ecdc0 100644 --- a/doc/classes/VBoxContainer.xml +++ b/doc/classes/VBoxContainer.xml @@ -8,6 +8,6 @@ </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> - <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> + <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> </class> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index eb837a4643..b420933285 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -42,8 +42,8 @@ # Note that Objects are their own special category. # To get the name of the underlying Object type, you need the `get_class()` method. print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. - # Note also that there is not yet any way to get a script's `class_name` string easily. - # To fetch that value, you can use ProjectSettings.get_global_class_list(). + # Note that this does not get the script's `class_name` global identifier. + # If the `class_name` is needed, use `foo.get_script().get_global_name()` instead. [/gdscript] [csharp] Variant foo = 2; diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index f33076a92f..5fadfd0d95 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -14,7 +14,7 @@ <link title="Vector math">$DOCS_URL/tutorials/math/vector_math.html</link> <link title="Advanced vector math">$DOCS_URL/tutorials/math/vectors_advanced.html</link> <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link> </tutorials> <constructors> @@ -110,7 +110,8 @@ <return type="Vector2" /> <param index="0" name="n" type="Vector2" /> <description> - Returns a new vector "bounced off" from a plane defined by the given normal. + Returns the vector "bounced off" from a line defined by the given normal [param n] perpendicular to the line. + [b]Note:[/b] [method bounce] performs the operation that most engines and frameworks call [code skip-lint]reflect()[/code]. </description> </method> <method name="ceil" qualifiers="const"> @@ -127,12 +128,20 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampf" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="min" type="float" /> + <param index="1" name="max" type="float" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="cross" qualifiers="const"> <return type="float" /> <param index="0" name="with" type="Vector2" /> <description> Returns the 2D analog of the cross product for this vector and [param with]. - This is the signed area of the parallelogram formed by the two vectors. If the second vector is clockwise from the first vector, then the cross product is the positive area. If counter-clockwise, the cross product is the negative area. + This is the signed area of the parallelogram formed by the two vectors. If the second vector is clockwise from the first vector, then the cross product is the positive area. If counter-clockwise, the cross product is the negative area. If the two vectors are parallel this returns zero, making it useful for testing if two vectors are parallel. [b]Note:[/b] Cross product is not defined in 2D mathematically. This method embeds the 2D vectors in the XY plane of 3D space and uses their cross product's Z component as the analog. </description> </method> @@ -264,18 +273,46 @@ Returns the vector with a maximum length by limiting its length to [param length]. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="with" type="Vector2" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector2(maxf(x, with.x), maxf(y, with.y))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxf" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector2(maxf(x, with), maxf(y, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="with" type="Vector2" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector2(minf(x, with.x), minf(y, with.y))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Y]. </description> </method> + <method name="minf" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector2(minf(x, with), minf(y, with))[/code]. + </description> + </method> <method name="move_toward" qualifiers="const"> <return type="Vector2" /> <param index="0" name="to" type="Vector2" /> @@ -321,9 +358,10 @@ </method> <method name="reflect" qualifiers="const"> <return type="Vector2" /> - <param index="0" name="n" type="Vector2" /> + <param index="0" name="line" type="Vector2" /> <description> - Returns the result of reflecting the vector from a line defined by the given direction vector [param n]. + Returns the result of reflecting the vector from a line defined by the given direction vector [param line]. + [b]Note:[/b] [method reflect] differs from what other engines and frameworks call [code skip-lint]reflect()[/code]. In other engines, [code skip-lint]reflect()[/code] takes a normal direction which is a direction perpendicular to the line. In Godot, you specify the direction of the line directly. See also [method bounce] which does what most engines call [code skip-lint]reflect()[/code]. </description> </method> <method name="rotated" qualifiers="const"> @@ -369,6 +407,13 @@ Returns a new vector with each component snapped to the nearest multiple of the corresponding component in [param step]. This can also be used to round the components to an arbitrary number of decimals. </description> </method> + <method name="snappedf" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="step" type="float" /> + <description> + Returns a new vector with each component snapped to the nearest multiple of [param step]. This can also be used to round the components to an arbitrary number of decimals. + </description> + </method> </methods> <members> <member name="x" type="float" setter="" getter="" default="0.0"> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 18291e06a9..4afc62e038 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -64,6 +64,14 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampi" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="min" type="int" /> + <param index="1" name="max" type="int" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="distance_squared_to" qualifiers="const"> <return type="int" /> <param index="0" name="to" type="Vector2i" /> @@ -92,18 +100,46 @@ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="with" type="Vector2i" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector2i(maxi(x, with.x), maxi(y, with.y))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxi" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector2i(maxi(x, with), maxi(y, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="with" type="Vector2i" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector2i(mini(x, with.x), mini(y, with.y))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Y]. </description> </method> + <method name="mini" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector2i(mini(x, with), mini(y, with))[/code]. + </description> + </method> <method name="sign" qualifiers="const"> <return type="Vector2i" /> <description> @@ -117,6 +153,13 @@ Returns a new vector with each component snapped to the closest multiple of the corresponding component in [param step]. </description> </method> + <method name="snappedi" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="step" type="int" /> + <description> + Returns a new vector with each component snapped to the closest multiple of [param step]. + </description> + </method> </methods> <members> <member name="x" type="int" setter="" getter="" default="0"> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 872534fd89..387359a97f 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -14,7 +14,7 @@ <link title="Vector math">$DOCS_URL/tutorials/math/vector_math.html</link> <link title="Advanced vector math">$DOCS_URL/tutorials/math/vectors_advanced.html</link> <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link> - <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> + <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/2787</link> <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link> </tutorials> <constructors> @@ -86,7 +86,8 @@ <return type="Vector3" /> <param index="0" name="n" type="Vector3" /> <description> - Returns the vector "bounced off" from a plane defined by the given normal. + Returns the vector "bounced off" from a plane defined by the given normal [param n]. + [b]Note:[/b] [method bounce] performs the operation that most engines and frameworks call [code skip-lint]reflect()[/code]. </description> </method> <method name="ceil" qualifiers="const"> @@ -103,11 +104,20 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampf" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="min" type="float" /> + <param index="1" name="max" type="float" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="cross" qualifiers="const"> <return type="Vector3" /> <param index="0" name="with" type="Vector3" /> <description> Returns the cross product of this vector and [param with]. + This returns a vector perpendicular to both this and [param with], which would be the normal vector of the plane defined by the two vectors. As there are two such vectors, in opposite directions, this method returns the vector defined by a right-handed coordinate system. If the two vectors are parallel this returns an empty vector, making it useful for testing if two vectors are parallel. </description> </method> <method name="cubic_interpolate" qualifiers="const"> @@ -232,18 +242,46 @@ Returns the vector with a maximum length by limiting its length to [param length]. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="with" type="Vector3" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector3(maxf(x, with.x), maxf(y, with.y), maxf(z, with.z))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxf" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector3(maxf(x, with), maxf(y, with), maxf(z, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="with" type="Vector3" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector3(minf(x, with.x), minf(y, with.y), minf(z, with.z))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. </description> </method> + <method name="minf" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector3(minf(x, with), minf(y, with), minf(z, with))[/code]. + </description> + </method> <method name="move_toward" qualifiers="const"> <return type="Vector3" /> <param index="0" name="to" type="Vector3" /> @@ -307,7 +345,8 @@ <return type="Vector3" /> <param index="0" name="n" type="Vector3" /> <description> - Returns the result of reflecting the vector from a plane defined by the given normal [param n]. + Returns the result of reflecting the vector through a plane defined by the given normal vector [param n]. + [b]Note:[/b] [method reflect] differs from what other engines and frameworks call [code skip-lint]reflect()[/code]. In other engines, [code skip-lint]reflect()[/code] returns the result of the vector reflected by the given plane. The reflection thus passes through the given normal. While in Godot the reflection passes through the plane and can be thought of as bouncing off the normal. See also [method bounce] which does what most engines call [code skip-lint]reflect()[/code]. </description> </method> <method name="rotated" qualifiers="const"> @@ -362,6 +401,13 @@ Returns a new vector with each component snapped to the nearest multiple of the corresponding component in [param step]. This can also be used to round the components to an arbitrary number of decimals. </description> </method> + <method name="snappedf" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="step" type="float" /> + <description> + Returns a new vector with each component snapped to the nearest multiple of [param step]. This can also be used to round the components to an arbitrary number of decimals. + </description> + </method> </methods> <members> <member name="x" type="float" setter="" getter="" default="0.0"> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index ffebd3e1f3..df4624dbb1 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -59,6 +59,14 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampi" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="min" type="int" /> + <param index="1" name="max" type="int" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="distance_squared_to" qualifiers="const"> <return type="int" /> <param index="0" name="to" type="Vector3i" /> @@ -87,18 +95,46 @@ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="with" type="Vector3i" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector3i(maxi(x, with.x), maxi(y, with.y), maxi(z, with.z))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxi" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector3i(maxi(x, with), maxi(y, with), maxi(z, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="with" type="Vector3i" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector3i(mini(x, with.x), mini(y, with.y), mini(z, with.z))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. </description> </method> + <method name="mini" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector3i(mini(x, with), mini(y, with), mini(z, with))[/code]. + </description> + </method> <method name="sign" qualifiers="const"> <return type="Vector3i" /> <description> @@ -112,6 +148,13 @@ Returns a new vector with each component snapped to the closest multiple of the corresponding component in [param step]. </description> </method> + <method name="snappedi" qualifiers="const"> + <return type="Vector3i" /> + <param index="0" name="step" type="int" /> + <description> + Returns a new vector with each component snapped to the closest multiple of [param step]. + </description> + </method> </methods> <members> <member name="x" type="int" setter="" getter="" default="0"> diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index b31cdb01c9..87af370462 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -64,6 +64,14 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampf" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="min" type="float" /> + <param index="1" name="max" type="float" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="cubic_interpolate" qualifiers="const"> <return type="Vector4" /> <param index="0" name="b" type="Vector4" /> @@ -176,18 +184,46 @@ Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="with" type="Vector4" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector4(maxf(x, with.x), maxf(y, with.y), maxf(z, with.z), maxf(w, with.w))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxf" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector4(maxf(x, with), maxf(y, with), maxf(z, with), maxf(w, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="with" type="Vector4" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector4(minf(x, with.x), minf(y, with.y), minf(z, with.z), minf(w, with.w))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_W]. </description> </method> + <method name="minf" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="with" type="float" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector4(minf(x, with), minf(y, with), minf(z, with), minf(w, with))[/code]. + </description> + </method> <method name="normalized" qualifiers="const"> <return type="Vector4" /> <description> @@ -228,6 +264,13 @@ Returns a new vector with each component snapped to the nearest multiple of the corresponding component in [param step]. This can also be used to round the components to an arbitrary number of decimals. </description> </method> + <method name="snappedf" qualifiers="const"> + <return type="Vector4" /> + <param index="0" name="step" type="float" /> + <description> + Returns a new vector with each component snapped to the nearest multiple of [param step]. This can also be used to round the components to an arbitrary number of decimals. + </description> + </method> </methods> <members> <member name="w" type="float" setter="" getter="" default="0.0"> diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml index f8a0026066..8f54b767e0 100644 --- a/doc/classes/Vector4i.xml +++ b/doc/classes/Vector4i.xml @@ -57,6 +57,14 @@ Returns a new vector with all components clamped between the components of [param min] and [param max], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="clampi" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="min" type="int" /> + <param index="1" name="max" type="int" /> + <description> + Returns a new vector with all components clamped between [param min] and [param max], by running [method @GlobalScope.clamp] on each component. + </description> + </method> <method name="distance_squared_to" qualifiers="const"> <return type="int" /> <param index="0" name="to" type="Vector4i" /> @@ -85,18 +93,46 @@ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula. </description> </method> + <method name="max" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="with" type="Vector4i" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector4i(maxi(x, with.x), maxi(y, with.y), maxi(z, with.z), maxi(w, with.w))[/code]. + </description> + </method> <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> + <method name="maxi" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise maximum of this and [param with], equivalent to [code]Vector4i(maxi(x, with), maxi(y, with), maxi(z, with), maxi(w, with))[/code]. + </description> + </method> + <method name="min" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="with" type="Vector4i" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector4i(mini(x, with.x), mini(y, with.y), mini(z, with.z), mini(w, with.w))[/code]. + </description> + </method> <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_W]. </description> </method> + <method name="mini" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="with" type="int" /> + <description> + Returns the component-wise minimum of this and [param with], equivalent to [code]Vector4i(mini(x, with), mini(y, with), mini(z, with), mini(w, with))[/code]. + </description> + </method> <method name="sign" qualifiers="const"> <return type="Vector4i" /> <description> @@ -110,6 +146,13 @@ Returns a new vector with each component snapped to the closest multiple of the corresponding component in [param step]. </description> </method> + <method name="snappedi" qualifiers="const"> + <return type="Vector4i" /> + <param index="0" name="step" type="int" /> + <description> + Returns a new vector with each component snapped to the closest multiple of [param step]. + </description> + </method> </methods> <members> <member name="w" type="int" setter="" getter="" default="0"> diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml index 359e84c3da..5b79067659 100644 --- a/doc/classes/VehicleBody3D.xml +++ b/doc/classes/VehicleBody3D.xml @@ -9,7 +9,7 @@ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you may have to write your own physics integration using [CharacterBody3D] or [RigidBody3D]. </description> <tutorials> - <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> + <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/2752</link> </tutorials> <members> <member name="brake" type="float" setter="set_brake" getter="get_brake" default="0.0"> diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml index 77cb5ca9f8..92b2297bf4 100644 --- a/doc/classes/VehicleWheel3D.xml +++ b/doc/classes/VehicleWheel3D.xml @@ -8,7 +8,7 @@ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you may need to write your own physics integration using another [PhysicsBody3D] class. </description> <tutorials> - <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> + <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/2752</link> </tutorials> <methods> <method name="get_contact_body" qualifiers="const"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index dcc817427b..b288ee7ff6 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -13,12 +13,12 @@ <tutorials> <link title="Using Viewports">$DOCS_URL/tutorials/rendering/viewports.html</link> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> - <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> - <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link> - <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link> - <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link> - <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link> - <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link> + <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> + <link title="3D in 2D Viewport Demo">https://godotengine.org/asset-library/asset/2804</link> + <link title="2D in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2803</link> + <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/2808</link> + <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/2806</link> + <link title="3D Resolution Scaling Demo">https://godotengine.org/asset-library/asset/2805</link> </tutorials> <methods> <method name="find_world_2d" qualifiers="const"> @@ -347,12 +347,17 @@ Sets the screen-space antialiasing method used. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. </member> <member name="sdf_oversize" type="int" setter="set_sdf_oversize" getter="get_sdf_oversize" enum="Viewport.SDFOversize" default="1"> + Controls how much of the original viewport's size should be covered by the 2D signed distance field. This SDF can be sampled in [CanvasItem] shaders and is also used for [GPUParticles2D] collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through [LightOccluder2D]s as the occluders leave the viewport, increase this setting. + The percentage is added on each axis and on both sides. For example, with the default [constant SDF_OVERSIZE_120_PERCENT], the signed distance field will cover 20% of the viewport's size outside the viewport on each side (top, right, bottom, left). </member> <member name="sdf_scale" type="int" setter="set_sdf_scale" getter="get_sdf_scale" enum="Viewport.SDFScale" default="1"> + The resolution scale to use for the 2D signed distance field. Higher values lead to a more precise and more stable signed distance field as the camera moves, at the cost of performance. </member> <member name="snap_2d_transforms_to_pixel" type="bool" setter="set_snap_2d_transforms_to_pixel" getter="is_snap_2d_transforms_to_pixel_enabled" default="false"> + If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. </member> <member name="snap_2d_vertices_to_pixel" type="bool" setter="set_snap_2d_vertices_to_pixel" getter="is_snap_2d_vertices_to_pixel_enabled" default="false"> + If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. </member> <member name="texture_mipmap_bias" type="float" setter="set_texture_mipmap_bias" getter="get_texture_mipmap_bias" default="0.0"> Affects the final texture sharpness by reading from a lower or higher mipmap (also called "texture LOD bias"). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close). @@ -389,7 +394,7 @@ <member name="vrs_texture" type="Texture2D" setter="set_vrs_texture" getter="get_vrs_texture"> Texture to use when [member vrs_mode] is set to [constant Viewport.VRS_TEXTURE]. The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision: - [codeblock] + [codeblock lang=text] - 1×1 = rgb(0, 0, 0) - #000000 - 1×2 = rgb(0, 85, 0) - #005500 - 2×1 = rgb(85, 0, 0) - #550000 @@ -402,6 +407,9 @@ - 8×8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware [/codeblock] </member> + <member name="vrs_update_mode" type="int" setter="set_vrs_update_mode" getter="get_vrs_update_mode" enum="Viewport.VRSUpdateMode" default="1"> + Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored. + </member> <member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d"> The custom [World2D] which can be used as 2D environment source. </member> @@ -515,14 +523,16 @@ Objects are displayed without light information. </constant> <constant name="DEBUG_DRAW_LIGHTING" value="2" enum="DebugDraw"> + Objects are displayed without textures and only with lighting information. </constant> <constant name="DEBUG_DRAW_OVERDRAW" value="3" enum="DebugDraw"> Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw means you are wasting performance on drawing pixels that are being hidden behind others. </constant> <constant name="DEBUG_DRAW_WIREFRAME" value="4" enum="DebugDraw"> - Objects are displayed in wireframe style. + Objects are displayed as wireframe models. </constant> <constant name="DEBUG_DRAW_NORMAL_BUFFER" value="5" enum="DebugDraw"> + Objects are displayed without lighting information and their textures replaced by normal mapping. </constant> <constant name="DEBUG_DRAW_VOXEL_GI_ALBEDO" value="6" enum="DebugDraw"> Objects are displayed with only the albedo value from [VoxelGI]s. @@ -540,6 +550,7 @@ Draws the shadow atlas that stores shadows from [DirectionalLight3D]s in the upper left quadrant of the [Viewport]. </constant> <constant name="DEBUG_DRAW_SCENE_LUMINANCE" value="11" enum="DebugDraw"> + Draws the scene luminance buffer (if available) in the upper left quadrant of the [Viewport]. </constant> <constant name="DEBUG_DRAW_SSAO" value="12" enum="DebugDraw"> Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment]. @@ -554,24 +565,36 @@ Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport]. </constant> <constant name="DEBUG_DRAW_SDFGI" value="16" enum="DebugDraw"> + Draws the cascades used to render signed distance field global illumination (SDFGI). + Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform. </constant> <constant name="DEBUG_DRAW_SDFGI_PROBES" value="17" enum="DebugDraw"> + Draws the probes used for signed distance field global illumination (SDFGI). + Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform. </constant> <constant name="DEBUG_DRAW_GI_BUFFER" value="18" enum="DebugDraw"> + Draws the buffer used for global illumination (GI). </constant> <constant name="DEBUG_DRAW_DISABLE_LOD" value="19" enum="DebugDraw"> + Draws all of the objects at their highest polycount, without low level of detail (LOD). </constant> <constant name="DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="DebugDraw"> + Draws the cluster used by [OmniLight3D] nodes to optimize light rendering. </constant> <constant name="DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="DebugDraw"> + Draws the cluster used by [SpotLight3D] nodes to optimize light rendering. </constant> <constant name="DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="DebugDraw"> + Draws the cluster used by [Decal] nodes to optimize decal rendering. </constant> <constant name="DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="DebugDraw"> + Draws the cluster used by [ReflectionProbe] nodes to optimize decal rendering. </constant> <constant name="DEBUG_DRAW_OCCLUDERS" value="24" enum="DebugDraw"> + Draws the buffer used for occlusion culling. </constant> <constant name="DEBUG_DRAW_MOTION_VECTORS" value="25" enum="DebugDraw"> + Draws vector lines over the viewport to indicate the movement of pixels between frames. </constant> <constant name="DEBUG_DRAW_INTERNAL_BUFFER" value="26" enum="DebugDraw"> Draws the internal resolution buffer of the scene before post-processing is applied. @@ -591,7 +614,7 @@ Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX" value="4" enum="DefaultCanvasItemTextureFilter"> - Max value for [enum DefaultCanvasItemTextureFilter] enum. + Represents the size of the [enum DefaultCanvasItemTextureFilter] enum. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED" value="0" enum="DefaultCanvasItemTextureRepeat"> Disables textures repeating. Instead, when reading UVs outside the 0-1 range, the value will be clamped to the edge of the texture, resulting in a stretched out look at the borders of the texture. @@ -603,37 +626,58 @@ Flip the texture when repeating so that the edge lines up instead of abruptly changing. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX" value="3" enum="DefaultCanvasItemTextureRepeat"> - Max value for [enum DefaultCanvasItemTextureRepeat] enum. + Represents the size of the [enum DefaultCanvasItemTextureRepeat] enum. </constant> <constant name="SDF_OVERSIZE_100_PERCENT" value="0" enum="SDFOversize"> + The signed distance field only covers the viewport's own rectangle. </constant> <constant name="SDF_OVERSIZE_120_PERCENT" value="1" enum="SDFOversize"> + The signed distance field is expanded to cover 20% of the viewport's size around the borders. </constant> <constant name="SDF_OVERSIZE_150_PERCENT" value="2" enum="SDFOversize"> + The signed distance field is expanded to cover 50% of the viewport's size around the borders. </constant> <constant name="SDF_OVERSIZE_200_PERCENT" value="3" enum="SDFOversize"> + The signed distance field is expanded to cover 100% (double) of the viewport's size around the borders. </constant> <constant name="SDF_OVERSIZE_MAX" value="4" enum="SDFOversize"> + Represents the size of the [enum SDFOversize] enum. </constant> <constant name="SDF_SCALE_100_PERCENT" value="0" enum="SDFScale"> + The signed distance field is rendered at full resolution. </constant> <constant name="SDF_SCALE_50_PERCENT" value="1" enum="SDFScale"> + The signed distance field is rendered at half the resolution of this viewport. </constant> <constant name="SDF_SCALE_25_PERCENT" value="2" enum="SDFScale"> + The signed distance field is rendered at a quarter the resolution of this viewport. </constant> <constant name="SDF_SCALE_MAX" value="3" enum="SDFScale"> + Represents the size of the [enum SDFScale] enum. </constant> <constant name="VRS_DISABLED" value="0" enum="VRSMode"> - VRS is disabled. + Variable Rate Shading is disabled. </constant> <constant name="VRS_TEXTURE" value="1" enum="VRSMode"> - VRS uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. + Variable Rate Shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. </constant> <constant name="VRS_XR" value="2" enum="VRSMode"> - VRS texture is supplied by the primary [XRInterface]. + Variable Rate Shading's texture is supplied by the primary [XRInterface]. </constant> <constant name="VRS_MAX" value="3" enum="VRSMode"> Represents the size of the [enum VRSMode] enum. </constant> + <constant name="VRS_UPDATE_DISABLED" value="0" enum="VRSUpdateMode"> + The input texture for variable rate shading will not be processed. + </constant> + <constant name="VRS_UPDATE_ONCE" value="1" enum="VRSUpdateMode"> + The input texture for variable rate shading will be processed once. + </constant> + <constant name="VRS_UPDATE_ALWAYS" value="2" enum="VRSUpdateMode"> + The input texture for variable rate shading will be processed each frame. + </constant> + <constant name="VRS_UPDATE_MAX" value="3" enum="VRSUpdateMode"> + Represents the size of the [enum VRSUpdateMode] enum. + </constant> </constants> </class> diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index e12933d64b..ba2352ab61 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -4,20 +4,21 @@ Provides the content of a [Viewport] as a dynamic texture. </brief_description> <description> - Provides the content of a [Viewport] as a dynamic [Texture2D]. This can be used to mix controls, 2D game objects, and 3D game objects in the same scene. - To create a [ViewportTexture] in code, use the [method Viewport.get_texture] method on the target viewport. + A [ViewportTexture] provides the content of a [Viewport] as a dynamic [Texture2D]. This can be used to combine the rendering of [Control], [Node2D] and [Node3D] nodes. For example, you can use this texture to display a 3D scene inside a [TextureRect], or a 2D overlay in a [Sprite3D]. + To get a [ViewportTexture] in code, use the [method Viewport.get_texture] method on the target viewport. [b]Note:[/b] A [ViewportTexture] is always local to its scene (see [member Resource.resource_local_to_scene]). If the scene root is not ready, it may return incorrect data (see [signal Node.ready]). + [b]Note:[/b] Instantiating scenes containing a high-resolution [ViewportTexture] may cause noticeable stutter. </description> <tutorials> - <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> - <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link> - <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link> - <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link> + <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> + <link title="3D in 2D Viewport Demo">https://godotengine.org/asset-library/asset/2804</link> + <link title="2D in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2803</link> + <link title="3D Resolution Scaling Demo">https://godotengine.org/asset-library/asset/2805</link> </tutorials> <members> <member name="viewport_path" type="NodePath" setter="set_viewport_path_in_scene" getter="get_viewport_path_in_scene" default="NodePath("")"> - The path to the [Viewport] node to display. This is relative to the scene root, not to the node that uses the texture. - [b]Note:[/b] In the editor, this path is automatically updated when the target viewport or one of its ancestors is renamed or moved. At runtime, the path may not be able to automatically update due to the inability to determine the scene root. + The path to the [Viewport] node to display. This is relative to the local scene root (see [method Resource.get_local_scene]), [b]not[/b] to the nodes that use this texture. + [b]Note:[/b] In the editor, this path is automatically updated when the target viewport or one of its ancestors is renamed or moved. At runtime, this path may not automatically update if the scene root cannot be found. </member> </members> </class> diff --git a/doc/classes/VisibleOnScreenNotifier2D.xml b/doc/classes/VisibleOnScreenNotifier2D.xml index 9d22bf6cff..cf4a0c0018 100644 --- a/doc/classes/VisibleOnScreenNotifier2D.xml +++ b/doc/classes/VisibleOnScreenNotifier2D.xml @@ -9,7 +9,7 @@ [b]Note:[/b] [VisibleOnScreenNotifier2D] uses the render culling code to determine whether it's visible on screen, so it won't function unless [member CanvasItem.visible] is set to [code]true[/code]. </description> <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="is_on_screen" qualifiers="const"> diff --git a/doc/classes/VisualShaderNodeComment.xml b/doc/classes/VisualShaderNodeComment.xml new file mode 100644 index 0000000000..28496a715a --- /dev/null +++ b/doc/classes/VisualShaderNodeComment.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeComment" inherits="VisualShaderNodeFrame" deprecated="This class has no function anymore and only exists for compatibility." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Only exists for compatibility. Use [VisualShaderNodeFrame] as a replacement. + </brief_description> + <description> + This node was replaced by [VisualShaderNodeFrame] and only exists to preserve compatibility. In the [VisualShader] editor it behaves exactly like [VisualShaderNodeFrame]. + </description> + <tutorials> + </tutorials> + <members> + <member name="description" type="String" setter="set_description" getter="get_description" default=""""> + This property only exists to preserve data authored in earlier versions of Godot. It has currently no function. + </member> + </members> +</class> diff --git a/doc/classes/VisualShaderNodeFrame.xml b/doc/classes/VisualShaderNodeFrame.xml index 3126a56abe..a86587f16a 100644 --- a/doc/classes/VisualShaderNodeFrame.xml +++ b/doc/classes/VisualShaderNodeFrame.xml @@ -4,7 +4,7 @@ A frame other visual shader nodes can be attached to for better organization. </brief_description> <description> - A rectangular frame that can be used to group visual shader nodes together to improve organization. + A rectangular frame that can be used to group visual shader nodes together to improve organization. Nodes attached to the frame will move with it when it is dragged and it can automatically resize to enclose all attached nodes. Its title, description and color can be customized. </description> diff --git a/doc/classes/VisualShaderNodeReroute.xml b/doc/classes/VisualShaderNodeReroute.xml new file mode 100644 index 0000000000..1baaa7bbb6 --- /dev/null +++ b/doc/classes/VisualShaderNodeReroute.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeReroute" inherits="VisualShaderNode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A node that allows rerouting a connection within the visual shader graph. + </brief_description> + <description> + Automatically adapts its port type to the type of the incoming connection and ensures valid connections. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_port_type" qualifiers="const"> + <return type="int" enum="VisualShaderNode.PortType" /> + <description> + Returns the port type of the reroute node. + </description> + </method> + </methods> +</class> diff --git a/doc/classes/VoxelGI.xml b/doc/classes/VoxelGI.xml index 9e4026a750..93679cccf6 100644 --- a/doc/classes/VoxelGI.xml +++ b/doc/classes/VoxelGI.xml @@ -12,7 +12,7 @@ </description> <tutorials> <link title="Using Voxel global illumination">$DOCS_URL/tutorials/3d/global_illumination/using_voxel_gi.html</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="bake"> diff --git a/doc/classes/VoxelGIData.xml b/doc/classes/VoxelGIData.xml index 088854e8f4..43bf04b1f5 100644 --- a/doc/classes/VoxelGIData.xml +++ b/doc/classes/VoxelGIData.xml @@ -8,7 +8,7 @@ [b]Note:[/b] To prevent text-based scene files ([code].tscn[/code]) from growing too much and becoming slow to load and save, always save [VoxelGIData] to an external binary resource file ([code].res[/code]) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the [VoxelGIData] resource, choosing [b]Edit[/b], clicking the floppy disk icon at the top of the Inspector then choosing [b]Save As...[/b]. </description> <tutorials> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="allocate"> diff --git a/doc/classes/WorkerThreadPool.xml b/doc/classes/WorkerThreadPool.xml index fa1f08b149..2b1bc136cb 100644 --- a/doc/classes/WorkerThreadPool.xml +++ b/doc/classes/WorkerThreadPool.xml @@ -58,6 +58,7 @@ Adds [param action] as a group task to be executed by the worker threads. The [Callable] will be called a number of times based on [param elements], with the first thread calling it with the value [code]0[/code] as a parameter, and each consecutive execution incrementing this value by 1 until it reaches [code]element - 1[/code]. The number of threads the task is distributed to is defined by [param tasks_needed], where the default value [code]-1[/code] means it is distributed to all worker threads. [param high_priority] determines if the task has a high priority or a low priority (default). You can optionally provide a [param description] to help with debugging. Returns a group task ID that can be used by other methods. + [b]Warning:[/b] Every task must be waited for completion using [method wait_for_task_completion] or [method wait_for_group_task_completion] at some point so that any allocated resources inside the task can be cleaned up. </description> </method> <method name="add_task"> @@ -68,6 +69,7 @@ <description> Adds [param action] as a task to be executed by a worker thread. [param high_priority] determines if the task has a high priority or a low priority (default). You can optionally provide a [param description] to help with debugging. Returns a task ID that can be used by other methods. + [b]Warning:[/b] Every task must be waited for completion using [method wait_for_task_completion] or [method wait_for_group_task_completion] at some point so that any allocated resources inside the task can be cleaned up. </description> </method> <method name="get_group_processed_element_count" qualifiers="const"> @@ -83,6 +85,7 @@ <param index="0" name="group_id" type="int" /> <description> Returns [code]true[/code] if the group task with the given ID is completed. + [b]Note:[/b] You should only call this method between adding the group task and awaiting its completion. </description> </method> <method name="is_task_completed" qualifiers="const"> @@ -90,6 +93,7 @@ <param index="0" name="task_id" type="int" /> <description> Returns [code]true[/code] if the task with the given ID is completed. + [b]Note:[/b] You should only call this method between adding the task and awaiting its completion. </description> </method> <method name="wait_for_group_task_completion"> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index c7ee160174..80dc46ae93 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -10,9 +10,8 @@ </description> <tutorials> <link title="Environment and post-processing">$DOCS_URL/tutorials/3d/environment_and_post_processing.html</link> - <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> - <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link> - <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> + <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link> + <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <members> <member name="camera_attributes" type="CameraAttributes" setter="set_camera_attributes" getter="get_camera_attributes"> diff --git a/doc/classes/XRBodyModifier3D.xml b/doc/classes/XRBodyModifier3D.xml index 49a226c106..d08b92a56c 100644 --- a/doc/classes/XRBodyModifier3D.xml +++ b/doc/classes/XRBodyModifier3D.xml @@ -4,15 +4,15 @@ A node for driving body meshes from [XRBodyTracker] data. </brief_description> <description> - This node uses body tracking data from a [XRBodyTracker] to animate the skeleton of a body mesh. - This node positions itself at the [constant XRBodyTracker.JOINT_ROOT] position and scales itself to [member XRServer.world_scale]. Adding the body model as a child of this node will result in the model being positioned and scaled correctly for XR experiences. + This node uses body tracking data from an [XRBodyTracker] to pose the skeleton of a body mesh. + Positioning of the body is performed by creating an [XRNode3D] ancestor of the body mesh driven by the same [XRBodyTracker]. The body tracking position-data is scaled by [member Skeleton3D.motion_scale] when applied to the skeleton, which can be used to adjust the tracked body to match the scale of the body model. </description> <tutorials> <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <members> - <member name="body_tracker" type="StringName" setter="set_body_tracker" getter="get_body_tracker" default="&"/user/body""> + <member name="body_tracker" type="StringName" setter="set_body_tracker" getter="get_body_tracker" default="&"/user/body_tracker""> The name of the [XRBodyTracker] registered with [XRServer] to obtain the body tracking data from. </member> <member name="body_update" type="int" setter="set_body_update" getter="get_body_update" enum="XRBodyModifier3D.BodyUpdate" is_bitfield="true" default="7"> @@ -21,9 +21,6 @@ <member name="bone_update" type="int" setter="set_bone_update" getter="get_bone_update" enum="XRBodyModifier3D.BoneUpdate" default="0"> Specifies the type of updates to perform on the bones. </member> - <member name="show_when_tracked" type="bool" setter="set_show_when_tracked" getter="get_show_when_tracked" default="true"> - If true then the nodes visibility is determined by whether tracking data is available. - </member> </members> <constants> <constant name="BODY_UPDATE_UPPER_BODY" value="1" enum="BodyUpdate" is_bitfield="true"> diff --git a/doc/classes/XRBodyTracker.xml b/doc/classes/XRBodyTracker.xml index 9c869b4f5f..06a4879953 100644 --- a/doc/classes/XRBodyTracker.xml +++ b/doc/classes/XRBodyTracker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="XRBodyTracker" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="XRBodyTracker" inherits="XRPositionalTracker" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A tracked body in XR. </brief_description> @@ -49,6 +49,7 @@ <member name="has_tracking_data" type="bool" setter="set_has_tracking_data" getter="get_has_tracking_data" default="false"> If [code]true[/code], the body tracking data is valid. </member> + <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" overrides="XRTracker" enum="XRServer.TrackerType" default="32" /> </members> <constants> <constant name="BODY_FLAG_UPPER_BODY_SUPPORTED" value="1" enum="BodyFlags" is_bitfield="true"> diff --git a/doc/classes/XRControllerTracker.xml b/doc/classes/XRControllerTracker.xml new file mode 100644 index 0000000000..50727a7633 --- /dev/null +++ b/doc/classes/XRControllerTracker.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRControllerTracker" inherits="XRPositionalTracker" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A tracked controller. + </brief_description> + <description> + An instance of this object represents a controller that is tracked. + As controllers are turned on and the [XRInterface] detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer]. + The [XRController3D] consumes objects of this type and should be used in your project. + </description> + <tutorials> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> + </tutorials> + <members> + <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" overrides="XRTracker" enum="XRServer.TrackerType" default="2" /> + </members> +</class> diff --git a/doc/classes/XRFaceModifier3D.xml b/doc/classes/XRFaceModifier3D.xml index 8caa74cff7..9599051b1b 100644 --- a/doc/classes/XRFaceModifier3D.xml +++ b/doc/classes/XRFaceModifier3D.xml @@ -12,7 +12,7 @@ <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <members> - <member name="face_tracker" type="StringName" setter="set_face_tracker" getter="get_face_tracker" default="&"/user/head""> + <member name="face_tracker" type="StringName" setter="set_face_tracker" getter="get_face_tracker" default="&"/user/face_tracker""> The [XRFaceTracker] path. </member> <member name="target" type="NodePath" setter="set_target" getter="get_target" default="NodePath("")"> diff --git a/doc/classes/XRFaceTracker.xml b/doc/classes/XRFaceTracker.xml index 96ed137324..23a9a9cb17 100644 --- a/doc/classes/XRFaceTracker.xml +++ b/doc/classes/XRFaceTracker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="XRFaceTracker" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="XRFaceTracker" inherits="XRTracker" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A tracked face. </brief_description> @@ -31,6 +31,7 @@ <member name="blend_shapes" type="PackedFloat32Array" setter="set_blend_shapes" getter="get_blend_shapes" default="PackedFloat32Array()"> The array of face blend shape weights with indices corresponding to the [enum BlendShapeEntry] enum. </member> + <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" overrides="XRTracker" enum="XRServer.TrackerType" default="64" /> </members> <constants> <constant name="FT_EYE_LOOK_OUT_RIGHT" value="0" enum="BlendShapeEntry"> diff --git a/doc/classes/XRHandModifier3D.xml b/doc/classes/XRHandModifier3D.xml index 9ff27bb982..09ff321070 100644 --- a/doc/classes/XRHandModifier3D.xml +++ b/doc/classes/XRHandModifier3D.xml @@ -4,8 +4,8 @@ A node for driving hand meshes from [XRHandTracker] data. </brief_description> <description> - This node uses hand tracking data from a [XRHandTracker] to animate the skeleton of a hand mesh. - This node positions itself at the [constant XRHandTracker.HAND_JOINT_PALM] position and scales itself to [member XRServer.world_scale]. Adding the hand model as a child of this node will result in the model being positioned and scaled correctly for XR experiences. + This node uses hand tracking data from an [XRHandTracker] to pose the skeleton of a hand mesh. + Positioning of hands is performed by creating an [XRNode3D] ancestor of the hand mesh driven by the same [XRHandTracker]. The hand tracking position-data is scaled by [member Skeleton3D.motion_scale] when applied to the skeleton, which can be used to adjust the tracked hand to match the scale of the hand model. </description> <tutorials> @@ -15,7 +15,7 @@ <member name="bone_update" type="int" setter="set_bone_update" getter="get_bone_update" enum="XRHandModifier3D.BoneUpdate" default="0"> Specifies the type of updates to perform on the bones. </member> - <member name="hand_tracker" type="StringName" setter="set_hand_tracker" getter="get_hand_tracker" default="&"/user/left""> + <member name="hand_tracker" type="StringName" setter="set_hand_tracker" getter="get_hand_tracker" default="&"/user/hand_tracker/left""> The name of the [XRHandTracker] registered with [XRServer] to obtain the hand tracking data from. </member> </members> diff --git a/doc/classes/XRHandTracker.xml b/doc/classes/XRHandTracker.xml index 932fec083a..636af6625b 100644 --- a/doc/classes/XRHandTracker.xml +++ b/doc/classes/XRHandTracker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="XRHandTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="XRHandTracker" inherits="XRPositionalTracker" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A tracked hand in XR. </brief_description> @@ -88,26 +88,16 @@ </method> </methods> <members> - <member name="hand" type="int" setter="set_hand" getter="get_hand" enum="XRHandTracker.Hand" default="0"> - The type of hand. - </member> + <member name="hand" type="int" setter="set_tracker_hand" getter="get_tracker_hand" overrides="XRPositionalTracker" enum="XRPositionalTracker.TrackerHand" default="1" /> <member name="hand_tracking_source" type="int" setter="set_hand_tracking_source" getter="get_hand_tracking_source" enum="XRHandTracker.HandTrackingSource" default="0"> The source of the hand tracking data. </member> <member name="has_tracking_data" type="bool" setter="set_has_tracking_data" getter="get_has_tracking_data" default="false"> If [code]true[/code], the hand tracking data is valid. </member> + <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" overrides="XRTracker" enum="XRServer.TrackerType" default="16" /> </members> <constants> - <constant name="HAND_LEFT" value="0" enum="Hand"> - A left hand. - </constant> - <constant name="HAND_RIGHT" value="1" enum="Hand"> - A right hand. - </constant> - <constant name="HAND_MAX" value="2" enum="Hand"> - Represents the size of the [enum Hand] enum. - </constant> <constant name="HAND_TRACKING_SOURCE_UNKNOWN" value="0" enum="HandTrackingSource"> The source of hand tracking data is unknown. </constant> diff --git a/doc/classes/XRNode3D.xml b/doc/classes/XRNode3D.xml index 3da1873ed8..dfe5600fcc 100644 --- a/doc/classes/XRNode3D.xml +++ b/doc/classes/XRNode3D.xml @@ -46,6 +46,9 @@ The name of the pose we're bound to. Which poses a tracker supports is not known during design time. Godot defines number of standard pose names such as [code]aim[/code] and [code]grip[/code] but other may be configured within a given [XRInterface]. </member> + <member name="show_when_tracked" type="bool" setter="set_show_when_tracked" getter="get_show_when_tracked" default="false"> + Enables showing the node when tracking starts, and hiding the node when tracking is lost. + </member> <member name="tracker" type="StringName" setter="set_tracker" getter="get_tracker" default="&"""> The name of the tracker we're bound to. Which trackers are available is not known during design time. Godot defines a number of standard trackers such as [code]left_hand[/code] and [code]right_hand[/code] but others may be configured within a given [XRInterface]. diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml index bd2432af50..2b2eae0c5e 100644 --- a/doc/classes/XRPositionalTracker.xml +++ b/doc/classes/XRPositionalTracker.xml @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="XRPositionalTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="XRPositionalTracker" inherits="XRTracker" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A tracked object. </brief_description> <description> An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. As controllers are turned on and the [XRInterface] detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer]. - The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them. + The [XRNode3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them. </description> <tutorials> <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> - <method name="get_input" qualifiers="const"> + <method name="get_input" qualifiers="const" deprecated="Use through [XRControllerTracker]."> <return type="Variant" /> <param index="0" name="name" type="StringName" /> <description> @@ -40,7 +40,7 @@ Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we lose tracking or just remain at their last known position. </description> </method> - <method name="set_input"> + <method name="set_input" deprecated="Use through [XRControllerTracker]."> <return type="void" /> <param index="0" name="name" type="StringName" /> <param index="1" name="value" type="Variant" /> @@ -61,23 +61,12 @@ </method> </methods> <members> - <member name="description" type="String" setter="set_tracker_desc" getter="get_tracker_desc" default=""""> - The description of this tracker. - </member> <member name="hand" type="int" setter="set_tracker_hand" getter="get_tracker_hand" enum="XRPositionalTracker.TrackerHand" default="0"> Defines which hand this tracker relates to. </member> - <member name="name" type="StringName" setter="set_tracker_name" getter="get_tracker_name" default="&"Unknown""> - The unique name of this tracker. The trackers that are available differ between various XR runtimes and can often be configured by the user. Godot maintains a number of reserved names that it expects the [XRInterface] to implement if applicable: - - [code]left_hand[/code] identifies the controller held in the players left hand - - [code]right_hand[/code] identifies the controller held in the players right hand - </member> <member name="profile" type="String" setter="set_tracker_profile" getter="get_tracker_profile" default=""""> The profile associated with this tracker, interface dependent but will indicate the type of controller being tracked. </member> - <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" enum="XRServer.TrackerType" default="128"> - The type of tracker. - </member> </members> <signals> <signal name="button_pressed"> @@ -135,5 +124,8 @@ <constant name="TRACKER_HAND_RIGHT" value="2" enum="TrackerHand"> This tracker is the right hand controller. </constant> + <constant name="TRACKER_HAND_MAX" value="3" enum="TrackerHand"> + Represents the size of the [enum TrackerHand] enum. + </constant> </constants> </class> diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index 671cc8f15c..49b13986ca 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -10,30 +10,6 @@ <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> - <method name="add_body_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="body_tracker" type="XRBodyTracker" /> - <description> - Registers a new [XRBodyTracker] that tracks the joints of a body. - </description> - </method> - <method name="add_face_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="face_tracker" type="XRFaceTracker" /> - <description> - Registers a new [XRFaceTracker] that tracks the blend shapes of a face. - </description> - </method> - <method name="add_hand_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="hand_tracker" type="XRHandTracker" /> - <description> - Registers a new [XRHandTracker] that tracks the joints of a hand. - </description> - </method> <method name="add_interface"> <return type="void" /> <param index="0" name="interface" type="XRInterface" /> @@ -43,9 +19,9 @@ </method> <method name="add_tracker"> <return type="void" /> - <param index="0" name="tracker" type="XRPositionalTracker" /> + <param index="0" name="tracker" type="XRTracker" /> <description> - Registers a new [XRPositionalTracker] that tracks a spatial location in real space. + Registers a new [XRTracker] that tracks a physical object. </description> </method> <method name="center_on_hmd"> @@ -61,8 +37,8 @@ You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. </description> </method> - <method name="clear_reference_frame" qualifiers="const"> - <return type="Transform3D" /> + <method name="clear_reference_frame"> + <return type="void" /> <description> Clears the reference frame that was set by previous calls to [method center_on_hmd]. </description> @@ -74,45 +50,6 @@ Finds an interface by its [param name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. </description> </method> - <method name="get_body_tracker" qualifiers="const"> - <return type="XRBodyTracker" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Returns the [XRBodyTracker] with the given tracker name. - </description> - </method> - <method name="get_body_trackers" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns a dictionary of the registered body trackers. Each element of the dictionary is a tracker name mapping to the [XRBodyTracker] instance. - </description> - </method> - <method name="get_face_tracker" qualifiers="const"> - <return type="XRFaceTracker" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Returns the [XRFaceTracker] with the given tracker name. - </description> - </method> - <method name="get_face_trackers" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns a dictionary of the registered face trackers. Each element of the dictionary is a tracker name mapping to the [XRFaceTracker] instance. - </description> - </method> - <method name="get_hand_tracker" qualifiers="const"> - <return type="XRHandTracker" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Returns the [XRHandTracker] with the given tracker name. - </description> - </method> - <method name="get_hand_trackers" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns a dictionary of the registered hand trackers. Each element of the dictionary is a tracker name mapping to the [XRHandTracker] instance. - </description> - </method> <method name="get_hmd_transform"> <return type="Transform3D" /> <description> @@ -145,7 +82,7 @@ </description> </method> <method name="get_tracker" qualifiers="const"> - <return type="XRPositionalTracker" /> + <return type="XRTracker" /> <param index="0" name="tracker_name" type="StringName" /> <description> Returns the positional tracker with the given [param tracker_name]. @@ -158,27 +95,6 @@ Returns a dictionary of trackers for [param tracker_types]. </description> </method> - <method name="remove_body_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Removes a registered [XRBodyTracker]. - </description> - </method> - <method name="remove_face_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Removes a registered [XRFaceTracker]. - </description> - </method> - <method name="remove_hand_tracker"> - <return type="void" /> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Removes a registered [XRHandTracker]. - </description> - </method> <method name="remove_interface"> <return type="void" /> <param index="0" name="interface" type="XRInterface" /> @@ -188,9 +104,9 @@ </method> <method name="remove_tracker"> <return type="void" /> - <param index="0" name="tracker" type="XRPositionalTracker" /> + <param index="0" name="tracker" type="XRTracker" /> <description> - Removes this positional [param tracker]. + Removes this [param tracker]. </description> </method> </methods> @@ -207,66 +123,6 @@ </member> </members> <signals> - <signal name="body_tracker_added"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="body_tracker" type="XRBodyTracker" /> - <description> - Emitted when a new body tracker is added. - </description> - </signal> - <signal name="body_tracker_removed"> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Emitted when a body tracker is removed. - </description> - </signal> - <signal name="body_tracker_updated"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="body_tracker" type="XRBodyTracker" /> - <description> - Emitted when an existing body tracker is updated. - </description> - </signal> - <signal name="face_tracker_added"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="face_tracker" type="XRFaceTracker" /> - <description> - Emitted when a new face tracker is added. - </description> - </signal> - <signal name="face_tracker_removed"> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Emitted when a face tracker is removed. - </description> - </signal> - <signal name="face_tracker_updated"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="face_tracker" type="XRFaceTracker" /> - <description> - Emitted when an existing face tracker is updated. - </description> - </signal> - <signal name="hand_tracker_added"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="hand_tracker" type="XRHandTracker" /> - <description> - Emitted when a new hand tracker is added. - </description> - </signal> - <signal name="hand_tracker_removed"> - <param index="0" name="tracker_name" type="StringName" /> - <description> - Emitted when a hand tracker is removed. - </description> - </signal> - <signal name="hand_tracker_updated"> - <param index="0" name="tracker_name" type="StringName" /> - <param index="1" name="hand_tracker" type="XRHandTracker" /> - <description> - Emitted when an existing hand tracker is updated. - </description> - </signal> <signal name="interface_added"> <param index="0" name="interface_name" type="StringName" /> <description> @@ -279,6 +135,11 @@ Emitted when an interface is removed. </description> </signal> + <signal name="reference_frame_changed"> + <description> + Emitted when the reference frame transform changes. + </description> + </signal> <signal name="tracker_added"> <param index="0" name="tracker_name" type="StringName" /> <param index="1" name="type" type="int" /> @@ -314,6 +175,15 @@ <constant name="TRACKER_ANCHOR" value="8" enum="TrackerType"> The tracker tracks the location and size of an AR anchor. </constant> + <constant name="TRACKER_HAND" value="16" enum="TrackerType"> + The tracker tracks the location and joints of a hand. + </constant> + <constant name="TRACKER_BODY" value="32" enum="TrackerType"> + The tracker tracks the location and joints of a body. + </constant> + <constant name="TRACKER_FACE" value="64" enum="TrackerType"> + The tracker tracks the expressions of a face. + </constant> <constant name="TRACKER_ANY_KNOWN" value="127" enum="TrackerType"> Used internally to filter trackers of any known type. </constant> diff --git a/doc/classes/XRTracker.xml b/doc/classes/XRTracker.xml new file mode 100644 index 0000000000..00a44bd03e --- /dev/null +++ b/doc/classes/XRTracker.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A tracked object. + </brief_description> + <description> + This object is the base of all XR trackers. + </description> + <tutorials> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> + </tutorials> + <members> + <member name="description" type="String" setter="set_tracker_desc" getter="get_tracker_desc" default=""""> + The description of this tracker. + </member> + <member name="name" type="StringName" setter="set_tracker_name" getter="get_tracker_name" default="&"Unknown""> + The unique name of this tracker. The trackers that are available differ between various XR runtimes and can often be configured by the user. Godot maintains a number of reserved names that it expects the [XRInterface] to implement if applicable: + - [code]head[/code] identifies the [XRPositionalTracker] of the players head + - [code]left_hand[/code] identifies the [XRControllerTracker] in the players left hand + - [code]right_hand[/code] identifies the [XRControllerTracker] in the players right hand + - [code]/user/hand_tracker/left[/code] identifies the [XRHandTracker] for the players left hand + - [code]/user/hand_tracker/right[/code] identifies the [XRHandTracker] for the players right hand + - [code]/user/body_tracker[/code] identifies the [XRBodyTracker] for the players body + - [code]/user/face_tracker[/code] identifies the [XRFaceTracker] for the players face + </member> + <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" enum="XRServer.TrackerType" default="128"> + The type of tracker. + </member> + </members> +</class> diff --git a/doc/classes/XRVRS.xml b/doc/classes/XRVRS.xml new file mode 100644 index 0000000000..b19b461fab --- /dev/null +++ b/doc/classes/XRVRS.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRVRS" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Helper class for XR interfaces that generates VRS images. + </brief_description> + <description> + This class is used by various XR interfaces to generate VRS textures that can be used to speed up rendering. + </description> + <tutorials> + </tutorials> + <methods> + <method name="make_vrs_texture"> + <return type="RID" /> + <param index="0" name="target_size" type="Vector2" /> + <param index="1" name="eye_foci" type="PackedVector2Array" /> + <description> + Generates the VRS texture based on a render [param target_size] adjusted by our VRS tile size. For each eyes focal point passed in [param eye_foci] a layer is created. Focal point should be in NDC. + The result will be cached, requesting a VRS texture with unchanged parameters and settings will return the cached RID. + </description> + </method> + </methods> + <members> + <member name="vrs_min_radius" type="float" setter="set_vrs_min_radius" getter="get_vrs_min_radius" default="20.0"> + The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size. + </member> + <member name="vrs_strength" type="float" setter="set_vrs_strength" getter="get_vrs_strength" default="1.0"> + The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. + </member> + </members> +</class> |