diff options
Diffstat (limited to 'doc')
126 files changed, 1525 insertions, 479 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 60ed7fac8e..33afe38446 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -107,6 +107,17 @@ [/codeblock] </description> </method> + <method name="bezier_derivative"> + <return type="float" /> + <param index="0" name="start" type="float" /> + <param index="1" name="control_1" type="float" /> + <param index="2" name="control_2" type="float" /> + <param index="3" name="end" type="float" /> + <param index="4" name="t" type="float" /> + <description> + Returns the derivative at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points. + </description> + </method> <method name="bezier_interpolate"> <return type="float" /> <param index="0" name="start" type="float" /> @@ -529,7 +540,7 @@ <param index="2" name="weight" type="Variant" /> <description> Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clamp] on the result of this function. - Both [param from] and [param to] must be the same type. Supported types: [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis]. + Both [param from] and [param to] must be the same type. Supported types: [int], [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis]. [codeblock] lerp(0, 4, 0.75) # Returns 3.0 [/codeblock] @@ -785,14 +796,13 @@ </method> <method name="printraw" qualifiers="vararg"> <description> - Prints one or more arguments to strings in the best way possible to console. Unlike [method print], no newline is automatically added at the end. + 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. [codeblock] printraw("A") printraw("B") printraw("C") - # Prints ABC + # Prints ABC to terminal [/codeblock] - [b]Note:[/b] Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [method print]. </description> </method> <method name="prints" qualifiers="vararg"> @@ -2767,17 +2777,10 @@ <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="21" enum="PropertyHint"> Hints that a [Color] property should be edited without affecting its transparency ([member Color.a] is not editable). </constant> - <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSY" value="22" enum="PropertyHint"> - Hints that an image is compressed using lossy compression. The editor does not internally use this property hint. + <constant name="PROPERTY_HINT_OBJECT_ID" value="22" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="23" enum="PropertyHint"> - Hints that an image is compressed using lossless compression. The editor does not internally use this property hint. - </constant> - <constant name="PROPERTY_HINT_OBJECT_ID" value="24" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_TYPE_STRING" value="25" enum="PropertyHint"> - Hints that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. - [b]Example:[/b] + <constant name="PROPERTY_HINT_TYPE_STRING" value="23" enum="PropertyHint"> + Hint that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. For instance: [codeblock] hint_string = "%s:" % [TYPE_INT] # Array of integers. hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats. @@ -2786,56 +2789,53 @@ [/codeblock] [b]Note:[/b] The final colon is required for properly detecting built-in types. </constant> - <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="26" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_VARIANT_TYPE" value="27" enum="PropertyHint"> + <constant name="PROPERTY_HINT_METHOD_OF_VARIANT_TYPE" value="25" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_BASE_TYPE" value="28" enum="PropertyHint"> + <constant name="PROPERTY_HINT_METHOD_OF_BASE_TYPE" value="26" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_INSTANCE" value="29" enum="PropertyHint"> + <constant name="PROPERTY_HINT_METHOD_OF_INSTANCE" value="27" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_SCRIPT" value="30" enum="PropertyHint"> + <constant name="PROPERTY_HINT_METHOD_OF_SCRIPT" value="28" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE" value="31" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE" value="29" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_BASE_TYPE" value="32" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PROPERTY_OF_BASE_TYPE" value="30" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_INSTANCE" value="33" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PROPERTY_OF_INSTANCE" value="31" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_SCRIPT" value="34" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PROPERTY_OF_SCRIPT" value="32" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="35" enum="PropertyHint"> - Hints that a property's size (in bytes) is too big to be displayed, when debugging a running project. The debugger uses this hint internally. + <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="33" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="36" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="34" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_SAVE_FILE" value="37" enum="PropertyHint"> + <constant name="PROPERTY_HINT_SAVE_FILE" value="35" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="38" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="36" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="39" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="37" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_INT_IS_POINTER" value="40" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_POINTER" value="38" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_ARRAY_TYPE" value="41" enum="PropertyHint"> + <constant name="PROPERTY_HINT_ARRAY_TYPE" value="39" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_LOCALE_ID" value="42" enum="PropertyHint"> - Hints that a [String] property is a locale code. Editing it will show a locale dialog for picking language and country. + <constant name="PROPERTY_HINT_LOCALE_ID" value="40" enum="PropertyHint"> + Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. </constant> - <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="43" enum="PropertyHint"> - Hints that a [Dictionary] property is string translation map. Dictionary keys are locale codes and, values are translated strings. + <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="41" enum="PropertyHint"> + Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. </constant> - <constant name="PROPERTY_HINT_NODE_TYPE" value="44" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_TYPE" value="42" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="45" enum="PropertyHint"> - Hints that a [Quaternion] property should disable the temporary euler editor. + <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="43" enum="PropertyHint"> + Hints that a quaternion property should disable the temporary euler editor. </constant> - <constant name="PROPERTY_HINT_PASSWORD" value="46" enum="PropertyHint"> - Hints that a [String] property is a password. Every character of the string is displayed as the secret character (typically [code]*[/code]). - An optional placeholder text can be shown on its input field, similarly to [constant PROPERTY_HINT_PLACEHOLDER_TEXT]. + <constant name="PROPERTY_HINT_PASSWORD" value="44" enum="PropertyHint"> + Hints that a string property is a password, and every character is replaced with the secret character. </constant> - <constant name="PROPERTY_HINT_MAX" value="47" enum="PropertyHint"> - Represents the size of the [enum PropertyHint] enum. + <constant name="PROPERTY_HINT_MAX" value="45" enum="PropertyHint"> </constant> <constant name="PROPERTY_USAGE_NONE" value="0" enum="PropertyUsageFlags"> The property is not stored, and does not display in the editor. This is the default for non-exported properties. diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml index f0c86ba47b..57a7f86901 100644 --- a/doc/classes/AnimatedTexture.xml +++ b/doc/classes/AnimatedTexture.xml @@ -57,6 +57,7 @@ <member name="pause" type="bool" setter="set_pause" getter="get_pause" default="false"> If [code]true[/code], the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to [code]false[/code]. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. </member> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 008296713d..af8d9c416f 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -568,13 +568,6 @@ The animation step value. </member> </members> - <signals> - <signal name="tracks_changed"> - <description> - Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths. - </description> - </signal> - </signals> <constants> <constant name="TYPE_VALUE" value="0" enum="TrackType"> Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated [constant TYPE_POSITION_3D], [constant TYPE_ROTATION_3D] and [constant TYPE_SCALE_3D] track types instead of [constant TYPE_VALUE] is recommended for performance reasons. diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index ab948dd0de..b9c8ab0f6c 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -25,10 +25,12 @@ m.mesh = arr_mesh [/gdscript] [csharp] - var vertices = new Godot.Collections.Array<Vector3>(); - vertices.Add(new Vector3(0, 1, 0)); - vertices.Add(new Vector3(1, 0, 0)); - vertices.Add(new Vector3(0, 0, 1)); + var vertices = new Vector3[] + { + new Vector3(0, 1, 0), + new Vector3(1, 0, 0), + new Vector3(0, 0, 1), + }; // Initialize the ArrayMesh. var arrMesh = new ArrayMesh(); @@ -38,7 +40,7 @@ // Create the Mesh. arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays); - var m = new MeshInstance(); + var m = new MeshInstance3D(); m.Mesh = arrMesh; [/csharp] [/codeblocks] diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 809d983a9d..fc75459e46 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -23,5 +23,6 @@ <member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2(0, 0, 0, 0)"> The region used to draw the [member atlas]. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> </members> </class> diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml index 6bd8522459..ef39a9c60e 100644 --- a/doc/classes/AudioEffectDistortion.xml +++ b/doc/classes/AudioEffectDistortion.xml @@ -2,11 +2,11 @@ <class name="AudioEffectDistortion" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Adds a distortion audio effect to an Audio bus. - Modify the sound to make it distorted. + Modifies the sound to make it distorted. </brief_description> <description> Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape. - By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently. + By distorting the waveform the frequency content changes, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently. </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> @@ -22,10 +22,10 @@ Distortion type. </member> <member name="post_gain" type="float" setter="set_post_gain" getter="get_post_gain" default="0.0"> - Increases or decreases the volume after the effect. Value can range from -80 to 24. + Increases or decreases the volume after the effect, in decibels. Value can range from -80 to 24. </member> <member name="pre_gain" type="float" setter="set_pre_gain" getter="get_pre_gain" default="0.0"> - Increases or decreases the volume before the effect. Value can range from -60 to 60. + Increases or decreases the volume before the effect, in decibels. Value can range from -60 to 60. </member> </members> <constants> @@ -35,10 +35,10 @@ <constant name="MODE_ATAN" value="1" enum="Mode"> </constant> <constant name="MODE_LOFI" value="2" enum="Mode"> - Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices. + Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices. </constant> <constant name="MODE_OVERDRIVE" value="3" enum="Mode"> - Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. + Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. The [member drive] property has no effect in this mode. </constant> <constant name="MODE_WAVESHAPE" value="4" enum="Mode"> Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound. diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index ae86fd0e66..81755b580f 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -29,7 +29,7 @@ <return type="void" /> <param index="0" name="from_position" type="float" default="0.0" /> <description> - Plays the audio from the given position [param from_position], in seconds. + Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds. </description> </method> <method name="seek"> @@ -73,7 +73,7 @@ The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. </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], audio is playing or is queued to be played (see [method play]). </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 11d6e9cc7a..f711210ca1 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -29,7 +29,7 @@ <return type="void" /> <param index="0" name="from_position" type="float" default="0.0" /> <description> - Plays the audio from the given position [param from_position], in seconds. + Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds. </description> </method> <method name="seek"> @@ -94,7 +94,7 @@ The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. </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], audio is playing or is queued to be played (see [method play]). </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] resource to be played. diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index de980eab0c..fbb31cadcd 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -529,13 +529,13 @@ The material will use the texture's alpha values for transparency. </constant> <constant name="TRANSPARENCY_ALPHA_SCISSOR" value="2" enum="Transparency"> - The material will cut off all values below a threshold, the rest will remain opaque. + The material will cut off all values below a threshold, the rest will remain opaque. The opaque portions will be rendering in the depth prepass. </constant> <constant name="TRANSPARENCY_ALPHA_HASH" value="3" enum="Transparency"> The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque. </constant> <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="4" enum="Transparency"> - The material will use the texture's alpha value for transparency, but will still be rendered in the pre-pass. + The material will use the texture's alpha value for transparency, but will still be rendered in the depth prepass. </constant> <constant name="TRANSPARENCY_MAX" value="5" enum="Transparency"> Represents the size of the [enum Transparency] enum. @@ -613,13 +613,14 @@ Enables AlphaToCoverage and forces all non-zero alpha values to [code]1[/code]. Alpha values in the material are passed to the AntiAliasing sample mask. </constant> <constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0" enum="DepthDrawMode"> - Default depth draw mode. Depth is drawn only for opaque objects. + Default depth draw mode. Depth is drawn only for opaque objects during the opaque prepass (if any) and during the opaque pass. </constant> <constant name="DEPTH_DRAW_ALWAYS" value="1" enum="DepthDrawMode"> - Depth draw is calculated for both opaque and transparent objects. + Objects will write to depth during the opaque and the transparent passes. Transparent objects that are close to the camera may obscure other transparent objects behind them. + [b]Note:[/b] This does not influence whether transparent objects are included in the depth prepass or not. For that, see [enum Transparency]. </constant> <constant name="DEPTH_DRAW_DISABLED" value="2" enum="DepthDrawMode"> - No depth draw. + Objects will not write their depth to the depth buffer, even during the depth prepass (if enabled). </constant> <constant name="CULL_BACK" value="0" enum="CullMode"> Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes this means that only the exterior of the mesh will be visible. @@ -631,7 +632,7 @@ No culling is performed. </constant> <constant name="FLAG_DISABLE_DEPTH_TEST" value="0" enum="Flags"> - Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + Disables the depth test, so this object is drawn on top of all others drawn before it. This puts the object in the transparent draw pass where it is sorted based on distance to camera. Objects drawn after it in the draw order may cover it. This also disables writing to depth. </constant> <constant name="FLAG_ALBEDO_FROM_VERTEX_COLOR" value="1" enum="Flags"> Set [code]ALBEDO[/code] to the per-vertex color specified in the mesh. diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index dd48ee6790..1fb4f91920 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Callable" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - An object representing a method in a certain object that can be called. + Built-in type representing a method in an object instance or a standalone function. </brief_description> <description> - [Callable] is a first class object which can be held in variables and passed to functions. It represents a given method in an [Object], and is typically used for signal callbacks. + [Callable] is a built-in [Variant] type that represents a function. It can either be a method within an [Object] instance, or a standalone function not related to any object, like a lambda function. Like all [Variant] types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks. [b]Example:[/b] [codeblocks] [gdscript] @@ -32,6 +32,18 @@ } [/csharp] [/codeblocks] + In GDScript, it's possible to create lambda functions within a method. Lambda functions are custom callables that are not associated with an [Object] instance. Optionally, lambda functions can also be named. The name will be displayed in the debugger, or when calling [method get_method]. + [codeblock] + func _init(): + var my_lambda = func (message): + print(message) + + # Prints Hello everyone! + my_lambda.call("Hello everyone!") + + # Prints "Attack!", when the button_pressed signal is emitted. + button_pressed.connect(func(): print("Attack!")) + [/codeblock] </description> <tutorials> </tutorials> @@ -39,7 +51,7 @@ <constructor name="Callable"> <return type="Callable" /> <description> - Constructs a null [Callable] with no object nor method bound. + Constructs an empty [Callable], with no object nor method bound. </description> </constructor> <constructor name="Callable"> @@ -54,7 +66,7 @@ <param index="0" name="object" type="Object" /> <param index="1" name="method" type="StringName" /> <description> - Creates a new [Callable] for the method called [param method] in the specified [param object]. + Creates a new [Callable] for the method named [param method] in the specified [param object]. </description> </constructor> </constructors> @@ -62,7 +74,7 @@ <method name="bind" qualifiers="vararg const"> <return type="Callable" /> <description> - Returns a copy of this [Callable] with the arguments bound. Bound arguments are passed after the arguments supplied by [method call]. + Returns a copy of this [Callable] with one or more arguments bound. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. </description> </method> <method name="call" qualifiers="vararg const"> @@ -85,13 +97,13 @@ <return type="Variant" /> <param index="0" name="arguments" type="Array" /> <description> - Calls the method represented by this [Callable]. Contrary to [method call], this method does not take a variable number of arguments but expects all arguments to be passed via a single [Array]. + Calls the method represented by this [Callable]. Unlike [method call], this method expects all arguments to be contained inside the [param arguments] [Array]. </description> </method> <method name="get_method" qualifiers="const"> <return type="StringName" /> <description> - Returns the name of the method represented by this [Callable]. + Returns the name of the method represented by this [Callable]. If the callable is a lambda function, returns the function's name. </description> </method> <method name="get_object" qualifiers="const"> @@ -116,7 +128,7 @@ <method name="is_custom" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if this [Callable] is a custom callable whose behavior differs based on implementation details. Custom callables are used in the engine for various reasons. If [code]true[/code], you can't use [method get_method]. + Returns [code]true[/code] if this [Callable] is a custom callable. Custom callables are created from [method bind] or [method unbind]. In GDScript, lambda functions are also custom callables. </description> </method> <method name="is_null" qualifiers="const"> @@ -128,33 +140,33 @@ <method name="is_standard" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if this [Callable] is a standard callable, referencing an object and a method using a [StringName]. + Returns [code]true[/code] if this [Callable] is a standard callable. This method is the opposite of [method is_custom]. Returns [code]false[/code] if this callable is a lambda function. </description> </method> <method name="is_valid" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the object exists and has a valid function assigned, or is a custom callable. + Returns [code]true[/code] if the callable's object exists and has a valid method name assigned, or is a custom callable. </description> </method> <method name="rpc" qualifiers="vararg const"> <return type="void" /> <description> - Perform an RPC (Remote Procedure Call). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling it on unsupported functions will result in an error. + Perform an RPC (Remote Procedure Call). This is used for multiplayer and is normally not available, unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. </description> </method> <method name="rpc_id" qualifiers="vararg const"> <return type="void" /> <param index="0" name="peer_id" type="int" /> <description> - Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling it on unsupported functions will result in an error. + Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. </description> </method> <method name="unbind" qualifiers="const"> <return type="Callable" /> <param index="0" name="argcount" type="int" /> <description> - Returns a copy of this [Callable] with the arguments unbound. Calling the returned [Callable] will call the method without the extra arguments that are supplied in the [Callable] on which you are calling this method. + Returns a copy of this [Callable] with the arguments unbound, as defined by [param argcount]. Calling the returned [Callable] will call the method without the extra arguments that are supplied in the [Callable] on which you are calling this method. </description> </method> </methods> diff --git a/doc/classes/CameraTexture.xml b/doc/classes/CameraTexture.xml index 8eedfe3580..e7020c869e 100644 --- a/doc/classes/CameraTexture.xml +++ b/doc/classes/CameraTexture.xml @@ -16,6 +16,7 @@ <member name="camera_is_active" type="bool" setter="set_camera_active" getter="get_camera_active" default="false"> Convenience property that gives access to the active property of the [CameraFeed]. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="which_feed" type="int" setter="set_which_feed" getter="get_which_feed" enum="CameraServer.FeedImage" default="0"> Which image within the [CameraFeed] we want access to, important if the camera image is split in a Y and CbCr component. </member> diff --git a/doc/classes/CanvasGroup.xml b/doc/classes/CanvasGroup.xml index 3bea8cde21..d2bcf3c7ac 100644 --- a/doc/classes/CanvasGroup.xml +++ b/doc/classes/CanvasGroup.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CanvasGroup" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Merges several 2D nodes into a single draw operation. </brief_description> <description> + Child [CanvasItem] nodes of a [CanvasGroup] are drawn as a single object. It allows to e.g. draw overlapping translucent 2D nodes without blending (set [member CanvasItem.self_modulate] property of [CanvasGroup] to achieve this effect). + [b]Note:[/b] Since [CanvasGroup] and [member CanvasItem.clip_children] both utilize the backbuffer, children of a [CanvasGroup] who have their [member CanvasItem.clip_children] set to anything other than [constant CanvasItem.CLIP_CHILDREN_DISABLED] will not function correctly. </description> <tutorials> </tutorials> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index a2859552a9..50bbbc71a0 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -672,12 +672,16 @@ Represents the size of the [enum TextureRepeat] enum. </constant> <constant name="CLIP_CHILDREN_DISABLED" value="0" enum="ClipChildrenMode"> + Child draws over parent and is not clipped. </constant> <constant name="CLIP_CHILDREN_ONLY" value="1" enum="ClipChildrenMode"> + Parent is used for the purposes of clipping only. Child is clipped to the parent's visible area, parent is not drawn. </constant> <constant name="CLIP_CHILDREN_AND_DRAW" value="2" enum="ClipChildrenMode"> + Parent is used for clipping child, but parent is also drawn underneath child as normal before clipping child to its visible area. </constant> <constant name="CLIP_CHILDREN_MAX" value="3" enum="ClipChildrenMode"> + Represents the size of the [enum ClipChildrenMode] enum. </constant> </constants> </class> diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml index 2dc83790c7..d5bf65835f 100644 --- a/doc/classes/CanvasTexture.xml +++ b/doc/classes/CanvasTexture.xml @@ -17,6 +17,7 @@ The normal map texture to use. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. [b]Note:[/b] Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color(1, 1, 1, 1)"> The multiplier for specular reflection colors. The [Light2D]'s color is also taken into account when determining the reflection color. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. </member> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 0111ef804e..7395556d05 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -10,7 +10,7 @@ </description> <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> - <link title="Using KinematicBody2D">$DOCS_URL/tutorials/physics/using_kinematic_body_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> </tutorials> diff --git a/doc/classes/CompressedCubemap.xml b/doc/classes/CompressedCubemap.xml index fbb0879fdc..10ee266897 100644 --- a/doc/classes/CompressedCubemap.xml +++ b/doc/classes/CompressedCubemap.xml @@ -1,8 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedCubemap" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + 6-sided texture typically used in 3D rendering, optionally compressed. </brief_description> <description> + A cubemap that is loaded from a [code].ccube[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemap] can use one of 4 compresson methods: + - Uncompressed (uncompressed on the GPU) + - Lossless (WebP or PNG, uncompressed on the GPU) + - Lossy (WebP, uncompressed on the GPU) + - VRAM Compressed (compressed on the GPU) + Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. + Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. + See [Cubemap] for a general description of cubemaps. </description> <tutorials> </tutorials> diff --git a/doc/classes/CompressedCubemapArray.xml b/doc/classes/CompressedCubemapArray.xml index ff096cea47..4221241910 100644 --- a/doc/classes/CompressedCubemapArray.xml +++ b/doc/classes/CompressedCubemapArray.xml @@ -1,8 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedCubemapArray" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Array of 6-sided textures typically used in 3D rendering, optionally compressed. </brief_description> <description> + A cubemap array that is loaded from a [code].ccubearray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemapArray] can use one of 4 compresson methods: + - Uncompressed (uncompressed on the GPU) + - Lossless (WebP or PNG, uncompressed on the GPU) + - Lossy (WebP, uncompressed on the GPU) + - VRAM Compressed (compressed on the GPU) + Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. + Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. + See [CubemapArray] for a general description of cubemap arrays. </description> <tutorials> </tutorials> diff --git a/doc/classes/CompressedTexture2D.xml b/doc/classes/CompressedTexture2D.xml index f74265b8d5..660062af7b 100644 --- a/doc/classes/CompressedTexture2D.xml +++ b/doc/classes/CompressedTexture2D.xml @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedTexture2D" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A [code].ctex[/code] texture. + Texture with 2 dimensions, optionally compressed. </brief_description> <description> - A texture that is loaded from a [code].ctex[/code] file. + A texture that is loaded from a [code].ctex[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedTexture2D] can use one of 4 compression methods (including a lack of any compression): + - Uncompressed (uncompressed on the GPU) + - Lossless (WebP or PNG, uncompressed on the GPU) + - Lossy (WebP, uncompressed on the GPU) + - VRAM Compressed (compressed on the GPU) + Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. + Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. </description> <tutorials> </tutorials> @@ -13,13 +19,14 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> <description> - Loads the texture from the given path. + Loads the texture from the specified [param path]. </description> </method> </methods> <members> <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> - The CompressedTexture's file path to a [code].ctex[/code] file. + The [CompressedTexture2D]'s file path to a [code].ctex[/code] file. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> </members> </class> diff --git a/doc/classes/CompressedTexture2DArray.xml b/doc/classes/CompressedTexture2DArray.xml index 0c751759af..0bd894a2da 100644 --- a/doc/classes/CompressedTexture2DArray.xml +++ b/doc/classes/CompressedTexture2DArray.xml @@ -1,8 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedTexture2DArray" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Array of 2-dimensional textures, optionally compressed. </brief_description> <description> + A texture array that is loaded from a [code].ctexarray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedTexture2DArray] can use one of 4 compresson methods: + - Uncompressed (uncompressed on the GPU) + - Lossless (WebP or PNG, uncompressed on the GPU) + - Lossy (WebP, uncompressed on the GPU) + - VRAM Compressed (compressed on the GPU) + Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. + Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. + See [Texture2DArray] for a general description of texture arrays. </description> <tutorials> </tutorials> diff --git a/doc/classes/CompressedTexture3D.xml b/doc/classes/CompressedTexture3D.xml index 50bd025861..b11583b684 100644 --- a/doc/classes/CompressedTexture3D.xml +++ b/doc/classes/CompressedTexture3D.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedTexture3D" inherits="Texture3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Texture with 3 dimensions, optionally compressed. </brief_description> <description> + [CompressedTexture3D] is the VRAM-compressed counterpart of [ImageTexture3D]. The file extension for [CompressedTexture3D] files is [code].ctex3d[/code]. This file format is internal to Godot; it is created by importing other image formats with the import system. + [CompressedTexture3D] uses VRAM compression, which allows to reduce memory usage on the GPU when rendering the texture. This also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. + See [Texture3D] for a general description of 3D textures. </description> <tutorials> </tutorials> @@ -11,11 +15,13 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> <description> + Loads the texture from the specified [param path]. </description> </method> </methods> <members> <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> + The [CompressedTexture3D]'s file path to a [code].ctex3d[/code] file. </member> </members> </class> diff --git a/doc/classes/CompressedTextureLayered.xml b/doc/classes/CompressedTextureLayered.xml index 547679c0f0..376483ae5c 100644 --- a/doc/classes/CompressedTextureLayered.xml +++ b/doc/classes/CompressedTextureLayered.xml @@ -1,8 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CompressedTextureLayered" inherits="TextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Base class for texture arrays that can optionally be compressed. </brief_description> <description> + A texture array that is loaded from a [code].ctexarray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedTexture2D] can use one of 4 compresson methods: + - Uncompressed (uncompressed on the GPU) + - Lossless (WebP or PNG, uncompressed on the GPU) + - Lossy (WebP, uncompressed on the GPU) + - VRAM Compressed (compressed on the GPU) + Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. + Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. </description> <tutorials> </tutorials> @@ -11,11 +19,13 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> <description> + Loads the texture at [param path]. </description> </method> </methods> <members> <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> + The path the texture should be loaded from. </member> </members> </class> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index e1dd2819b2..8a38deeebe 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1010,6 +1010,10 @@ <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0"> Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). </member> + <member name="localize_numeral_system" type="bool" setter="set_localize_numeral_system" getter="is_localizing_numeral_system" default="true"> + If [code]true[/code], automatically converts code line numbers, list indices, [SpinBox] and [ProgressBar] values from the Western Arabic (0..9) to the numeral systems used in current locale. + [b]Note:[/b] Numbers within the text are not automatically converted, it can be done manually, using [method TextServer.format_number]. + </member> <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape" default="0"> The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. [b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system. @@ -1048,7 +1052,7 @@ </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale, relative to its [member size]. Change this property to scale the node around its [member pivot_offset]. The Control's [member tooltip_text] will also scale according to this value. - [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=$DOCS_URL/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. + [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]await get_tree().process_frame[/code] then set its [member scale] property. </member> <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> diff --git a/doc/classes/Cubemap.xml b/doc/classes/Cubemap.xml index 0cdebeda95..46ddede9b1 100644 --- a/doc/classes/Cubemap.xml +++ b/doc/classes/Cubemap.xml @@ -4,8 +4,9 @@ 6-sided texture typically used in 3D rendering. </brief_description> <description> - A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections (see [ReflectionProbe]) in 3D rendering. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. - This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of Cubemap resources. + A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections in 3D rendering (see [ReflectionProbe]). It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. + This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of [Cubemap] resources. + To create such a texture file yourself, reimport your image files using the Godot Editor import presets. [b]Note:[/b] Godot doesn't support using cubemaps in a [PanoramaSkyMaterial]. You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cubemap to an equirectangular sky map. </description> <tutorials> diff --git a/doc/classes/CubemapArray.xml b/doc/classes/CubemapArray.xml index 07e401a13d..2fd55b66c6 100644 --- a/doc/classes/CubemapArray.xml +++ b/doc/classes/CubemapArray.xml @@ -5,8 +5,9 @@ </brief_description> <description> [CubemapArray]s are made of an array of [Cubemap]s. Accordingly, like [Cubemap]s they are made of multiple textures the amount of which must be divisible by 6 (one image for each face of the cube). The primary benefit of [CubemapArray]s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple [Cubemap]s into a shader using a single [CubemapArray]. - Generally, [CubemapArray]s provide a more efficient way for storing multiple [Cubemap]s, than storing multiple [Cubemap]s themselves in an array. - Internally Godot, uses [CubemapArray]s for many effects including the [Sky], if you set [member ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections] to [code]true[/code]. + Generally, [CubemapArray]s provide a more efficient way for storing multiple [Cubemap]s compared to storing multiple [Cubemap]s themselves in an array. + Internally, Godot uses [CubemapArray]s for many effects including the [Sky], if you set [member ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections] to [code]true[/code]. + To create such a texture file yourself, reimport your image files using the Godot Editor import presets. [b]Note:[/b] [CubemapArray] is not supported in the OpenGL 3 rendering backend. </description> <tutorials> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 3e4e05f51a..67e4e45e52 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -132,6 +132,15 @@ If the curve has no up vectors, the function sends an error to the console, and returns [code](0, 1, 0)[/code]. </description> </method> + <method name="sample_baked_with_rotation" qualifiers="const"> + <return type="Transform3D" /> + <param index="0" name="offset" type="float" /> + <param index="1" name="cubic" type="bool" default="false" /> + <param index="2" name="apply_tilt" type="bool" default="false" /> + <description> + Similar with [code]interpolate_baked()[/code]. The the return value is [code]Transform3D[/code], with [code]origin[/code] as point position, [code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, [code]basis.z[/code] as forward vector. When the curve length is 0, there is no reasonable way to caculate the rotation, all vectors aligned with global space axes. + </description> + </method> <method name="samplef" qualifiers="const"> <return type="Vector3" /> <param index="0" name="fofs" type="float" /> @@ -183,6 +192,15 @@ [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. </description> </method> + <method name="tessellate_even_length" qualifiers="const"> + <return type="PackedVector3Array" /> + <param index="0" name="max_stages" type="int" default="5" /> + <param index="1" name="tolerance_length" type="float" default="0.2" /> + <description> + Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! + [param tolerance_length] controls the maximal distance between two neighbouring points, before the segment has to be subdivided. + </description> + </method> </methods> <members> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" default="0.2"> diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 85473fc237..03e008d738 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -13,6 +13,7 @@ <member name="curve" type="Curve" setter="set_curve" getter="get_curve"> The [Curve] that is rendered onto the texture. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0"> The format the texture should be generated with. When passing a CurveTexture as a input to a [Shader], this may need to be adjusted. </member> diff --git a/doc/classes/CurveXYZTexture.xml b/doc/classes/CurveXYZTexture.xml index e3f2e8fc45..8c4e2dce0f 100644 --- a/doc/classes/CurveXYZTexture.xml +++ b/doc/classes/CurveXYZTexture.xml @@ -19,6 +19,7 @@ <member name="curve_z" type="Curve" setter="set_curve_z" getter="get_curve_z"> The [Curve] that is rendered onto the texture's blue channel. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="width" type="int" setter="set_width" getter="get_width" default="256"> The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. </member> diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml index a1b8ea86be..7a54980c19 100644 --- a/doc/classes/DirectionalLight2D.xml +++ b/doc/classes/DirectionalLight2D.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="DirectionalLight2D" inherits="Light2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Directional light from a distance. </brief_description> <description> + A directional light is a type of [Light2D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene (for example: to model sunlight or moonlight). </description> <tutorials> </tutorials> @@ -11,6 +13,7 @@ The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane). </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="10000.0"> + Maximum distance this light covers. Increasing this value will make directional shadows visible from further away, at the cost of lower overall shadow detail and performance (due to more objects being included in shadow rendering). </member> </members> </class> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 113987bb52..0039301bf6 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1638,8 +1638,9 @@ Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. </constant> <constant name="WINDOW_MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="WindowMode"> - Exclusive full screen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to [constant WINDOW_MODE_FULLSCREEN]. - Only one window in exclusive full screen mode can be visible on a given screen at a time. If multiple windows are in exclusive full screen mode for the same screen, the last one being set to this mode takes precedence. + Exclusive full screen window mode. This mode is implemented on Windows and macOS only. On other platforms, it is equivalent to [constant WINDOW_MODE_FULLSCREEN]. + [b]On Windows:[/b] Only one window in exclusive full screen mode can be visible on a given screen at a time. If multiple windows are in exclusive full screen mode for the same screen, the last one being set to this mode takes precedence. + [b]On macOS:[/b] Exclusive full-screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. </constant> <constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags"> @@ -1725,9 +1726,17 @@ </constant> <constant name="WINDOW_VIEW" value="2" enum="HandleType"> Window view: + - Windows: [code]HDC[/code] for the window (only with the GL Compatibility renderer). - macOS: [code]NSView*[/code] for the window main view. - iOS: [code]UIView*[/code] for the window main view. </constant> + <constant name="OPENGL_CONTEXT" value="3" enum="HandleType"> + OpenGL context (only with the GL Compatibility renderer): + - Windows: [code]HGLRC[/code] for the window. + - Linux: [code]GLXContext*[/code] for the window. + - MacOS: [code]NSOpenGLContext*[/code] for the window. + - Android: [code]EGLContext[/code] for the window. + </constant> <constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent"> Utterance has begun to be spoken. </constant> diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml index c3e0a995c6..10da1edd56 100644 --- a/doc/classes/EditorDebuggerPlugin.xml +++ b/doc/classes/EditorDebuggerPlugin.xml @@ -1,88 +1,88 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorDebuggerPlugin" inherits="Control" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="EditorDebuggerPlugin" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A base class to implement debugger plugins. </brief_description> <description> [EditorDebuggerPlugin] provides functions related to the editor side of the debugger. - You don't need to instantiate this class; that is automatically handled by the debugger. [Control] nodes can be added as child nodes to provide a GUI for the plugin. - Do not free or reparent this node, otherwise it becomes unusable. - To use [EditorDebuggerPlugin], register it using the [method EditorPlugin.add_debugger_plugin] method first. + To interact with the debugger, an instance of this class must be added to the editor via [method EditorPlugin.add_debugger_plugin]. + Once added, the [method _setup_session] callback will be called for every [EditorDebuggerSession] available to the plugin, and when new ones are created (the sessions may be inactive during this stage). + You can retrieve the available [EditorDebuggerSession]s via [method get_sessions] or get a specific one via [method get_session]. + [codeblocks] + [gdscript] + @tool + extends EditorPlugin + + class ExampleEditorDebugger extends EditorDebuggerPlugin: + + func _has_capture(prefix): + # Return true if you wish to handle message with this prefix. + return prefix == "my_plugin" + + func _capture(message, data, session_id): + if message == "my_plugin:ping": + get_session(session_id).send_message("my_plugin:echo", data) + + func _setup_session(session_id): + # Add a new tab in the debugger session UI containing a label. + var label = Label.new() + label.name = "Example plugin" + label.text = "Example plugin" + var session = get_session(session_id) + # Listens to the session started and stopped signals. + session.started.connect(func (): print("Session started")) + session.stopped.connect(func (): print("Session stopped")) + session.add_session_tab(label) + + var debugger = ExampleEditorDebugger.new() + + func _enter_tree(): + add_debugger_plugin(debugger) + + func _exit_tree(): + remove_debugger_plugin(debugger) + [/gdscript] + [/codeblocks] </description> <tutorials> </tutorials> <methods> - <method name="has_capture"> - <return type="bool" /> - <param index="0" name="name" type="StringName" /> - <description> - Returns [code]true[/code] if a message capture with given name is present otherwise [code]false[/code]. - </description> - </method> - <method name="is_breaked"> - <return type="bool" /> - <description> - Returns [code]true[/code] if the game is in break state otherwise [code]false[/code]. - </description> - </method> - <method name="is_debuggable"> + <method name="_capture" qualifiers="virtual"> <return type="bool" /> + <param index="0" name="message" type="String" /> + <param index="1" name="data" type="Array" /> + <param index="2" name="session_id" type="int" /> <description> - Returns [code]true[/code] if the game can be debugged otherwise [code]false[/code]. + Override this method to process incoming messages. The [param session_id] is the ID of the [EditorDebuggerSession] that received the message (which you can retrieve via [method get_session]). </description> </method> - <method name="is_session_active"> + <method name="_has_capture" qualifiers="virtual const"> <return type="bool" /> + <param index="0" name="capture" type="String" /> <description> - Returns [code]true[/code] if there is an instance of the game running with the attached debugger otherwise [code]false[/code]. + Override this method to enable receiving messages from the debugger. If [param capture] is "my_message" then messages starting with "my_message:" will be passes to the [method _capture] method. </description> </method> - <method name="register_message_capture"> + <method name="_setup_session" qualifiers="virtual"> <return type="void" /> - <param index="0" name="name" type="StringName" /> - <param index="1" name="callable" type="Callable" /> + <param index="0" name="session_id" type="int" /> <description> - Registers a message capture with given [param name]. If [param name] is "my_message" then messages starting with "my_message:" will be called with the given callable. - Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code]. + Override this method to be notified whenever a new [EditorDebuggerSession] is created (the session may be inactive during this stage). </description> </method> - <method name="send_message"> - <return type="void" /> - <param index="0" name="message" type="String" /> - <param index="1" name="data" type="Array" /> + <method name="get_session"> + <return type="EditorDebuggerSession" /> + <param index="0" name="id" type="int" /> <description> - Sends a message with given [param message] and [param data] array. + Returns the [EditorDebuggerSession] with the given [param id]. </description> </method> - <method name="unregister_message_capture"> - <return type="void" /> - <param index="0" name="name" type="StringName" /> + <method name="get_sessions"> + <return type="Array" /> <description> - Unregisters the message capture with given name. + Returns an array of [EditorDebuggerSession] currently available to this debugger plugin. + Note: Not sessions in the array may be inactive, check their state via [method EditorDebuggerSession.is_active] </description> </method> </methods> - <signals> - <signal name="breaked"> - <param index="0" name="can_debug" type="bool" /> - <description> - Emitted when the game enters a break state. - </description> - </signal> - <signal name="continued"> - <description> - Emitted when the game exists a break state. - </description> - </signal> - <signal name="started"> - <description> - Emitted when the debugging starts. - </description> - </signal> - <signal name="stopped"> - <description> - Emitted when the debugging stops. - </description> - </signal> - </signals> </class> diff --git a/doc/classes/EditorDebuggerSession.xml b/doc/classes/EditorDebuggerSession.xml new file mode 100644 index 0000000000..faf528c143 --- /dev/null +++ b/doc/classes/EditorDebuggerSession.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EditorDebuggerSession" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A class to interact with the editor debugger. + </brief_description> + <description> + This class cannot be directly instantiated and must be retrieved via a [EditorDebuggerPlugin]. + You can add tabs to the session UI via [method add_session_tab], send messages via [method send_message], and toggle [EngineProfiler]s via [method toggle_profiler]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_session_tab"> + <return type="void" /> + <param index="0" name="control" type="Control" /> + <description> + Adds the given [param control] to the debug session UI in the debugger bottom panel. + </description> + </method> + <method name="is_active"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the debug session is currently attached to a remote instance. + </description> + </method> + <method name="is_breaked"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the attached remote instance is currently in the debug loop. + </description> + </method> + <method name="is_debuggable"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the attached remote instance can be debugged. + </description> + </method> + <method name="remove_session_tab"> + <return type="void" /> + <param index="0" name="control" type="Control" /> + <description> + Removes the given [param control] from the debug session UI in the debugger bottom panel. + </description> + </method> + <method name="send_message"> + <return type="void" /> + <param index="0" name="message" type="String" /> + <param index="1" name="data" type="Array" default="[]" /> + <description> + Sends the given [param message] to the attached remote instance, optionally passing additionally [param data]. See [EngineDebugger] for how to retrieve those messages. + </description> + </method> + <method name="toggle_profiler"> + <return type="void" /> + <param index="0" name="profiler" type="String" /> + <param index="1" name="enable" type="bool" /> + <param index="2" name="data" type="Array" default="[]" /> + <description> + Toggle the given [param profiler] on the attached remote instance, optionally passing additionally [param data]. See [EngineProfiler] for more details. + </description> + </method> + </methods> + <signals> + <signal name="breaked"> + <param index="0" name="can_debug" type="bool" /> + <description> + Emitted when the attached remote instance enters a break state. If [param can_debug] is [code]true[/code], the remote instance will enter the debug loop. + </description> + </signal> + <signal name="continued"> + <description> + Emitted when the attached remote instance exits a break state. + </description> + </signal> + <signal name="started"> + <description> + Emitted when a remote instance is attached to this session (i.e. the session becomes active). + </description> + </signal> + <signal name="stopped"> + <description> + Emitted when a remote instance is detached from this session (i.e. the session becomes inactive). + </description> + </signal> + </signals> +</class> diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml index 99e97fc25f..27f61f1bd8 100644 --- a/doc/classes/EditorFeatureProfile.xml +++ b/doc/classes/EditorFeatureProfile.xml @@ -116,7 +116,10 @@ <constant name="FEATURE_IMPORT_DOCK" value="6" enum="Feature"> The Import dock. If this feature is disabled, the Import dock won't be visible. </constant> - <constant name="FEATURE_MAX" value="7" enum="Feature"> + <constant name="FEATURE_HISTORY_DOCK" value="7" enum="Feature"> + The History dock. If this feature is disabled, the History dock won't be visible. + </constant> + <constant name="FEATURE_MAX" value="8" enum="Feature"> Represents the size of the [enum Feature] enum. </constant> </constants> diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index bb319cb5a3..5d4b83bc27 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -48,6 +48,12 @@ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> + <method name="get_current_directory" qualifiers="const"> + <return type="String" /> + <description> + Returns the current directory being viewed in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead. + </description> + </method> <method name="get_current_path" qualifiers="const"> <return type="String" /> <description> @@ -131,10 +137,10 @@ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> - <method name="get_selected_path" qualifiers="const"> - <return type="String" /> + <method name="get_selected_paths" qualifiers="const"> + <return type="PackedStringArray" /> <description> - Returns the path of the directory currently selected in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead. + Returns an array containing the paths of the currently selected files (and directories) in the [FileSystemDock]. </description> </method> <method name="get_selection"> diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index 24e1a2da7c..3ab13ec5c0 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -8,7 +8,7 @@ To use [EditorNode3DGizmoPlugin], register it using the [method EditorPlugin.add_node_3d_gizmo_plugin] method first. </description> <tutorials> - <link title="Node3D gizmo plugins">$DOCS_URL/tutorials/plugins/editor/spatial_gizmos.html</link> + <link title="Node3D gizmo plugins">$DOCS_URL/tutorials/plugins/editor/3d_gizmos.html</link> </tutorials> <methods> <method name="_can_be_hidden" qualifiers="virtual const"> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 2289a373bf..adcc87d062 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -415,7 +415,7 @@ </method> <method name="add_debugger_plugin"> <return type="void" /> - <param index="0" name="script" type="Script" /> + <param index="0" name="script" type="EditorDebuggerPlugin" /> <description> Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. </description> @@ -599,7 +599,7 @@ </method> <method name="remove_debugger_plugin"> <return type="void" /> - <param index="0" name="script" type="Script" /> + <param index="0" name="script" type="EditorDebuggerPlugin" /> <description> Removes the debugger plugin with given script from the Debugger. </description> @@ -719,44 +719,64 @@ </signals> <constants> <constant name="CONTAINER_TOOLBAR" value="0" enum="CustomControlContainer"> + Main editor toolbar, next to play buttons. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_MENU" value="1" enum="CustomControlContainer"> + The toolbar that appears when 3D editor is active. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_SIDE_LEFT" value="2" enum="CustomControlContainer"> + Left sidebar of the 3D editor. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT" value="3" enum="CustomControlContainer"> + Right sidebar of the 3D editor. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_BOTTOM" value="4" enum="CustomControlContainer"> + Bottom panel of the 3D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_MENU" value="5" enum="CustomControlContainer"> + The toolbar that appears when 2D editor is active. </constant> <constant name="CONTAINER_CANVAS_EDITOR_SIDE_LEFT" value="6" enum="CustomControlContainer"> + Left sidebar of the 2D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_SIDE_RIGHT" value="7" enum="CustomControlContainer"> + Right sidebar of the 2D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_BOTTOM" value="8" enum="CustomControlContainer"> + Bottom panel of the 2D editor. </constant> <constant name="CONTAINER_INSPECTOR_BOTTOM" value="9" enum="CustomControlContainer"> + Bottom section of the inspector. </constant> <constant name="CONTAINER_PROJECT_SETTING_TAB_LEFT" value="10" enum="CustomControlContainer"> + Tab of Project Settings dialog, to the left of other tabs. </constant> <constant name="CONTAINER_PROJECT_SETTING_TAB_RIGHT" value="11" enum="CustomControlContainer"> + Tab of Project Settings dialog, to the right of other tabs. </constant> <constant name="DOCK_SLOT_LEFT_UL" value="0" enum="DockSlot"> + Dock slot, left side, upper-left (empty in default layout). </constant> <constant name="DOCK_SLOT_LEFT_BL" value="1" enum="DockSlot"> + Dock slot, left side, bottom-left (empty in default layout). </constant> <constant name="DOCK_SLOT_LEFT_UR" value="2" enum="DockSlot"> + Dock slot, left side, upper-right (in default layout includes Scene and Import docks). </constant> <constant name="DOCK_SLOT_LEFT_BR" value="3" enum="DockSlot"> + Dock slot, left side, bottom-right (in default layout includes FileSystem dock). </constant> <constant name="DOCK_SLOT_RIGHT_UL" value="4" enum="DockSlot"> + Dock slot, right side, upper-left (empty in default layout). </constant> <constant name="DOCK_SLOT_RIGHT_BL" value="5" enum="DockSlot"> + Dock slot, right side, bottom-left (empty in default layout). </constant> <constant name="DOCK_SLOT_RIGHT_UR" value="6" enum="DockSlot"> + Dock slot, right side, upper-right (in default layout includes Inspector, Node and History docks). </constant> <constant name="DOCK_SLOT_RIGHT_BR" value="7" enum="DockSlot"> + Dock slot, right side, bottom-right (empty in default layout). </constant> <constant name="DOCK_SLOT_MAX" value="8" enum="DockSlot"> Represents the size of the [enum DockSlot] enum. diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 2aca19510b..e18bea1f67 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -150,7 +150,7 @@ <param index="1" name="pinned" type="bool" /> <description> Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value. - The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instancing chain, a script or a builtin class. + The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class. </description> </signal> <signal name="resource_selected"> diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 784a3c1214..de105b32e1 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -22,6 +22,8 @@ <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false"> If [code]true[/code], the slider can't be interacted with. </member> + <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="1" /> + <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" /> <member name="suffix" type="String" setter="set_suffix" getter="get_suffix" default=""""> The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed. </member> diff --git a/doc/classes/EditorUndoRedoManager.xml b/doc/classes/EditorUndoRedoManager.xml index c1e771d653..133ee9db0d 100644 --- a/doc/classes/EditorUndoRedoManager.xml +++ b/doc/classes/EditorUndoRedoManager.xml @@ -110,7 +110,7 @@ <signals> <signal name="history_changed"> <description> - Emitted when the list of actions in any history has changed, either when an action is commited or a history is cleared. + Emitted when the list of actions in any history has changed, either when an action is committed or a history is cleared. </description> </signal> <signal name="version_changed"> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 821fae37a6..d583e07f59 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -275,13 +275,16 @@ If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Disabled[/code], limiting the FPS to a high value that can be consistently reached on the system can reduce input lag compared to an uncapped framerate. Since this works by ensuring the GPU load is lower than 100%, this latency reduction is only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked scenarios. See also [member physics_ticks_per_second] and [member ProjectSettings.application/run/max_fps]. </member> + <member name="max_physics_steps_per_frame" type="int" setter="set_max_physics_steps_per_frame" getter="get_max_physics_steps_per_frame" default="8"> + Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value. + </member> <member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5"> Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics_jitter_fix] to [code]0[/code]. </member> <member name="physics_ticks_per_second" type="int" setter="set_physics_ticks_per_second" getter="get_physics_ticks_per_second" default="60"> The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to [code]60[/code] or above, as Godot doesn't interpolate the physics step. As a result, values lower than [code]60[/code] will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also [member max_fps] and [member ProjectSettings.physics/common/physics_ticks_per_second]. - [b]Note:[/b] Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended not to increase [member physics_ticks_per_second] above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. + [b]Note:[/b] Only [member max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended to also increase [member max_physics_steps_per_frame] if increasing [member physics_ticks_per_second] significantly above its default value. </member> <member name="print_error_messages" type="bool" setter="set_print_error_messages" getter="is_printing_error_messages" default="true"> If [code]false[/code], stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [member ProjectSettings.application/run/disable_stderr] project setting. diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml index 5578f449b3..00f5c7ddff 100644 --- a/doc/classes/FileSystemDock.xml +++ b/doc/classes/FileSystemDock.xml @@ -46,7 +46,7 @@ <description> </description> </signal> - <signal name="instance"> + <signal name="instantiate"> <param index="0" name="files" type="PackedStringArray" /> <description> </description> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index 4916171900..c7d10078e8 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -89,12 +89,17 @@ Particle texture. If [code]null[/code], particles will be squares. </member> <member name="trail_enabled" type="bool" setter="set_trail_enabled" getter="is_trail_enabled" default="false"> + If [code]true[/code], enables particle trails using a mesh skinning system. + [b]Note:[/b] Unlike [GPUParticles3D], the number of trail sections and subdivisions is set with the [member trail_sections] and [member trail_section_subdivisions] properties. </member> - <member name="trail_length_secs" type="float" setter="set_trail_length" getter="get_trail_length" default="0.3"> + <member name="trail_lifetime" type="float" setter="set_trail_lifetime" getter="get_trail_lifetime" default="0.3"> + The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is [code]true[/code]. </member> <member name="trail_section_subdivisions" type="int" setter="set_trail_section_subdivisions" getter="get_trail_section_subdivisions" default="4"> + The number of subdivisions to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_sections]. Only effective if [member trail_enabled] is [code]true[/code]. </member> <member name="trail_sections" type="int" setter="set_trail_sections" getter="get_trail_sections" default="8"> + The number of sections to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_section_subdivisions]. Only effective if [member trail_enabled] is [code]true[/code]. </member> <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" default="Rect2(-100, -100, 200, 200)"> The [Rect2] that determines the node's region which needs to be visible on screen for the particle system to be active. diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index d0be4d784a..ea53c5b4b5 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -116,8 +116,12 @@ <member name="sub_emitter" type="NodePath" setter="set_sub_emitter" getter="get_sub_emitter" default="NodePath("")"> </member> <member name="trail_enabled" type="bool" setter="set_trail_enabled" getter="is_trail_enabled" default="false"> + If [code]true[/code], enables particle trails using a mesh skinning system. Designed to work with [RibbonTrailMesh] and [TubeTrailMesh]. + [b]Note:[/b] [member BaseMaterial3D.use_particle_trails] must also be enabled on the particle mesh's material. Otherwise, setting [member trail_enabled] to [code]true[/code] will have no effect. + [b]Note:[/b] Unlike [GPUParticles2D], the number of trail sections and subdivisions is set in the [RibbonTrailMesh] or the [TubeTrailMesh]'s properties. </member> - <member name="trail_length_secs" type="float" setter="set_trail_length" getter="get_trail_length" default="0.3"> + <member name="trail_lifetime" type="float" setter="set_trail_lifetime" getter="get_trail_lifetime" default="0.3"> + The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is [code]true[/code]. </member> <member name="transform_align" type="int" setter="set_transform_align" getter="get_transform_align" enum="GPUParticles3D.TransformAlign" default="0"> </member> diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index 86d52ae9be..90a983d28b 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -13,6 +13,7 @@ <return type="Variant" /> <param index="0" name="name" type="StringName" /> <description> + Get the value of a shader parameter as set on this instance. </description> </method> <method name="set_custom_aabb"> @@ -27,6 +28,7 @@ <param index="0" name="name" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> + Set the value of a shader parameter for this instance only. </description> </method> </methods> @@ -45,8 +47,11 @@ [b]Note:[/b] Lights' bake mode will also affect the global illumination rendering. See [member Light3D.light_bake_mode]. </member> <member name="ignore_occlusion_culling" type="bool" setter="set_ignore_occlusion_culling" getter="is_ignoring_occlusion_culling" default="false"> + If [code]true[/code], disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use. </member> <member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias" default="1.0"> + Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances. + Useful for testing level of detail transitions in the editor. </member> <member name="material_overlay" type="Material" setter="set_material_overlay" getter="get_material_overlay"> The material overlay for the whole geometry. diff --git a/doc/classes/GradientTexture1D.xml b/doc/classes/GradientTexture1D.xml index 3254754ac1..fa572eeed0 100644 --- a/doc/classes/GradientTexture1D.xml +++ b/doc/classes/GradientTexture1D.xml @@ -12,6 +12,7 @@ <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient"> The [Gradient] that will be used to fill the texture. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false"> If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format). </member> diff --git a/doc/classes/GradientTexture2D.xml b/doc/classes/GradientTexture2D.xml index 7561f1b947..87d86e7a59 100644 --- a/doc/classes/GradientTexture2D.xml +++ b/doc/classes/GradientTexture2D.xml @@ -27,6 +27,7 @@ <member name="repeat" type="int" setter="set_repeat" getter="get_repeat" enum="GradientTexture2D.Repeat" default="0"> The gradient repeat type, one of the [enum Repeat] values. The texture is filled starting from [member fill_from] to [member fill_to] offsets by default, but the gradient fill can be repeated to cover the entire texture. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false"> If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format). </member> diff --git a/doc/classes/HSlider.xml b/doc/classes/HSlider.xml index cb0a8b34db..19bb26a1b0 100644 --- a/doc/classes/HSlider.xml +++ b/doc/classes/HSlider.xml @@ -29,6 +29,7 @@ The background of the area to the left of the grabber. </theme_item> <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> + The background of the area to the left of the grabber that displays when it's being hovered or focused. </theme_item> <theme_item name="slider" data_type="style" type="StyleBox"> The background for the whole slider. Determines the height of the [code]grabber_area[/code]. diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index bbd633819b..be66b8a7b9 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -118,7 +118,7 @@ <param index="2" name="use_mipmaps" type="bool" /> <param index="3" name="format" type="int" enum="Image.Format" /> <description> - Creates an empty image of given size and format. See [enum Format] constants. If [param use_mipmaps] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps]. + Creates an empty image of given size and format. See [enum Format] constants. If [param use_mipmaps] is [code]true[/code], then generate mipmaps for this image. See the [method generate_mipmaps]. </description> </method> <method name="create_from_data" qualifiers="static"> diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index 45cbd7ac87..03d1947475 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -67,4 +67,7 @@ </description> </method> </methods> + <members> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> + </members> </class> diff --git a/doc/classes/ImageTexture3D.xml b/doc/classes/ImageTexture3D.xml index 958c5f90f1..ee26a959aa 100644 --- a/doc/classes/ImageTexture3D.xml +++ b/doc/classes/ImageTexture3D.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ImageTexture3D" inherits="Texture3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Texture with 3 dimensions. </brief_description> <description> + [ImageTexture3D] is a 3-dimensional [ImageTexture] that has a width, height, and depth. See also [ImageTextureLayered]. + 3D textures are typically used to store density maps for [FogMaterial], color correction LUTs for [Environment], vector fields for [GPUParticlesAttractorVectorField3D] and collision maps for [GPUParticlesCollisionSDF3D]. 3D textures can also be used in custom shaders. </description> <tutorials> </tutorials> @@ -16,12 +19,14 @@ <param index="4" name="use_mipmaps" type="bool" /> <param index="5" name="data" type="Image[]" /> <description> + Creates the [ImageTexture3D] with specified [param width], [param height], and [param depth]. See [enum Image.Format] for [param format] options. If [param use_mipmaps] is [code]true[/code], then generate mipmaps for the [ImageTexture3D]. </description> </method> <method name="update"> <return type="void" /> <param index="0" name="data" type="Image[]" /> <description> + Replaces the texture's existing data with the layers specified in [code]data[/code]. The size of [code]data[/code] must match the parameters that were used for [method create]. In other words, the texture cannot be resized or have its format changed by calling [method update]. </description> </method> </methods> diff --git a/doc/classes/ImageTextureLayered.xml b/doc/classes/ImageTextureLayered.xml index f5786f070a..0aa1d65d5a 100644 --- a/doc/classes/ImageTextureLayered.xml +++ b/doc/classes/ImageTextureLayered.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ImageTextureLayered" inherits="TextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Base class for texture types which contain the data of multiple [ImageTexture]s. Each image is of the same size and format. </brief_description> <description> + Base class for [Texture2DArray], [Cubemap] and [CubemapArray]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [Texture3D]. </description> <tutorials> </tutorials> @@ -11,7 +13,7 @@ <return type="int" enum="Error" /> <param index="0" name="images" type="Image[]" /> <description> - Creates an [ImageTextureLayered] from an array of [Image]s. The first image decides the width, height, image format and mipmapping setting. The other images must have the same width, height, image format and mipmapping setting. + Creates an [ImageTextureLayered] from an array of [Image]s. See [method Image.create] for the expected data format. The first image decides the width, height, image format and mipmapping setting. The other images [i]must[/i] have the same width, height, image format and mipmapping setting. Each [Image] represents one [code]layer[/code]. </description> </method> @@ -23,7 +25,7 @@ Replaces the existing [Image] data at the given [code]layer[/code] with this new image. The given [Image] must have the same width, height, image format and mipmapping setting (a [code]bool[/code] value) as the rest of the referenced images. If the image format is unsupported, it will be decompressed and converted to a similar and supported [enum Image.Format]. - The update is immediate: synced with the draw. + The update is immediate: it's synchronized with drawing. </description> </method> </methods> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 615aceac53..cd87b4558f 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -50,6 +50,7 @@ Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. </member> <member name="label_settings" type="LabelSettings" setter="set_label_settings" getter="get_label_settings"> + A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority over theme properties. </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -100,7 +101,7 @@ Default text [Color] of the [Label]. </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The tint of text outline. + The color of text outline. </theme_item> <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. diff --git a/doc/classes/LabelSettings.xml b/doc/classes/LabelSettings.xml index aa972f2cf3..d73cb78295 100644 --- a/doc/classes/LabelSettings.xml +++ b/doc/classes/LabelSettings.xml @@ -1,29 +1,40 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="LabelSettings" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Collection of common settings to customize label text. </brief_description> <description> + [LabelSettings] is a resource that can be assigned to a [Label] node to customize it. It will take priority over the properties defined in theme. The resource can be shared between multiple labels and swapped on the fly, so it's convenient and flexible way to setup text style. </description> <tutorials> </tutorials> <members> <member name="font" type="Font" setter="set_font" getter="get_font"> + [Font] used for the text. </member> <member name="font_color" type="Color" setter="set_font_color" getter="get_font_color" default="Color(1, 1, 1, 1)"> + Color of the text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> + Size of the text. </member> <member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="3.0"> + Vertical space between lines when the text is multiline. </member> <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color(1, 1, 1, 1)"> + The color of the outline. </member> <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0"> + Text outline size. </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 0)"> + Color of the shadow effect. If alpha is [code]0[/code], no shadow will be drawn. </member> <member name="shadow_offset" type="Vector2" setter="set_shadow_offset" getter="get_shadow_offset" default="Vector2(1, 1)"> + Offset of the shadow effect, in pixels. </member> <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" default="1"> + Size of the shadow effect. </member> </members> </class> diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml index 8e2bccc79f..d09fa4c898 100644 --- a/doc/classes/MeshTexture.xml +++ b/doc/classes/MeshTexture.xml @@ -18,5 +18,6 @@ <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Sets the mesh used to draw. It must be a mesh using 2D vertices. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> </members> </class> diff --git a/doc/classes/MissingNode.xml b/doc/classes/MissingNode.xml index b5aa02cfd6..ac54329313 100644 --- a/doc/classes/MissingNode.xml +++ b/doc/classes/MissingNode.xml @@ -4,7 +4,7 @@ This is an internal editor class intended for keeping data of nodes of unknown type. </brief_description> <description> - This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can´t be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. </description> <tutorials> </tutorials> diff --git a/doc/classes/MissingResource.xml b/doc/classes/MissingResource.xml index eede6350d8..e5a6c4d064 100644 --- a/doc/classes/MissingResource.xml +++ b/doc/classes/MissingResource.xml @@ -4,7 +4,7 @@ This is an internal editor class intended for keeping data of resources of unknown type. </brief_description> <description> - This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can´t be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. </description> <tutorials> </tutorials> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index b83bff5d5e..21fb9d139c 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -606,7 +606,7 @@ <return type="void" /> <param index="0" name="group" type="StringName" /> <description> - Removes a node from a group. See notes in the description, and the group methods in [SceneTree]. + Removes a node from the [param group]. Does nothing if the node is not in the [param group]. See notes in the description, and the group methods in [SceneTree]. </description> </method> <method name="replace_by"> @@ -991,7 +991,7 @@ <constant name="DUPLICATE_SCRIPTS" value="4" enum="DuplicateFlags"> Duplicate the node's scripts. </constant> - <constant name="DUPLICATE_USE_INSTANCING" value="8" enum="DuplicateFlags"> + <constant name="DUPLICATE_USE_INSTANTIATION" value="8" enum="DuplicateFlags"> Duplicate using instancing. An instance stays linked to the original so when the original changes, the instance changes too. </constant> diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 022b4826ea..c82ed5f143 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -187,12 +187,14 @@ <return type="bool" /> <param index="0" name="right" type="NodePath" /> <description> + Returns [code]true[/code] if two node paths are not equal. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="NodePath" /> <description> + Returns [code]true[/code] if two node paths are equal, i.e. all node names in the path are the same and in the same order. </description> </operator> </operators> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index f4a5288481..ea9b83d2aa 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -467,7 +467,7 @@ <return type="bool" /> <param index="0" name="tag_name" type="String" /> <description> - Returns [code]true[/code] if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build, etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [url=$DOCS_URL/getting_started/workflow/export/feature_tags.html]Feature Tags[/url] documentation for more details. + Returns [code]true[/code] if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build, etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [url=$DOCS_URL/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details. [b]Note:[/b] Tag names are case-sensitive. </description> </method> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 318f2cfade..bf15f96291 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -1,33 +1,27 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Base class for all non-built-in types. + Base class for all other classes in the engine. </brief_description> <description> - Every class which is not a built-in type inherits from this class. - You can construct Objects from scripting languages, using [code]Object.new()[/code] in GDScript, or [code]new Object[/code] in C#. - Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++. - Some classes that extend Object add memory management. This is the case of [RefCounted], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory. - Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them. - Property membership can be tested directly in GDScript using [code]in[/code]: - [codeblocks] - [gdscript] - var n = Node2D.new() - print("position" in n) # Prints "true". - print("other_property" in n) # Prints "false". - [/gdscript] - [csharp] - var node = new Node2D(); - // C# has no direct equivalent to GDScript's `in` operator here, but we - // can achieve the same behavior by performing `Get` with a null check. - GD.Print(node.Get("position") != null); // Prints "true". - GD.Print(node.Get("other_property") != null); // Prints "false". - [/csharp] - [/codeblocks] - The [code]in[/code] operator will evaluate to [code]true[/code] as long as the key exists, even if the value is [code]null[/code]. - Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. - [b]Note:[/b] Unlike references to a [RefCounted], references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use [RefCounted] for data classes instead of [Object]. - [b]Note:[/b] The [code]script[/code] property is not exposed like most properties, but it does have a setter and getter ([code]set_script()[/code] and [code]get_script()[/code]). + An advanced [Variant] type. All classes in the engine inherit from Object. Each class may define new properties, methods or signals, which are available to all inheriting classes. For example, a [Sprite2D] instance is able to call [method Node.add_child] because it inherits from [Node]. + You can create new instances, using [code]Object.new()[/code] in GDScript, or [code]new Object[/code] in C#. + To delete an Object instance, call [method free]. This is necessary for most classes inheriting Object, because they do not manage memory on their own, and will otherwise cause memory leaks when no longer in use. There are a few classes that perform memory management. For example, [RefCounted] (and by extension [Resource]) deletes itself when no longer referenced, and [Node] deletes its children when freed. + Objects can have a [Script] attached to them. Once the [Script] is instantiated, it effectively acts as an extension to the base class, allowing it to define and inherit new properties, methods and signals. + Inside a [Script], [method _get_property_list] may be overriden to customize properties in several ways. This allows them to be available to the editor, display as lists of options, sub-divide into groups, save on disk, etc. Scripting languages offer easier ways to customize properties, such as with the [annotation @GDScript.@export] annotation. + Godot is very dynamic. An object's script, and therefore its properties, methods and signals, can be changed at run-time. Because of this, there can be occasions where, for example, a property required by a method may not exist. To prevent run-time errors, see methods such as [method set], [method get], [method call], [method has_method], [method has_signal], etc. Note that these methods are [b]much[/b] slower than direct references. + In GDScript, you can also check if a given property, method, or signal name exists in an object with the [code]in[/code] operator: + [codeblock] + var node = Node.new() + print("name" in node) # Prints true + print("get_parent" in node) # Prints true + print("tree_entered" in node) # Prints true + print("unknown" in node) # Prints false + [/codeblock] + Notifications are [int] constants commonly sent and received by objects. For example, on every rendered frame, the [SceneTree] notifies nodes inside the tree with a [constant Node.NOTIFICATION_PROCESS]. The nodes receive it and may call [method Node._process] to update. To make use of notifications, see [method notification] and [method _notification]. + Lastly, every object can also contain metadata (data about data). [method set_meta] can be useful to store information that the object itself does not depend on. To keep your code clean, making excessive use of metadata is discouraged. + [b]Note:[/b] Unlike references to a [RefCounted], references to an object stored in a variable can become invalid without being set to [code]null[/code]. To check if an object has been deleted, do [i]not[/i] compare it against [code]null[/code]. Instead, use [method @GlobalScope.is_instance_valid]. It's also recommended to inherit from [RefCounted] for classes storing data instead of [Object]. + [b]Note:[/b] The [code]script[/code] is not exposed like most properties. To set or get an object's [Script] in code, use [method set_script] and [method get_script], respectively. </description> <tutorials> <link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link> @@ -38,46 +32,174 @@ <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> - Virtual method which can be overridden to customize the return value of [method get]. - Returns the given property. Returns [code]null[/code] if the [param property] does not exist. + Override this method to customize the behavior of [method get]. Should return the given [param property]'s value, or [code]null[/code] if the [param property] should be handled normally. + Combined with [method _set] and [method _get_property_list], this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property must be present in [method get_property_list], otherwise this method will not be called. + [codeblocks] + [gdscript] + func _get(property): + if (property == "fake_property"): + print("Getting my property!") + return 4 + + func _get_property_list(): + return [ + { "name": "fake_property", "type": TYPE_INT } + ] + [/gdscript] + [csharp] + public override Variant _Get(StringName property) + { + if (property == "FakeProperty") + { + GD.Print("Getting my property!"); + return 4; + } + return default; + } + + public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList() + { + return new Godot.Collections.Array<Godot.Collections.Dictionary>() + { + new Godot.Collections.Dictionary() + { + { "name", "FakeProperty" }, + { "type", (int)Variant.Type.Int } + } + }; + } + [/csharp] + [/codeblocks] </description> </method> <method name="_get_property_list" qualifiers="virtual"> <return type="Dictionary[]" /> <description> - Virtual method which can be overridden to customize the return value of [method get_property_list]. - Returns the object's property list as an [Array] of dictionaries. - Each property's [Dictionary] must contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum PropertyUsageFlags]). + Override this method to customize how script properties should be handled by the engine. + Should return a property list, as an [Array] of dictionaries. The result is added to the array of [method get_property_list], and should be formatted in the same way. Each [Dictionary] must at least contain the [code]name[/code] and [code]type[/code] entries. + The example below displays [code]hammer_type[/code] in the Inspector dock, only if [code]holding_hammer[/code] is [code]true[/code]: + [codeblocks] + [gdscript] + @tool + extends Node2D + + @export var holding_hammer = false: + set(value): + holding_hammer = value + notify_property_list_changed() + var hammer_type = 0 + + func _get_property_list(): + # By default, `hammer_type` is not visible in the editor. + var property_usage = PROPERTY_USAGE_NO_EDITOR + + if holding_hammer: + property_usage = PROPERTY_USAGE_DEFAULT + + var properties = [] + properties.append({ + "name": "hammer_type", + "type": TYPE_INT, + "usage": property_usage, # See above assignment. + "hint": PROPERTY_HINT_ENUM, + "hint_string": "Wooden,Iron,Golden,Enchanted" + }) + + return properties + [/gdscript] + [csharp] + [Tool] + public class MyNode2D : Node2D + { + private bool _holdingHammer; + + [Export] + public bool HoldingHammer + { + get => _holdingHammer; + set + { + _holdingHammer = value; + NotifyPropertyListChanged(); + } + } + + public int HammerType { get; set; } + + public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList() + { + // By default, `HammerType` is not visible in the editor. + var propertyUsage = PropertyUsageFlags.NoEditor; + + if (HoldingHammer) + { + propertyUsage = PropertyUsageFlags.Default; + } + + var properties = new Godot.Collections.Array<Godot.Collections.Dictionary>(); + properties.Add(new Godot.Collections.Dictionary() + { + { "name", "HammerType" }, + { "type", (int)Variant.Type.Int }, + { "usage", (int)propertyUsage }, // See above assignment. + { "hint", (int)PropertyHint.Enum }, + { "hint_string", "Wooden,Iron,Golden,Enchanted" } + }); + + return properties; + } + } + [/csharp] + [/codeblocks] + [b]Note:[/b] This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See [annotation @GDScript.@export], [annotation @GDScript.@export_enum], [annotation @GDScript.@export_group], etc. + [b]Note:[/b] If the object's script is not [annotation @GDScript.@tool], this method will not be called in the editor. </description> </method> <method name="_init" qualifiers="virtual"> <return type="void" /> <description> - Called when the object is initialized in memory. Can be defined to take in parameters, that are passed in when constructing. - [b]Note:[/b] If [method _init] is defined with required parameters, then explicit construction is the only valid means of creating an Object of the class. If any other means (such as [method PackedScene.instantiate]) is used, then initialization will fail. + Called when the object's script is instantiated, oftentimes after the object is initialized in memory (through [code]Object.new()[/code] in GDScript, or [code]new Object[/code] in C#). It can be also defined to take in parameters. This method is similar to a constructor in most programming languages. + [b]Note:[/b] If [method _init] is defined with [i]required[/i] parameters, the Object with script may only be created directly. If any other means (such as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the script's initialization will fail. </description> </method> <method name="_notification" qualifiers="virtual"> <return type="void" /> <param index="0" name="what" type="int" /> <description> - Called whenever the object receives a notification, which is identified in [param what] by a constant. The base [Object] has two constants [constant NOTIFICATION_POSTINITIALIZE] and [constant NOTIFICATION_PREDELETE], but subclasses such as [Node] define a lot more notifications which are also received by this method. + Called when the object receives a notification, which can be identified in [param what] by comparing it with a constant. See also [method notification]. + [codeblocks] + [gdscript] + func _notification(what): + if what == NOTIFICATION_PREDELETE: + print("Goodbye!") + [/gdscript] + [csharp] + public override void _Notification(long what) + { + if (what == NotificationPredelete) + { + GD.Print("Goodbye!"); + } + } + [/csharp] + [/codeblocks] + [b]Note:[/b] The base [Object] defines a few notifications ([constant NOTIFICATION_POSTINITIALIZE] and [constant NOTIFICATION_PREDELETE]). Inheriting classes such as [Node] define a lot more notifications, which are also received by this method. </description> </method> <method name="_property_can_revert" qualifiers="virtual"> <return type="bool" /> <param index="0" name="property" type="StringName" /> <description> - Virtual methods that can be overridden to customize the property revert behavior in the editor. - Returns [code]true[/code] if the property identified by [code]name[/code] can be reverted to a default value. Override [method _property_get_revert] to return the actual value. + Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] can be reverted in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. + [b]Note:[/b] This method must return consistently, regardless of the current value of the [param property]. </description> </method> <method name="_property_get_revert" qualifiers="virtual"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> - Virtual methods that can be overridden to customize the property revert behavior in the editor. - Returns the default value of the property identified by [code]name[/code]. [method _property_can_revert] must be overridden as well for this method to be called. + Override this method to customize the given [param property]'s revert behavior. Should return the default value for the [param property]. If the default value differs from the [param property]'s current value, a revert icon is displayed in the Inspector dock. + [b]Note:[/b] [method _property_can_revert] must also be overridden for this method to be called. </description> </method> <method name="_set" qualifiers="virtual"> @@ -85,15 +207,58 @@ <param index="0" name="property" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> - Virtual method which can be overridden to customize the return value of [method set]. - Sets a property. Returns [code]true[/code] if the [param property] exists. + Override this method to customize the behavior of [method set]. Should set the [param property] to [param value] and return [code]true[/code], or [code]false[/code] if the [param property] should be handled normally. The [i]exact[/i] way to set the [param property] is up to this method's implementation. + Combined with [method _get] and [method _get_property_list], this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property [i]must[/i] be present in [method get_property_list], otherwise this method will not be called. + [codeblocks] + [gdscript] + func _set(property, value): + if (property == "fake_property"): + print("Setting my property to ", value) + + func _get_property_list(): + return [ + { "name": "fake_property", "type": TYPE_INT } + ] + [/gdscript] + [csharp] + public override void _Set(StringName property, Variant value) + { + if (property == "FakeProperty") + { + GD.Print($"Setting my property to {value}"); + return true; + } + + return false; + } + + public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList() + { + return new Godot.Collections.Array<Godot.Collections.Dictionary>() + { + new Godot.Collections.Dictionary() + { + { "name", "FakeProperty" }, + { "type", (int)Variant.Type.Int } + } + }; + } + [/csharp] + [/codeblocks] </description> </method> <method name="_to_string" qualifiers="virtual"> <return type="String" /> <description> - Virtual method which can be overridden to customize the return value of [method to_string], and thus the object's representation where it is converted to a string, e.g. with [code]print(obj)[/code]. - Returns a [String] representing the object. If not overridden, defaults to [code]"[ClassName:RID]"[/code]. + Override this method to customize the return value of [method to_string], and therefore the object's representation as a [String]. + [codeblock] + func _to_string(): + return "Welcome to Godot 4!" + + func _init(): + print(self) # Prints Welcome to Godot 4!" + var a = str(self) # a is "Welcome to Godot 4!" + [/codeblock] </description> </method> <method name="add_user_signal"> @@ -101,15 +266,37 @@ <param index="0" name="signal" type="String" /> <param index="1" name="arguments" type="Array" default="[]" /> <description> - Adds a user-defined [param signal]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. + 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]. + [codeblocks] + [gdscript] + add_user_signal("hurt", [ + { "name": "damage", "type": TYPE_INT }, + { "name": "source", "type": TYPE_OBJECT } + ]) + [/gdscript] + [csharp] + AddUserSignal("Hurt", new Godot.Collections.Array() + { + new Godot.Collections.Dictionary() + { + { "name", "damage" }, + { "type", (int)Variant.Type.Int } + }, + new Godot.Collections.Dictionary() + { + { "name", "source" }, + { "type", (int)Variant.Type.Object } + } + }); + [/csharp] + [/codeblocks] </description> </method> <method name="call" qualifiers="vararg"> <return type="Variant" /> <param index="0" name="method" type="StringName" /> <description> - Calls the [param method] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. - [b]Example:[/b] + Calls the [param method] on the object and returns the result. This method supports a variable number of arguments, so parameters can be passed as a comma separated list. [codeblocks] [gdscript] var node = Node3D.new() @@ -120,15 +307,14 @@ node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] - [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). + [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="call_deferred" qualifiers="vararg"> <return type="Variant" /> <param index="0" name="method" type="StringName" /> <description> - Calls the [param method] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. - [b]Example:[/b] + Calls the [param method] on the object during idle time. This method supports a variable number of arguments, so parameters can be passed as a comma separated list. [codeblocks] [gdscript] var node = Node3D.new() @@ -139,7 +325,7 @@ node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] - [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). + [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="callv"> @@ -147,7 +333,7 @@ <param index="0" name="method" type="StringName" /> <param index="1" name="arg_array" type="Array" /> <description> - Calls the [param method] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array]. + Calls the [param method] on the object and returns the result. Unlike [method call], this method expects all parameters to be contained inside [param arg_array]. [codeblocks] [gdscript] var node = Node3D.new() @@ -158,12 +344,13 @@ node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f }); [/csharp] [/codeblocks] + [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call </description> </method> <method name="can_translate_messages" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the object can translate strings. See [method set_message_translation] and [method tr]. + Returns [code]true[/code] if the object is allowed to translate messages with [method tr] and [method tr_n]. See also [method set_message_translation]. </description> </method> <method name="connect"> @@ -172,23 +359,23 @@ <param index="1" name="callable" type="Callable" /> <param index="2" name="flags" type="int" default="0" /> <description> - Connects a [param signal] to a [param callable]. Use [param flags] to set deferred or one-shot connections. See [enum ConnectFlags] constants. - A signal can only be connected once to a [Callable]. It will print an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. - If the callable's target is destroyed in the game's lifecycle, the connection will be lost. + Connects a [param signal] by name to a [param callable]. Optional [param flags] can be also added to configure the connection's behavior (see [enum ConnectFlags] constants). + A signal can only be connected once to the same [Callable]. If the signal is already connected, this method returns [constant ERR_INVALID_PARAMETER] and pushes an error message, unless the signal is connected with [constant CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first to check for existing connections. + If the [param callable]'s object is freed, the connection will be lost. [b]Examples with recommended syntax:[/b] - Connecting signals is one of the most common operations in Godot and the API gives many options to do so, which are described further down. The code block below shows the recommended approach for both GDScript and C#. + Connecting signals is one of the most common operations in Godot and the API gives many options to do so, which are described further down. The code block below shows the recommended approach. [codeblocks] [gdscript] func _ready(): var button = Button.new() - # `button_down` here is a Signal object, and we thus call the Signal.connect() method, - # not Object.connect(). See discussion below for a more in-depth overview of the API. + # `button_down` here is a Signal variant type, and we thus call the Signal.connect() method, not Object.connect(). + # See discussion below for a more in-depth overview of the API. button.button_down.connect(_on_button_down) - # This assumes that a `Player` class exists which defines a `hit` signal. + # This assumes that a `Player` class exists, which defines a `hit` signal. var player = Player.new() - # We use Signal.connect() again, and we also use the Callable.bind() method which - # returns a new Callable with the parameter binds. + # We use Signal.connect() again, and we also use the Callable.bind() method, + # which returns a new Callable with the parameter binds. player.hit.connect(_on_player_hit.bind("sword", 100)) func _on_button_down(): @@ -204,7 +391,7 @@ // C# supports passing signals as events, so we can use this idiomatic construct: button.ButtonDown += OnButtonDown; - // This assumes that a `Player` class exists which defines a `Hit` signal. + // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); // Signals as events (`player.Hit += OnPlayerHit;`) do not support argument binding. You have to use: player.Hit.Connect(OnPlayerHit, new Godot.Collections.Array {"sword", 100 }); @@ -261,44 +448,41 @@ } [/csharp] [/codeblocks] - 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]), option 3 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 undefined. On the other hand, option 2 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]Parameter bindings and passing:[/b] - For legacy or language-specific reasons, there are also several ways to bind parameters to signals. One can pass a [code]binds[/code] [Array] to [method Object.connect] or [method Signal.connect], or use the recommended [method Callable.bind] method to create a new callable from an existing one, with the given parameter binds. - One can also pass additional parameters when emitting the signal with [method emit_signal]. The examples below show the relationship between those two types of parameters. + 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. [codeblocks] [gdscript] func _ready(): - # This assumes that a `Player` class exists which defines a `hit` signal. + # This assumes that a `Player` class exists, which defines a `hit` signal. var player = Player.new() - # Option 1: Using Callable.bind(). player.hit.connect(_on_player_hit.bind("sword", 100)) - # Option 2: Using a `binds` Array in Signal.connect() (same syntax for Object.connect()). - player.hit.connect(_on_player_hit, ["sword", 100]) # Parameters added when emitting the signal are passed first. player.emit_signal("hit", "Dark lord", 5) - # Four arguments, since we pass two when emitting (hit_by, level) - # and two when connecting (weapon_type, damage). + # We pass two arguments when emitting (`hit_by`, `level`), + # and bind two more arguments when connecting (`weapon_type`, `damage`). func _on_player_hit(hit_by, level, weapon_type, damage): print("Hit by %s (level %d) with weapon %s for %d damage." % [hit_by, level, weapon_type, damage]) [/gdscript] [csharp] public override void _Ready() { - // This assumes that a `Player` class exists which defines a `Hit` signal. + // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); // Option 1: Using Callable.Bind(). This way we can still use signals as events. player.Hit += OnPlayerHit.Bind("sword", 100); - // Option 2: Using a `binds` Array in Signal.Connect() (same syntax for Object.Connect()). + // Option 2: Using a `binds` Array in Signal.Connect(). player.Hit.Connect(OnPlayerHit, new Godot.Collections.Array{ "sword", 100 }); // Parameters added when emitting the signal are passed first. player.EmitSignal("hit", "Dark lord", 5); } - // Four arguments, since we pass two when emitting (hitBy, level) - // and two when connecting (weaponType, damage). + // We pass two arguments when emitting (`hit_by`, `level`), + // and bind two more arguments when connecting (`weapon_type`, `damage`). private void OnPlayerHit(string hitBy, int level, string weaponType, int damage) { GD.Print(String.Format("Hit by {0} (level {1}) with weapon {2} for {3} damage.", hitBy, level, weaponType, damage)); @@ -312,57 +496,68 @@ <param index="0" name="signal" type="StringName" /> <param index="1" name="callable" type="Callable" /> <description> - Disconnects a [param signal] from a given [param callable]. - If you try to disconnect a connection that does not exist, the method will print an error. Use [method is_connected] to ensure that the connection exists. + Disconnects a [param signal] by name from a given [param callable]. If the connection does not exist, generates an error. Use [method is_connected] to make sure that the connection exists. </description> </method> <method name="emit_signal" qualifiers="vararg"> <return type="int" enum="Error" /> <param index="0" name="signal" type="StringName" /> <description> - Emits the given [param signal]. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. - [b]Example:[/b] + Emits the given [param signal] by name. The signal must exist, so it should be a built-in signal of this class or one of its inherited classes, or a user-defined signal (see [method add_user_signal]). This method supports a variable number of arguments, so parameters can be passed as a comma separated list. + Returns [constant ERR_UNAVAILABLE] if [param signal] does not exist or the parameters are invalid. [codeblocks] [gdscript] emit_signal("hit", "sword", 100) emit_signal("game_over") [/gdscript] [csharp] - EmitSignal("hit", "sword", 100); - EmitSignal("game_over"); + EmitSignal("Hit", "sword", 100); + EmitSignal("GameOver"); [/csharp] [/codeblocks] + [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="free"> <return type="void" /> <description> - Deletes the object from memory. Any pre-existing reference to the freed object will become invalid, e.g. [code]is_instance_valid(object)[/code] will return [code]false[/code]. + Deletes the object from memory. Pre-existing references to the object become invalid, and any attempt to access them will result in a run-time error. Checking the references with [method @GlobalScope.is_instance_valid] will return [code]false[/code]. </description> </method> <method name="get" qualifiers="const"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> - Returns the [Variant] value of the given [param property]. If the [param property] doesn't exist, this will return [code]null[/code]. - [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + Returns the [Variant] value of the given [param property]. If the [param property] does not exist, this method returns [code]null[/code]. + [codeblocks] + [gdscript] + var node = Node2D.new() + node.rotation = 1.5 + var a = node.get("rotation") # a is 1.5 + [/gdscript] + [csharp] + var node = new Node2D(); + node.Rotation = 1.5f; + var a = node.Get("rotation"); // a is 1.5 + [/csharp] + [/codeblocks] + [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="get_class" qualifiers="const"> <return type="String" /> <description> - Returns the object's class as a [String]. See also [method is_class]. - [b]Note:[/b] [method get_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, the base class name will be returned instead. + Returns the object's built-in class name, as a [String]. See also [method is_class]. + [b]Note:[/b] This method ignores [code]class_name[/code] declarations. If this object's script has defined a [code]class_name[/code], the base, built-in class name is returned instead. </description> </method> <method name="get_incoming_connections" qualifiers="const"> <return type="Dictionary[]" /> <description> - Returns an [Array] of dictionaries with information about signals that are connected to the object. - Each [Dictionary] contains three String entries: - - [code]source[/code] is a reference to the signal emitter. - - [code]signal_name[/code] is the name of the connected signal. - - [code]method_name[/code] is the name of the method to which the signal is connected. + Returns an [Array] of signal connections received by this object. Each connection is represented as a [Dictionary] that contains three entries: + - [code]signal[/code] is a reference to the [Signal]; + - [code]callable[/code] is a reference to the [Callable]; + - [code]flags[/code] is a combination of [enum ConnectFlags]. </description> </method> <method name="get_indexed" qualifiers="const"> @@ -371,14 +566,28 @@ <description> Gets the object's property indexed by the given [param property_path]. The path should be a [NodePath] relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. [b]Examples:[/b] [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code]. - [b]Note:[/b] Even though the method takes [NodePath] argument, it doesn't support actual paths to [Node]s in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use [method Node.get_node_and_resource] instead. + [codeblocks] + [gdscript] + var node = Node2D.new() + node.position = Vector2(5, -10) + var a = node.get_indexed("position") # a is Vector2(5, -10) + var b = node.get_indexed("position:y") # b is -10 + [/gdscript] + [csharp] + var node = new Node2D(); + node.Position = new Vector2(5, -10); + var a = node.GetIndexed("position"); // a is Vector2(5, -10) + var b = node.GetIndexed("position:y"); // b is -10 + [/csharp] + [/codeblocks] + [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. + [b]Note:[/b] This method does not support actual paths to nodes in the [SceneTree], only sub-property paths. In the context of nodes, use [method Node.get_node_and_resource] instead. </description> </method> <method name="get_instance_id" qualifiers="const"> <return type="int" /> <description> - Returns the object's unique instance ID. - This ID can be saved in [EncodedObjectAsID], and can be used to retrieve the object instance with [method @GlobalScope.instance_from_id]. + Returns the object's unique instance ID. This ID can be saved in [EncodedObjectAsID], and can be used to retrieve this object instance with [method @GlobalScope.instance_from_id]. </description> </method> <method name="get_meta" qualifiers="const"> @@ -386,47 +595,62 @@ <param index="0" name="name" type="StringName" /> <param index="1" name="default" type="Variant" default="null" /> <description> - Returns the object's metadata entry for the given [param name]. - Throws error if the entry does not exist, unless [param default] is not [code]null[/code] (in which case the default value will be returned). See also [method has_meta], [method set_meta] and [method remove_meta]. - [b]Note:[/b] Metadata that has a [param 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. + Returns the object's metadata value for the given entry [param name]. If the entry does not exist, returns [param default]. If [param default] is [code]null[/code], an error is also generated. + [b]Note:[/b] Metadata that has a [param name] starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector dock and should not be edited. </description> </method> <method name="get_meta_list" qualifiers="const"> <return type="PackedStringArray" /> <description> - Returns the object's metadata as a [PackedStringArray]. + Returns the object's metadata entry names as a [PackedStringArray]. </description> </method> <method name="get_method_list" qualifiers="const"> <return type="Dictionary[]" /> <description> - Returns the object's methods and their signatures as an [Array]. + Returns this object's methods and their signatures as an [Array] of dictionaries. Each [Dictionary] contains the following entries: + - [code]name[/code] is the name of the method, as a [String]; + - [code]args[/code] is an [Array] of dictionaries representing the arguments; + - [code]default_args[/code] is the default arguments as an [Array] of variants; + - [code]flags[/code] is a combination of [enum MethodFlags]; + - [code]id[/code] is the method's internal identifier [int]; + - [code]return[/code] is the returned value, as a [Dictionary]; + [b]Note:[/b] The dictionaries of [code]args[/code] and [code]return[/code] are formatted identically to the results of [method get_property_list], although not all entries are used. </description> </method> <method name="get_property_list" qualifiers="const"> <return type="Dictionary[]" /> <description> - Returns the object's property list as an [Array] of dictionaries. - Each property's [Dictionary] contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum PropertyUsageFlags]). + Returns the object's property list as an [Array] of dictionaries. Each [Dictionary] contains the following entries: + - [code]name[/code] is the property's name, as a [String]; + - [code]class_name[/code] is an empty [StringName], unless the property is [constant TYPE_OBJECT] and it inherits from a class; + - [code]type[/code] is the property's type, as an [int] (see [enum Variant.Type]); + - [code]hint[/code] is [i]how[/i] the property is meant to be edited (see [enum PropertyHint]); + - [code]hint_string[/code] depends on the hint (see [enum PropertyHint]); + - [code]usage[/code] is a combination of [enum PropertyUsageFlags]. </description> </method> <method name="get_script" qualifiers="const"> <return type="Variant" /> <description> - Returns the object's [Script] instance, or [code]null[/code] if none is assigned. + Returns the object's [Script] instance, or [code]null[/code] if no script is attached. </description> </method> <method name="get_signal_connection_list" qualifiers="const"> <return type="Dictionary[]" /> <param index="0" name="signal" type="StringName" /> <description> - Returns an [Array] of connections for the given [param signal]. + Returns an [Array] of connections for the given [param signal] name. Each connection is represented as a [Dictionary] that contains three entries: + - [code]signal[/code] is a reference to the [Signal]; + - [code]callable[/code] is a reference to the [Callable]; + - [code]flags[/code] is a combination of [enum ConnectFlags]. </description> </method> <method name="get_signal_list" qualifiers="const"> <return type="Dictionary[]" /> <description> - Returns the list of signals as an [Array] of dictionaries. + Returns the list of existing signals as an [Array] of dictionaries. + [b]Note:[/b] Due of the implementation, each [Dictionary] is formatted very similarly to the returned values of [method get_method_list]. </description> </method> <method name="has_meta" qualifiers="const"> @@ -434,34 +658,36 @@ <param index="0" name="name" type="StringName" /> <description> Returns [code]true[/code] if a metadata entry is found with the given [param name]. See also [method get_meta], [method set_meta] and [method remove_meta]. - [b]Note:[/b] Metadata that has a [param 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. + [b]Note:[/b] Metadata that has a [param 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="has_method" qualifiers="const"> <return type="bool" /> <param index="0" name="method" type="StringName" /> <description> - Returns [code]true[/code] if the object contains the given [param method]. + Returns [code]true[/code] if the the given [param method] name exists in the object. + [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="has_signal" qualifiers="const"> <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> - Returns [code]true[/code] if the given [param signal] exists. + Returns [code]true[/code] if the given [param signal] name exists in the object. + [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="has_user_signal" qualifiers="const"> <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> - Returns [code]true[/code] if the given user-defined [param signal] exists. Only signals added using [method add_user_signal] are taken into account. + Returns [code]true[/code] if the given user-defined [param signal] name exists. Only signals added with [method add_user_signal] are included. </description> </method> <method name="is_blocking_signals" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if signal emission blocking is enabled. + Returns [code]true[/code] if the object is blocking its signals from being emitted. See [method set_block_signals]. </description> </method> <method name="is_class" qualifiers="const"> @@ -469,7 +695,21 @@ <param index="0" name="class" type="String" /> <description> Returns [code]true[/code] if the object inherits from the given [param class]. See also [method get_class]. - [b]Note:[/b] [method is_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, [method is_class] will return [code]false[/code] for that name. + [codeblocks] + [gdscript] + var sprite2d = Sprite2D.new() + sprite2d.is_class("Sprite2D") # Returns true + sprite2d.is_class("Node") # Returns true + sprite2d.is_class("Node3D") # Returns false + [/gdscript] + [csharp] + var sprite2d = new Sprite2D(); + sprite2d.IsClass("Sprite2D"); // Returns true + sprite2d.IsClass("Node"); // Returns true + sprite2d.IsClass("Node3D"); // Returns false + [/csharp] + [/codeblocks] + [b]Note:[/b] This method ignores [code]class_name[/code] declarations in the object's script. </description> </method> <method name="is_connected" qualifiers="const"> @@ -477,7 +717,8 @@ <param index="0" name="signal" type="StringName" /> <param index="1" name="callable" type="Callable" /> <description> - Returns [code]true[/code] if a connection exists for a given [param signal] and [param callable]. + Returns [code]true[/code] if a connection exists between the given [param signal] name and [param callable]. + [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="is_queued_for_deletion" qualifiers="const"> @@ -491,21 +732,43 @@ <param index="0" name="what" type="int" /> <param index="1" name="reversed" type="bool" default="false" /> <description> - Send a given notification to the object, which will also trigger a call to the [method _notification] method of all classes that the object inherits from. - If [param reversed] is [code]true[/code], [method _notification] is called first on the object's own class, and then up to its successive parent classes. If [param reversed] is [code]false[/code], [method _notification] is called first on the highest ancestor ([Object] itself), and then down to its successive inheriting classes. + Sends the given [param what] notification to all classes inherited by the object, triggering calls to [method _notification], starting from the highest ancestor (the [Object] class) and going down to the object's script. + If [param reversed] is [code]true[/code], the call order is reversed. + [codeblocks] + [gdscript] + var player = Node2D.new() + player.set_script(load("res://player.gd")) + + player.notification(NOTIFICATION_ENTER_TREE) + # The call order is Object -> Node -> Node2D -> player.gd. + + player.notification(NOTIFICATION_ENTER_TREE, true) + # The call order is player.gd -> Node2D -> Node -> Object. + [/gdscript] + [csharp] + var player = new Node2D(); + player.SetScript(GD.Load("res://player.gd")); + + player.Notification(NotificationEnterTree); + // The call order is Object -> Node -> Node2D -> player.gd. + + player.notification(NotificationEnterTree, true); + // The call order is player.gd -> Node2D -> Node -> Object. + [/csharp] + [/codeblocks] </description> </method> <method name="notify_property_list_changed"> <return type="void" /> <description> - Notify the editor that the property list has changed by emitting the [signal property_list_changed] signal, so that editor plugins can take the new values into account. + Emits the [signal property_list_changed] signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated. </description> </method> <method name="remove_meta"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> - Removes a given entry from the object's metadata. See also [method has_meta], [method get_meta] and [method set_meta]. + Removes the given entry [param name] from the object's metadata. See also [method has_meta], [method get_meta] and [method set_meta]. [b]Note:[/b] Metadata that has a [param 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. </description> </method> @@ -514,15 +777,27 @@ <param index="0" name="property" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> - Assigns a new value to the given property. If the [param property] does not exist or the given value's type doesn't match, nothing will happen. - [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + Assigns [param value] to the given [param property]. If the property does not exist or the given [param value]'s type doesn't match, nothing happens. + [codeblocks] + [gdscript] + var node = Node2D.new() + node.set("global_scale", Vector2(8, 2.5)) + print(node.global_scale) # Prints (8, 2.5) + [/gdscript] + [csharp] + var node = new Node2D(); + node.Set("global_scale", new Vector2(8, 2.5)); + GD.Print(node.GlobalScale); // Prints Vector2(8, 2.5) + [/csharp] + [/codeblocks] + [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="set_block_signals"> <return type="void" /> <param index="0" name="enable" type="bool" /> <description> - If set to [code]true[/code], signal emission is blocked. + If set to [code]true[/code], the object becomes unable to emit signals. As such, [method emit_signal] and signal connections will not work, until it is set to [code]false[/code]. </description> </method> <method name="set_deferred"> @@ -530,8 +805,30 @@ <param index="0" name="property" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> - Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", property, value)[/code]. - [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + Assigns [param value] to the given [param property], after the current frame's physics step. This is equivalent to calling [method set] through [method call_deferred]. + [codeblocks] + [gdscript] + var node = Node2D.new() + add_child(node) + + node.rotation = 45.0 + node.set_deferred("rotation", 90.0) + print(node.rotation) # Prints 45.0 + + await get_tree().process_frame + print(node.rotation) # Prints 90.0 + [/gdscript] + [csharp] + var node = new Node2D(); + node.Rotation = 45f; + node.SetDeferred("rotation", 90f); + GD.Print(node.Rotation); // Prints 45.0 + + await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame); + GD.Print(node.Rotation); // Prints 90.0 + [/csharp] + [/codeblocks] + [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="set_indexed"> @@ -539,29 +836,29 @@ <param index="0" name="property_path" type="NodePath" /> <param index="1" name="value" type="Variant" /> <description> - Assigns a new value to the property identified by the [param property_path]. The path should be a [NodePath] relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. - [b]Example:[/b] + Assigns a new [param value] to the property identified by the [param property_path]. The path should be a [NodePath] relative to this object, and can use the colon character ([code]:[/code]) to access nested properties. [codeblocks] [gdscript] var node = Node2D.new() node.set_indexed("position", Vector2(42, 0)) node.set_indexed("position:y", -10) - print(node.position) # (42, -10) + print(node.position) # Prints (42, -10) [/gdscript] [csharp] var node = new Node2D(); node.SetIndexed("position", new Vector2(42, 0)); node.SetIndexed("position:y", -10); - GD.Print(node.Position); // (42, -10) + GD.Print(node.Position); // Prints (42, -10) [/csharp] [/codeblocks] + [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. </description> </method> <method name="set_message_translation"> <return type="void" /> <param index="0" name="enable" type="bool" /> <description> - Defines whether the object can translate strings (with calls to [method tr]). Enabled by default. + If set to [code]true[/code], allows the object to translate messages with [method tr] and [method tr_n]. Enabled by default. See also [method can_translate_messages]. </description> </method> <method name="set_meta"> @@ -569,24 +866,23 @@ <param index="0" name="name" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> - Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any [Variant] value. - To remove a given entry from the object's metadata, use [method remove_meta]. Metadata is also removed if its value is set to [code]null[/code]. This means you can also use [code]set_meta("name", null)[/code] to remove metadata for [code]"name"[/code]. See also [method has_meta] and [method get_meta]. - [b]Note:[/b] Metadata that has a [param 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. + Adds or changes the entry [param name] inside the object's metadata. The metadata [param value] can be any [Variant], although some types cannot be serialised correctly. + If [param value] is [code]null[/code], the entry is removed. This is the equivalent of using [method remove_meta]. See also [method has_meta] and [method get_meta]. + [b]Note:[/b] Metadata that has a [param name] starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector dock and should not be edited. </description> </method> <method name="set_script"> <return type="void" /> <param index="0" name="script" type="Variant" /> <description> - Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. - If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's [method _init] method will be called. + Attaches [param script] to the object, and instantiates it. As a result, the script's [method _init] is called. A [Script] is used to extend the object's functionality. + If a script already exists, its instance is detached, and its property values and state are lost. Built-in property values are still kept. </description> </method> <method name="to_string"> <return type="String" /> <description> - Returns a [String] representing the object. If not overridden, defaults to [code]"[ClassName:RID]"[/code]. - Override the method [method _to_string] to customize the [String] representation. + Returns a [String] representing the object. Defaults to [code]"<ClassName#RID>"[/code]. Override [method _to_string] to customize the string representation of the object. </description> </method> <method name="tr" qualifiers="const"> @@ -594,9 +890,9 @@ <param index="0" name="message" type="StringName" /> <param index="1" name="context" type="StringName" default="""" /> <description> - Translates a message using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context. - Only works if message translation is enabled (which it is by default), otherwise it returns the [param message] unchanged. See [method set_message_translation]. - See [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url] for examples of the usage of this method. + Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. + If [method can_translate_messages] is [code]false[/code], or no translation is available, this method returns the [param message] without changes. See [method set_message_translation]. + For detailed examples, see [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. </description> </method> <method name="tr_n" qualifiers="const"> @@ -606,43 +902,45 @@ <param index="2" name="n" type="int" /> <param index="3" name="context" type="StringName" default="""" /> <description> - Translates a message involving plurals using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context. - Only works if message translation is enabled (which it is by default), otherwise it returns the [param message] or [param plural_message] unchanged. See [method set_message_translation]. - The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. - [b]Note:[/b] Negative and floating-point values usually represent physical entities for which singular and plural don't clearly apply. In such cases, use [method tr]. - See [url=$DOCS_URL/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url] for examples of the usage of this method. + Translates a [param message] or [param plural_message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. + If [method can_translate_messages] is [code]false[/code], or no translation is available, this method returns [param message] or [param plural_message], without changes. See [method set_message_translation]. + 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 handling these cases with [method tr]. </description> </method> </methods> <signals> <signal name="property_list_changed"> <description> + Emitted when [method notify_property_list_changed] is called. </description> </signal> <signal name="script_changed"> <description> - Emitted whenever the object's script is changed. + Emitted when the object's script is changed. + [b]Note:[/b] When this signal is emitted, the new script is not initialized yet. If you need to access the new script, defer connections to this signal with [constant CONNECT_DEFERRED]. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_POSTINITIALIZE" value="0"> - Called right when the object is initialized. Not available in script. + Notification received when the object is initialized, before its script is attached. Used internally. </constant> <constant name="NOTIFICATION_PREDELETE" value="1"> - Called before the object is about to be deleted. + Notification received when the object is about to be deleted. Can act as the deconstructor of some programming languages. </constant> <constant name="CONNECT_DEFERRED" value="1" enum="ConnectFlags"> - Connects a signal in deferred mode. This way, signal emissions are stored in a queue, then set on idle time. + Deferred connections trigger their [Callable]s on idle time, rather than instantly. </constant> <constant name="CONNECT_PERSIST" value="2" enum="ConnectFlags"> - Persisting connections are saved when the object is serialized to file. + Persisting connections are stored when the object is serialized (such as when using [method PackedScene.pack]). In the editor, connections created through the Node dock are always persisting. </constant> <constant name="CONNECT_ONE_SHOT" value="4" enum="ConnectFlags"> One-shot connections disconnect themselves after emission. </constant> <constant name="CONNECT_REFERENCE_COUNTED" value="8" enum="ConnectFlags"> - Connect a signal as reference-counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left. + Reference-counted connections can be assigned to the same [Callable] multiple times. Each disconnection decreases the internal counter. The signal fully disconnects only when the counter reaches 0. </constant> </constants> </class> diff --git a/doc/classes/OfflineMultiplayerPeer.xml b/doc/classes/OfflineMultiplayerPeer.xml new file mode 100644 index 0000000000..5e15992d54 --- /dev/null +++ b/doc/classes/OfflineMultiplayerPeer.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="OfflineMultiplayerPeer" inherits="MultiplayerPeer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A [MultiplayerPeer] which is always connected and acts as a server. + </brief_description> + <description> + This is the default [member MultiplayerAPI.multiplayer_peer] for the [member Node.multiplayer]. It mimics the behavior of a server with no peers connected. + This means that the [SceneTree] will act as the multiplayer authority by default. Calls to [method MultiplayerAPI.is_server] will return [code]true[/code], and calls to [method MultiplayerAPI.get_unique_id] will return [constant MultiplayerPeer.TARGET_PEER_SERVER]. + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/PathFollow3D.xml b/doc/classes/PathFollow3D.xml index ba7207be8f..fa7580b7b6 100644 --- a/doc/classes/PathFollow3D.xml +++ b/doc/classes/PathFollow3D.xml @@ -9,6 +9,16 @@ </description> <tutorials> </tutorials> + <methods> + <method name="correct_posture" qualifiers="static"> + <return type="Transform3D" /> + <param index="0" name="transform" type="Transform3D" /> + <param index="1" name="rotation_mode" type="int" enum="PathFollow3D.RotationMode" /> + <description> + Correct the [code]transform[/code]. [code]rotation_mode[/code] implicitly specifies how posture (forward, up and sideway direction) is caculated. + </description> + </method> + </methods> <members> <member name="cubic_interp" type="bool" setter="set_cubic_interpolation" getter="get_cubic_interpolation" default="true"> If [code]true[/code], the position between two cached points is interpolated cubically, and linearly otherwise. @@ -30,6 +40,9 @@ <member name="rotation_mode" type="int" setter="set_rotation_mode" getter="get_rotation_mode" enum="PathFollow3D.RotationMode" default="3"> Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. </member> + <member name="tilt_enabled" type="bool" setter="set_tilt_enabled" getter="is_tilt_enabled" default="true"> + If [code]true[/code], the tilt property of [Curve3D] takes effect. + </member> <member name="v_offset" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The node's offset perpendicular to the curve. </member> diff --git a/doc/classes/PhysicalSkyMaterial.xml b/doc/classes/PhysicalSkyMaterial.xml index 9d303d80e5..a8cfb9abc2 100644 --- a/doc/classes/PhysicalSkyMaterial.xml +++ b/doc/classes/PhysicalSkyMaterial.xml @@ -12,27 +12,28 @@ </tutorials> <members> <member name="energy_multiplier" type="float" setter="set_energy_multiplier" getter="get_energy_multiplier" default="1.0"> + The sky's overall brightness multiplier. Higher values result in a brighter sky. </member> <member name="ground_color" type="Color" setter="set_ground_color" getter="get_ground_color" default="Color(0.1, 0.07, 0.034, 1)"> Modulates the [Color] on the bottom half of the sky to represent the ground. </member> <member name="mie_coefficient" type="float" setter="set_mie_coefficient" getter="get_mie_coefficient" default="0.005"> - Controls the strength of mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, mie scattering results in a whitish color around the sun and horizon. + Controls the strength of [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon. </member> <member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color(0.69, 0.729, 0.812, 1)"> - Controls the [Color] of the mie scattering effect. While not physically accurate, this allows for the creation of alien-looking planets. + Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] effect. While not physically accurate, this allows for the creation of alien-looking planets. </member> <member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8"> - Controls the direction of the mie scattering. A value of [code]1[/code] means that when light hits a particle it's passing through straight forward. A value of [code]-1[/code] means that all light is scatter backwards. + Controls the direction of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url]. A value of [code]1[/code] means that when light hits a particle it's passing through straight forward. A value of [code]-1[/code] means that all light is scatter backwards. </member> <member name="night_sky" type="Texture2D" setter="set_night_sky" getter="get_night_sky"> [Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day. </member> <member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0"> - Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. + Controls the strength of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. </member> <member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color(0.3, 0.405, 0.6, 1)"> - Controls the [Color] of the Rayleigh scattering. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a corresponding blue sunset. + Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a corresponding blue sunset. </member> <member name="sun_disk_scale" type="float" setter="set_sun_disk_scale" getter="get_sun_disk_scale" default="1.0"> Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth. diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index 59660b4de5..30fa54d669 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -25,12 +25,12 @@ </method> <method name="move_and_collide"> <return type="KinematicCollision2D" /> - <param index="0" name="distance" type="Vector2" /> + <param index="0" name="motion" type="Vector2" /> <param index="1" name="test_only" type="bool" default="false" /> <param index="2" name="safe_margin" type="float" default="0.08" /> <param index="3" name="recovery_as_collision" type="bool" default="false" /> <description> - Moves the body along the vector [param distance]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. + Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using [code]delta[/code]. Returns a [KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. If [param test_only] is [code]true[/code], the body does not move but the would-be collision information is given. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). @@ -47,13 +47,13 @@ <method name="test_move"> <return type="bool" /> <param index="0" name="from" type="Transform2D" /> - <param index="1" name="distance" type="Vector2" /> + <param index="1" name="motion" type="Vector2" /> <param index="2" name="collision" type="KinematicCollision2D" default="null" /> <param index="3" name="safe_margin" type="float" default="0.08" /> <param index="4" name="recovery_as_collision" type="bool" default="false" /> <description> - Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. - Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [param distance]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. + Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using [code]delta[/code]. + Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [param motion]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. [param collision] is an optional object of type [KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would [i]touch[/i] any other bodies. diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml index bf7882a1ea..2ef54683f2 100644 --- a/doc/classes/PhysicsBody3D.xml +++ b/doc/classes/PhysicsBody3D.xml @@ -32,13 +32,13 @@ </method> <method name="move_and_collide"> <return type="KinematicCollision3D" /> - <param index="0" name="distance" type="Vector3" /> + <param index="0" name="motion" type="Vector3" /> <param index="1" name="test_only" type="bool" default="false" /> <param index="2" name="safe_margin" type="float" default="0.001" /> <param index="3" name="recovery_as_collision" type="bool" default="false" /> <param index="4" name="max_collisions" type="int" default="1" /> <description> - Moves the body along the vector [param distance]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. + Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using [code]delta[/code]. The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. If [param test_only] is [code]true[/code], the body does not move but the would-be collision information is given. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). @@ -64,14 +64,14 @@ <method name="test_move"> <return type="bool" /> <param index="0" name="from" type="Transform3D" /> - <param index="1" name="distance" type="Vector3" /> + <param index="1" name="motion" type="Vector3" /> <param index="2" name="collision" type="KinematicCollision3D" default="null" /> <param index="3" name="safe_margin" type="float" default="0.001" /> <param index="4" name="recovery_as_collision" type="bool" default="false" /> <param index="5" name="max_collisions" type="int" default="1" /> <description> - Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. - Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [param distance]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. + Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using [code]delta[/code]. + Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [param motion]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. [param collision] is an optional object of type [KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would [i]touch[/i] any other bodies. diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index 80afe3b784..eca6a1cbc7 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -76,6 +76,7 @@ <param index="0" name="torque" type="float" /> <description> Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + [b]Note:[/b] [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. </description> </method> <method name="apply_torque_impulse"> @@ -84,6 +85,7 @@ <description> Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [b]Note:[/b] [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. </description> </method> <method name="get_constant_force" qualifiers="const"> @@ -207,40 +209,40 @@ </method> </methods> <members> - <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" default="0.0"> + <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity"> The body's rotational velocity in [i]radians[/i] per second. </member> - <member name="center_of_mass" type="Vector2" setter="" getter="get_center_of_mass" default="Vector2(0, 0)"> + <member name="center_of_mass" type="Vector2" setter="" getter="get_center_of_mass"> The body's center of mass position relative to the body's center in the global coordinate system. </member> - <member name="center_of_mass_local" type="Vector2" setter="" getter="get_center_of_mass_local" default="Vector2(0, 0)"> + <member name="center_of_mass_local" type="Vector2" setter="" getter="get_center_of_mass_local"> The body's center of mass position in the body's local coordinate system. </member> - <member name="inverse_inertia" type="float" setter="" getter="get_inverse_inertia" default="0.0"> + <member name="inverse_inertia" type="float" setter="" getter="get_inverse_inertia"> The inverse of the inertia of the body. </member> - <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass" default="0.0"> + <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass"> The inverse of the mass of the body. </member> - <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> + <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity"> The body's linear velocity in pixels per second. </member> - <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping" default="false"> + <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping"> If [code]true[/code], this body is currently sleeping (not active). </member> - <member name="step" type="float" setter="" getter="get_step" default="0.0"> + <member name="step" type="float" setter="" getter="get_step"> The timestep (delta) used for the simulation. </member> - <member name="total_angular_damp" type="float" setter="" getter="get_total_angular_damp" default="0.0"> + <member name="total_angular_damp" type="float" setter="" getter="get_total_angular_damp"> The rate at which the body stops rotating, if there are not any other forces moving it. </member> - <member name="total_gravity" type="Vector2" setter="" getter="get_total_gravity" default="Vector2(0, 0)"> + <member name="total_gravity" type="Vector2" setter="" getter="get_total_gravity"> The total gravity vector being currently applied to this body. </member> - <member name="total_linear_damp" type="float" setter="" getter="get_total_linear_damp" default="0.0"> + <member name="total_linear_damp" type="float" setter="" getter="get_total_linear_damp"> The rate at which the body stops moving, if there are not any other forces moving it. </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> + <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform"> The body's transformation matrix. </member> </members> diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml index 3266c02a1e..a809384642 100644 --- a/doc/classes/PhysicsDirectBodyState3D.xml +++ b/doc/classes/PhysicsDirectBodyState3D.xml @@ -76,6 +76,7 @@ <param index="0" name="torque" type="Vector3" /> <description> Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + [b]Note:[/b] [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. </description> </method> <method name="apply_torque_impulse"> @@ -84,6 +85,7 @@ <description> Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [b]Note:[/b] [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. </description> </method> <method name="get_constant_force" qualifiers="const"> @@ -214,45 +216,45 @@ </method> </methods> <members> - <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)"> + <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity"> The body's rotational velocity in [i]radians[/i] per second. </member> - <member name="center_of_mass" type="Vector3" setter="" getter="get_center_of_mass" default="Vector3(0, 0, 0)"> + <member name="center_of_mass" type="Vector3" setter="" getter="get_center_of_mass"> The body's center of mass position relative to the body's center in the global coordinate system. </member> - <member name="center_of_mass_local" type="Vector3" setter="" getter="get_center_of_mass_local" default="Vector3(0, 0, 0)"> + <member name="center_of_mass_local" type="Vector3" setter="" getter="get_center_of_mass_local"> The body's center of mass position in the body's local coordinate system. </member> - <member name="inverse_inertia" type="Vector3" setter="" getter="get_inverse_inertia" default="Vector3(0, 0, 0)"> + <member name="inverse_inertia" type="Vector3" setter="" getter="get_inverse_inertia"> The inverse of the inertia of the body. </member> - <member name="inverse_inertia_tensor" type="Basis" setter="" getter="get_inverse_inertia_tensor" default="Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)"> + <member name="inverse_inertia_tensor" type="Basis" setter="" getter="get_inverse_inertia_tensor"> The inverse of the inertia tensor of the body. </member> - <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass" default="0.0"> + <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass"> The inverse of the mass of the body. </member> - <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> + <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity"> The body's linear velocity in units per second. </member> - <member name="principal_inertia_axes" type="Basis" setter="" getter="get_principal_inertia_axes" default="Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)"> + <member name="principal_inertia_axes" type="Basis" setter="" getter="get_principal_inertia_axes"> </member> - <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping" default="false"> + <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping"> If [code]true[/code], this body is currently sleeping (not active). </member> - <member name="step" type="float" setter="" getter="get_step" default="0.0"> + <member name="step" type="float" setter="" getter="get_step"> The timestep (delta) used for the simulation. </member> - <member name="total_angular_damp" type="float" setter="" getter="get_total_angular_damp" default="0.0"> + <member name="total_angular_damp" type="float" setter="" getter="get_total_angular_damp"> The rate at which the body stops rotating, if there are not any other forces moving it. </member> - <member name="total_gravity" type="Vector3" setter="" getter="get_total_gravity" default="Vector3(0, 0, 0)"> + <member name="total_gravity" type="Vector3" setter="" getter="get_total_gravity"> The total gravity vector being currently applied to this body. </member> - <member name="total_linear_damp" type="float" setter="" getter="get_total_linear_damp" default="0.0"> + <member name="total_linear_damp" type="float" setter="" getter="get_total_linear_damp"> The rate at which the body stops moving, if there are not any other forces moving it. </member> - <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> + <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform"> The body's transformation matrix. </member> </members> diff --git a/doc/classes/PhysicsPointQueryParameters2D.xml b/doc/classes/PhysicsPointQueryParameters2D.xml index a6cbe2d574..e49d2a9f5f 100644 --- a/doc/classes/PhysicsPointQueryParameters2D.xml +++ b/doc/classes/PhysicsPointQueryParameters2D.xml @@ -22,7 +22,7 @@ The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. </member> <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> The position being queried for, in global coordinates. diff --git a/doc/classes/PhysicsPointQueryParameters3D.xml b/doc/classes/PhysicsPointQueryParameters3D.xml index bedf05ce99..3270d3686d 100644 --- a/doc/classes/PhysicsPointQueryParameters3D.xml +++ b/doc/classes/PhysicsPointQueryParameters3D.xml @@ -18,8 +18,8 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295"> The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. </member> <member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)"> The position being queried for, in global coordinates. diff --git a/doc/classes/PhysicsRayQueryParameters2D.xml b/doc/classes/PhysicsRayQueryParameters2D.xml index d6a2662adc..cf5c31d9ec 100644 --- a/doc/classes/PhysicsRayQueryParameters2D.xml +++ b/doc/classes/PhysicsRayQueryParameters2D.xml @@ -35,7 +35,7 @@ The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. </member> <member name="from" type="Vector2" setter="set_from" getter="get_from" default="Vector2(0, 0)"> The starting point of the ray being queried for, in global coordinates. diff --git a/doc/classes/PhysicsRayQueryParameters3D.xml b/doc/classes/PhysicsRayQueryParameters3D.xml index 620aa6bf5f..4f70eedb21 100644 --- a/doc/classes/PhysicsRayQueryParameters3D.xml +++ b/doc/classes/PhysicsRayQueryParameters3D.xml @@ -14,7 +14,7 @@ <param index="0" name="from" type="Vector3" /> <param index="1" name="to" type="Vector3" /> <param index="2" name="collision_mask" type="int" default="4294967295" /> - <param index="3" name="exclude" type="Array" default="[]" /> + <param index="3" name="exclude" type="RID[]" default="[]" /> <description> Returns a new, pre-configured [PhysicsRayQueryParameters3D] object. Use it to quickly create query parameters using the most common options. [codeblock] @@ -34,8 +34,8 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295"> The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. </member> <member name="from" type="Vector3" setter="set_from" getter="get_from" default="Vector3(0, 0, 0)"> The starting point of the ray being queried for, in global coordinates. diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml index 8dcb329e7e..a73e60c6f5 100644 --- a/doc/classes/PhysicsShapeQueryParameters2D.xml +++ b/doc/classes/PhysicsShapeQueryParameters2D.xml @@ -19,7 +19,7 @@ The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The collision margin for the shape. diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml index 64100f847b..a3ff1765f9 100644 --- a/doc/classes/PhysicsShapeQueryParameters3D.xml +++ b/doc/classes/PhysicsShapeQueryParameters3D.xml @@ -18,8 +18,8 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295"> The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]"> - The list of objects or object [RID]s that will be excluded from collisions. + <member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]"> + The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The collision margin for the shape. diff --git a/doc/classes/PhysicsTestMotionParameters2D.xml b/doc/classes/PhysicsTestMotionParameters2D.xml index 5b969ea869..be5e5a3617 100644 --- a/doc/classes/PhysicsTestMotionParameters2D.xml +++ b/doc/classes/PhysicsTestMotionParameters2D.xml @@ -14,9 +14,9 @@ If set to [code]false[/code], shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. </member> <member name="exclude_bodies" type="RID[]" setter="set_exclude_bodies" getter="get_exclude_bodies" default="[]"> - Optional array of body [RID] to exclude from collision. + Optional array of body [RID] to exclude from collision. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. </member> - <member name="exclude_objects" type="Array" setter="set_exclude_objects" getter="get_exclude_objects" default="[]"> + <member name="exclude_objects" type="int[]" setter="set_exclude_objects" getter="get_exclude_objects" default="[]"> Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. </member> <member name="from" type="Transform2D" setter="set_from" getter="get_from" default="Transform2D(1, 0, 0, 1, 0, 0)"> diff --git a/doc/classes/PhysicsTestMotionParameters3D.xml b/doc/classes/PhysicsTestMotionParameters3D.xml index ea9bca6a35..be7d05691e 100644 --- a/doc/classes/PhysicsTestMotionParameters3D.xml +++ b/doc/classes/PhysicsTestMotionParameters3D.xml @@ -13,10 +13,10 @@ If set to [code]true[/code], shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. If set to [code]false[/code], shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. </member> - <member name="exclude_bodies" type="Array" setter="set_exclude_bodies" getter="get_exclude_bodies" default="[]"> - Optional array of body [RID] to exclude from collision. + <member name="exclude_bodies" type="RID[]" setter="set_exclude_bodies" getter="get_exclude_bodies" default="[]"> + Optional array of body [RID] to exclude from collision. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. </member> - <member name="exclude_objects" type="Array" setter="set_exclude_objects" getter="get_exclude_objects" default="[]"> + <member name="exclude_objects" type="int[]" setter="set_exclude_objects" getter="get_exclude_objects" default="[]"> Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. </member> <member name="from" type="Transform3D" setter="set_from" getter="get_from" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> diff --git a/doc/classes/PlaceholderCubemap.xml b/doc/classes/PlaceholderCubemap.xml index 3617c6ac2c..0892b023a2 100644 --- a/doc/classes/PlaceholderCubemap.xml +++ b/doc/classes/PlaceholderCubemap.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderCubemap" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a cubemap texture. </brief_description> <description> + This class is used when loading a project that uses a [Cubemap] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> diff --git a/doc/classes/PlaceholderCubemapArray.xml b/doc/classes/PlaceholderCubemapArray.xml index 1fcf1e7795..c7a7e9154c 100644 --- a/doc/classes/PlaceholderCubemapArray.xml +++ b/doc/classes/PlaceholderCubemapArray.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderCubemapArray" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a cubemap texture array. </brief_description> <description> + This class is used when loading a project that uses a [CubemapArray] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> diff --git a/doc/classes/PlaceholderMaterial.xml b/doc/classes/PlaceholderMaterial.xml index c66641d81c..7febdc7a07 100644 --- a/doc/classes/PlaceholderMaterial.xml +++ b/doc/classes/PlaceholderMaterial.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderMaterial" inherits="Material" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a material. </brief_description> <description> + This class is used when loading a project that uses a [Material] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> diff --git a/doc/classes/PlaceholderMesh.xml b/doc/classes/PlaceholderMesh.xml index cc688816b6..8021a57878 100644 --- a/doc/classes/PlaceholderMesh.xml +++ b/doc/classes/PlaceholderMesh.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderMesh" inherits="Mesh" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a mesh. </brief_description> <description> + This class is used when loading a project that uses a [Mesh] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> <members> <member name="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> + The smallest [AABB] enclosing this mesh in local space. </member> </members> </class> diff --git a/doc/classes/PlaceholderTexture2D.xml b/doc/classes/PlaceholderTexture2D.xml index 76e575265b..c889055e4d 100644 --- a/doc/classes/PlaceholderTexture2D.xml +++ b/doc/classes/PlaceholderTexture2D.xml @@ -1,13 +1,19 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderTexture2D" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a 2-dimensional texture. </brief_description> <description> + This class is used when loading a project that uses a [Texture2D] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> <members> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(1, 1)"> + The texture's size (in pixels). </member> </members> </class> diff --git a/doc/classes/PlaceholderTexture2DArray.xml b/doc/classes/PlaceholderTexture2DArray.xml index a502e5d334..a749e8c039 100644 --- a/doc/classes/PlaceholderTexture2DArray.xml +++ b/doc/classes/PlaceholderTexture2DArray.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderTexture2DArray" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a 2-dimensional texture array. </brief_description> <description> + This class is used when loading a project that uses a [Texture2D] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> diff --git a/doc/classes/PlaceholderTexture3D.xml b/doc/classes/PlaceholderTexture3D.xml index d31e538307..ccd3c94fc2 100644 --- a/doc/classes/PlaceholderTexture3D.xml +++ b/doc/classes/PlaceholderTexture3D.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderTexture3D" inherits="Texture3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a 3-dimensional texture. </brief_description> <description> + This class is used when loading a project that uses a [Texture3D] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> <members> <member name="size" type="Vector3i" setter="set_size" getter="get_size" default="Vector3i(1, 1, 1)"> + The texture's size (in pixels). </member> </members> </class> diff --git a/doc/classes/PlaceholderTextureLayered.xml b/doc/classes/PlaceholderTextureLayered.xml index 39af08473a..8cc6dd606a 100644 --- a/doc/classes/PlaceholderTextureLayered.xml +++ b/doc/classes/PlaceholderTextureLayered.xml @@ -1,15 +1,21 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PlaceholderTextureLayered" inherits="TextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Placeholder class for a 2-dimensional texture array. </brief_description> <description> + This class is used when loading a project that uses a [TextureLayered] subclass in 2 conditions: + - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. + - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). </description> <tutorials> </tutorials> <members> <member name="layers" type="int" setter="set_layers" getter="get_layers" default="1"> + The number of layers in the texture array. </member> <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(1, 1)"> + The size of each texture layer (in pixels). </member> </members> </class> diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index 3fcf0a9b8f..a56bf77774 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -4,7 +4,7 @@ Popup is a base window container for popup-like subwindows. </brief_description> <description> - Popup is a base window container for popup-like subwindows. It's a modal by default (see [member popup_window]) and has helpers for custom popup behavior. + Popup is a base window container for popup-like subwindows. It's a modal by default (see [member Window.popup_window]) and has helpers for custom popup behavior. </description> <tutorials> </tutorials> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 0dcb33ac4c..a69163f429 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -544,6 +544,7 @@ </signal> <signal name="menu_changed"> <description> + Emitted when any item is added, modified or removed. </description> </signal> </signals> @@ -576,8 +577,10 @@ Width of the single indentation level. </theme_item> <theme_item name="item_end_padding" data_type="constant" type="int" default="2"> + Horizontal padding to the right of the items (or left, in RTL layout). </theme_item> <theme_item name="item_start_padding" data_type="constant" type="int" default="2"> + Horizontal padding to the left of the items (or right, in RTL layout). </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. diff --git a/doc/classes/PortableCompressedTexture2D.xml b/doc/classes/PortableCompressedTexture2D.xml index a0492f2c07..693eaafad3 100644 --- a/doc/classes/PortableCompressedTexture2D.xml +++ b/doc/classes/PortableCompressedTexture2D.xml @@ -21,7 +21,7 @@ <param index="3" name="lossy_quality" type="float" default="0.8" /> <description> Initializes the compressed texture from a base image. The compression mode must be provided. - If this image will be used as a normal map, the "normal map" flag is recommended, to ensure optimum quality. + [param normal_map] is recommended to ensure optimum quality if this image will be used as a normal map. If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. </description> </method> @@ -58,6 +58,7 @@ When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved. This flag allows to keep the compressed data in memory if you intend it to persist after loading. </member> + <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> <member name="size_override" type="Vector2" setter="set_size_override" getter="get_size_override" default="Vector2(0, 0)"> Allow overriding the texture size (for 2D only). </member> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 7a411b27ac..b1c8907d8e 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -34,6 +34,9 @@ </method> </methods> <members> + <member name="add_uv2" type="bool" setter="set_add_uv2" getter="get_add_uv2" default="false"> + If set, generates UV2 UV coordinates applying a padding using the [member uv2_padding] setting. UV2 is needed for lightmapping. + </member> <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. </member> @@ -44,5 +47,8 @@ <member name="material" type="Material" setter="set_material" getter="get_material"> The current [Material] of the primitive mesh. </member> + <member name="uv2_padding" type="float" setter="set_uv2_padding" getter="get_uv2_padding" default="2.0"> + If [member add_uv2] is set, specifies the padding in pixels applied along seams of the mesh. If at generation the size of the lightmap texture can't be determined, the UVs are calculated assuming a texture size of 1024x1024. + </member> </members> </class> diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index f8c5dc0e1f..510b8d5bd1 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -15,8 +15,6 @@ <member name="show_percentage" type="bool" setter="set_show_percentage" getter="is_percentage_shown" default="true"> If [code]true[/code], the fill percentage is displayed on the bar. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> - <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="0.01" /> </members> <constants> <constant name="FILL_BEGIN_TO_END" value="0" enum="FillMode"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index fae88a401b..b6f92c2c40 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -208,7 +208,7 @@ If [code]true[/code], applies linear filtering when scaling the image (recommended for high-resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art). </member> <member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default=""""> - This user directory is used for storing persistent data ([code]user://[/code] filesystem). If left empty, [code]user://[/code] resolves to a project-specific folder in Godot's own configuration folder (see [method OS.get_user_data_dir]). If a custom directory name is defined, this name will be used instead and appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]). + This user directory is used for storing persistent data ([code]user://[/code] filesystem). If a custom directory name is defined, this name will be appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]). The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect. </member> <member name="application/config/description" type="String" setter="" getter="" default=""""> @@ -235,7 +235,8 @@ [b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings. </member> <member name="application/config/use_custom_user_dir" type="bool" setter="" getter="" default="false"> - If [code]true[/code], the project will save user data to its own user directory (see [member application/config/custom_user_dir_name]). This setting is only effective on desktop platforms. A name must be set in the [member application/config/custom_user_dir_name] setting for this to take effect. If [code]false[/code], the project will save user data to [code](OS user data directory)/Godot/app_userdata/(project name)[/code]. + If [code]true[/code], the project will save user data to its own user directory. If [member application/config/custom_user_dir_name] is empty, [code]<OS user data directory>/<project name>[/code] directory will be used. If [code]false[/code], the project will save user data to [code]<OS user data directory>/Godot/app_userdata/<project name>[/code]. + See also [url=$DOCS_URL/tutorials/io/data_paths.html#accessing-persistent-user-data-user]File paths in Godot projects[/url]. This setting is only effective on desktop platforms. </member> <member name="application/config/use_hidden_project_data_directory" type="bool" setter="" getter="" default="true"> If [code]true[/code], the project will use a hidden directory ([code].godot[/code]) for storing project-specific data (metadata, shader cache, etc.). @@ -317,11 +318,13 @@ <member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50"> Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. </member> - <member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="1.0"> - The base strength of the panning effect for all AudioStreamPlayer2D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. + <member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="0.5"> + The base strength of the panning effect for all [AudioStreamPlayer2D] nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. A value of [code]0.0[/code] disables stereo panning entirely, leaving only volume attenuation in place. A value of [code]1.0[/code] completely mutes one of the channels if the sound is located exactly to the left (or right) of the listener. + The default value of [code]0.5[/code] is tuned for headphones. When using speakers, you may find lower values to sound better as speakers have a lower stereo separation compared to headphones. </member> - <member name="audio/general/3d_panning_strength" type="float" setter="" getter="" default="1.0"> - The base strength of the panning effect for all AudioStreamPlayer3D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer3D.panning_strength]. + <member name="audio/general/3d_panning_strength" type="float" setter="" getter="" default="0.5"> + The base strength of the panning effect for all [AudioStreamPlayer3D] nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer3D.panning_strength]. A value of [code]0.0[/code] disables stereo panning entirely, leaving only volume attenuation in place. A value of [code]1.0[/code] completely mutes one of the channels if the sound is located exactly to the left (or right) of the listener. + The default value of [code]0.5[/code] is tuned for headphones. When using speakers, you may find lower values to sound better as speakers have a lower stereo separation compared to headphones. </member> <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. @@ -341,6 +344,9 @@ <member name="compression/formats/zstd/window_log_size" type="int" setter="" getter="" default="27"> Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing. </member> + <member name="debug/disable_touch" type="bool" setter="" getter="" default="false"> + Disable touch input. Only has effect on iOS. + </member> <member name="debug/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false"> If [code]true[/code], logs all output to files. </member> @@ -395,7 +401,7 @@ <member name="debug/gdscript/warnings/redundant_await" 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 function that is not a coroutine is called with await. </member> - <member name="debug/gdscript/warnings/return_value_discarded" type="int" setter="" getter="" default="1"> + <member name="debug/gdscript/warnings/return_value_discarded" 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 function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum. </member> <member name="debug/gdscript/warnings/shadowed_global_identifier" type="int" setter="" getter="" default="1"> @@ -552,7 +558,7 @@ Position offset for tooltips, relative to the mouse cursor's hotspot. </member> <member name="display/window/dpi/allow_hidpi" type="bool" setter="" getter="" default="true"> - If [code]true[/code], allows HiDPI display on Windows, macOS, Android, iOS and Web. If [code]false[/code], the platform's low-DPI fallback will be used on HiDPI displays, which causes the window to be displayed in a blurry or pixelated manner (and can cause various window management bugs). Therefore, it is recommended to make your project scale to [url=$DOCS_URL/tutorials/viewports/multiple_resolutions.html]multiple resolutions[/url] instead of disabling this setting. + If [code]true[/code], allows HiDPI display on Windows, macOS, Android, iOS and Web. If [code]false[/code], the platform's low-DPI fallback will be used on HiDPI displays, which causes the window to be displayed in a blurry or pixelated manner (and can cause various window management bugs). Therefore, it is recommended to make your project scale to [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] instead of disabling this setting. [b]Note:[/b] This setting has no effect on Linux as DPI-awareness fallbacks are not supported there. </member> <member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true"> @@ -833,6 +839,7 @@ [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> <member name="input/ui_swap_input_direction" type="Dictionary" setter="" getter=""> + Default [InputEventAction] to swap input direction, i.e. change between left-to-right to right-to-left modes. Affects text-editting controls ([LineEdit], [TextEdit]). </member> <member name="input/ui_text_add_selection_for_next_occurrence" type="Dictionary" setter="" getter=""> If a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence. @@ -1808,6 +1815,10 @@ <member name="physics/common/enable_object_picking" type="bool" setter="" getter="" default="true"> Enables [member Viewport.physics_object_picking] on the root viewport. </member> + <member name="physics/common/max_physics_steps_per_frame" type="int" setter="" getter="" default="8"> + Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics/common/physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member physics/common/max_physics_steps_per_frame] if you have increased [member physics/common/physics_ticks_per_second] significantly above its default value. + [b]Note:[/b] This property is only read when the project starts. To change the maximum number of simulated physics steps per frame at runtime, set [member Engine.max_physics_steps_per_frame] instead. + </member> <member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5"> Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0[/code]. @@ -1816,7 +1827,7 @@ <member name="physics/common/physics_ticks_per_second" type="int" setter="" getter="" default="60"> The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. See also [member application/run/max_fps]. [b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_ticks_per_second] instead. - [b]Note:[/b] Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended not to increase [member physics/common/physics_ticks_per_second] above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. + [b]Note:[/b] Only [member physics/common/max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended to also increase [member physics/common/max_physics_steps_per_frame] if increasing [member physics/common/physics_ticks_per_second] significantly above its default value. </member> <member name="rendering/2d/sdf/oversize" type="int" setter="" getter="" default="1"> </member> @@ -2013,6 +2024,9 @@ <member name="rendering/lightmapping/bake_quality/ultra_quality_ray_count" type="int" setter="" getter="" default="1024"> The number of rays to use for baking lightmaps with [LightmapGI] when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_ULTRA]. </member> + <member name="rendering/lightmapping/primitive_meshes/texel_size" type="float" setter="" getter="" default="0.2"> + The texel_size that is used to calculate the [member Mesh.lightmap_size_hint] on [PrimitiveMesh] resources if [member PrimitiveMesh.add_uv2] is enabled. + </member> <member name="rendering/lightmapping/probe_capture/update_speed" type="float" setter="" getter="" default="15"> The framerate-independent update speed when representing dynamic object lighting from [LightmapProbe]s. Higher values make dynamic object lighting update faster. Higher values can prevent fast-moving objects from having "outdated" indirect lighting displayed on them, at the cost of possible flickering when an object moves from a bright area to a shaded area. </member> @@ -2223,9 +2237,6 @@ <member name="rendering/textures/lossless_compression/force_png" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import lossless textures using the PNG format. Otherwise, it will default to using WebP. </member> - <member name="rendering/textures/lossless_compression/webp_compression_level" type="int" setter="" getter="" default="2"> - The default compression level for lossless WebP. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. Supported values are 0 to 9. Note that compression levels above 6 are very slow and offer very little savings. - </member> <member name="rendering/textures/vram_compression/import_bptc" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the BPTC algorithm. This texture compression algorithm is only supported on desktop platforms, and only when using the Vulkan renderer. [b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]). @@ -2242,6 +2253,12 @@ If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. [b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]). </member> + <member name="rendering/textures/webp_compression/compression_method" type="int" setter="" getter="" default="2"> + The default compression method for WebP. Affects both lossy and lossless WebP. A higher value results in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression method. Supported values are 0 to 6. Note that compression methods above 4 are very slow and offer very little savings. + </member> + <member name="rendering/textures/webp_compression/lossless_compression_factor" type="float" setter="" getter="" default="25"> + The default compression factor for lossless WebP. Decompression speed is mostly unaffected by the compression factor. Supported values are 0 to 100. + </member> <member name="rendering/transparent_background" type="bool" setter="" getter="" default="false"> If [code]true[/code], enables [member Viewport.transparent_bg] on the root viewport. This allows per-pixel transparency to be effective after also enabling [member display/window/size/transparent] and [member display/window/per_pixel_transparency/allowed]. </member> diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index 8aa89015c6..2dcfc90955 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -62,7 +62,8 @@ <member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values" default="false"> If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer. </member> - <member name="step" type="float" setter="set_step" getter="get_step" default="1.0"> + <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> + <member name="step" type="float" setter="set_step" getter="get_step" default="0.01"> If greater than 0, [code]value[/code] will always be rounded to a multiple of [code]step[/code]. If [code]rounded[/code] is also [code]true[/code], [code]value[/code] will first be rounded to a multiple of [code]step[/code] then rounded to the nearest integer. </member> <member name="value" type="float" setter="set_value" getter="get_value" default="0.0"> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 28fe42afae..d39e50d5f0 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -82,9 +82,9 @@ var rect2 = rect.expand(Vector2(0, -1)) [/gdscript] [csharp] - # position (-3, 2), size (1, 1) + // position (-3, 2), size (1, 1) var rect = new Rect2(new Vector2(-3, 2), new Vector2(1, 1)); - # position (-3, -1), size (3, 4), so we fit both rect and Vector2(0, -1) + // position (-3, -1), size (3, 4), so we fit both rect and Vector2(0, -1) var rect2 = rect.Expand(new Vector2(0, -1)); [/csharp] [/codeblocks] diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 6d4c113609..325ead0cfa 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -79,9 +79,9 @@ var rect2 = rect.expand(Vector2i(0, -1)) [/gdscript] [csharp] - # position (-3, 2), size (1, 1) + // position (-3, 2), size (1, 1) var rect = new Rect2i(new Vector2i(-3, 2), new Vector2i(1, 1)); - # position (-3, -1), size (3, 4), so we fit both rect and Vector2i(0, -1) + // position (-3, -1), size (3, 4), so we fit both rect and Vector2i(0, -1) var rect2 = rect.Expand(new Vector2i(0, -1)); [/csharp] [/codeblocks] diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index cb13697cc2..580ce6f382 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -9,8 +9,8 @@ <methods> <method name="barrier"> <return type="void" /> - <param index="0" name="from" type="int" default="7" /> - <param index="1" name="to" type="int" default="7" /> + <param index="0" name="from" type="int" enum="RenderingDevice.BarrierMask" default="7" /> + <param index="1" name="to" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -19,7 +19,7 @@ <param index="0" name="buffer" type="RID" /> <param index="1" name="offset" type="int" /> <param index="2" name="size_bytes" type="int" /> - <param index="3" name="post_barrier" type="int" default="7" /> + <param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -35,7 +35,7 @@ <param index="1" name="offset" type="int" /> <param index="2" name="size_bytes" type="int" /> <param index="3" name="data" type="PackedByteArray" /> - <param index="4" name="post_barrier" type="int" default="7" /> + <param index="4" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -83,7 +83,7 @@ </method> <method name="compute_list_end"> <return type="void" /> - <param index="0" name="post_barrier" type="int" default="7" /> + <param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -223,7 +223,7 @@ </method> <method name="draw_list_end"> <return type="void" /> - <param index="0" name="post_barrier" type="int" default="7" /> + <param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -534,7 +534,7 @@ <param index="3" name="mipmap_count" type="int" /> <param index="4" name="base_layer" type="int" /> <param index="5" name="layer_count" type="int" /> - <param index="6" name="post_barrier" type="int" default="7" /> + <param index="6" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -549,7 +549,7 @@ <param index="6" name="dst_mipmap" type="int" /> <param index="7" name="src_layer" type="int" /> <param index="8" name="dst_layer" type="int" /> - <param index="9" name="post_barrier" type="int" default="7" /> + <param index="9" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -609,7 +609,7 @@ <return type="int" enum="Error" /> <param index="0" name="from_texture" type="RID" /> <param index="1" name="to_texture" type="RID" /> - <param index="2" name="post_barrier" type="int" default="7" /> + <param index="2" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -618,7 +618,7 @@ <param index="0" name="texture" type="RID" /> <param index="1" name="layer" type="int" /> <param index="2" name="data" type="PackedByteArray" /> - <param index="3" name="post_barrier" type="int" default="7" /> + <param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" /> <description> </description> </method> @@ -643,6 +643,16 @@ <description> </description> </method> + <method name="vertex_array_create"> + <return type="RID" /> + <param index="0" name="vertex_count" type="int" /> + <param index="1" name="vertex_format" type="int" /> + <param index="2" name="src_buffers" type="RID[]" /> + <param index="3" name="offsets" type="PackedInt64Array" default="PackedInt64Array()" /> + <description> + Creates a vertex array based on the specified buffers. Optionally, [param offsets] (in bytes) may be defined for each buffer. + </description> + </method> <method name="vertex_buffer_create"> <return type="RID" /> <param index="0" name="size_bytes" type="int" /> @@ -659,16 +669,6 @@ </method> </methods> <constants> - <constant name="BARRIER_MASK_RASTER" value="1"> - </constant> - <constant name="BARRIER_MASK_COMPUTE" value="2"> - </constant> - <constant name="BARRIER_MASK_TRANSFER" value="4"> - </constant> - <constant name="BARRIER_MASK_ALL" value="7"> - </constant> - <constant name="BARRIER_MASK_NO_BARRIER" value="8"> - </constant> <constant name="DEVICE_TYPE_OTHER" value="0" enum="DeviceType"> Rendering device type does not match any of the other enum values or is unknown. </constant> @@ -1151,6 +1151,16 @@ </constant> <constant name="DATA_FORMAT_MAX" value="218" enum="DataFormat"> </constant> + <constant name="BARRIER_MASK_RASTER" value="1" enum="BarrierMask" is_bitfield="true"> + </constant> + <constant name="BARRIER_MASK_COMPUTE" value="2" enum="BarrierMask" is_bitfield="true"> + </constant> + <constant name="BARRIER_MASK_TRANSFER" value="4" enum="BarrierMask" is_bitfield="true"> + </constant> + <constant name="BARRIER_MASK_ALL_BARRIERS" value="7" enum="BarrierMask" is_bitfield="true"> + </constant> + <constant name="BARRIER_MASK_NO_BARRIER" value="8" enum="BarrierMask" is_bitfield="true"> + </constant> <constant name="TEXTURE_TYPE_1D" value="0" enum="TextureType"> </constant> <constant name="TEXTURE_TYPE_2D" value="1" enum="TextureType"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 1c02d58299..2ffa4dc50b 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -838,6 +838,8 @@ <method name="create_local_rendering_device" qualifiers="const"> <return type="RenderingDevice" /> <description> + Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice. + [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [code]null[/code]. </description> </method> <method name="decal_create"> @@ -1273,6 +1275,8 @@ <method name="get_rendering_device" qualifiers="const"> <return type="RenderingDevice" /> <description> + Returns the global RenderingDevice. + [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [code]null[/code]. </description> </method> <method name="get_rendering_info"> @@ -3024,6 +3028,14 @@ <description> </description> </method> + <method name="texture_get_rd_texture" qualifiers="const"> + <return type="RID" /> + <param index="0" name="texture" type="RID" /> + <param index="1" name="srgb" type="bool" default="false" /> + <description> + Returns a texture [RID] that can be used with [RenderingDevice]. + </description> + </method> <method name="texture_proxy_create"> <return type="RID" /> <param index="0" name="base" type="RID" /> diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 9eedc3a24c..6e3535f14a 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -87,6 +87,7 @@ <param index="0" name="torque" type="float" /> <description> Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="apply_torque_impulse"> @@ -95,6 +96,7 @@ <description> Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="get_colliding_bodies" qualifiers="const"> diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index 3ee3f25df1..8380d56de3 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -87,6 +87,7 @@ <param index="0" name="torque" type="Vector3" /> <description> Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="apply_torque_impulse"> @@ -95,6 +96,7 @@ <description> Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="get_colliding_bodies" qualifiers="const"> diff --git a/doc/classes/ScrollBar.xml b/doc/classes/ScrollBar.xml index 266787c9c8..247e892c24 100644 --- a/doc/classes/ScrollBar.xml +++ b/doc/classes/ScrollBar.xml @@ -12,7 +12,6 @@ <member name="custom_step" type="float" setter="set_custom_step" getter="get_custom_step" default="-1.0"> Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="0.0" /> </members> <signals> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index b96b7187e4..af39261e81 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -49,6 +49,7 @@ Controls whether horizontal scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. </member> <member name="scroll_deadzone" type="int" setter="set_deadzone" getter="get_deadzone" default="0"> + Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive. </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> The current horizontal scroll value. diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index d99477ee95..3412cd2140 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -1,9 +1,29 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Signal" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Class representing a signal defined in an object. + Built-in type representing a signal defined in an object. </brief_description> <description> + [Signal] is a built-in [Variant] type that represents a signal of an [Object] instance. Like all [Variant] types, it can be stored in variables and passed to functions. Signals allow all connected [Callable]s (and by extension their respective objects) to listen and react to events, without directly referencing one another. This keeps the code flexible and easier to manage. + In GDScript, signals can be declared with the [code]signal[/code] keyword. In C#, you may use the [code][Signal][/code] attribute on a delegate. + [codeblocks] + [gdscript] + signal attacked + + # Additional arguments may be declared. + # These arguments must be passed when the signal is emitted. + signal item_dropped(item_name, amount) + [/gdscript] + [csharp] + [Signal] + delegate void Attacked(); + + // Additional arguments may be declared. + // These arguments must be passed when the signal is emitted. + [Signal] + delegate void ItemDropped(itemName: string, amount: int); + [/csharp] + [/codeblocks] </description> <tutorials> <link title="Using Signals">$DOCS_URL/getting_started/step_by_step/signals.html</link> @@ -13,7 +33,7 @@ <constructor name="Signal"> <return type="Signal" /> <description> - Constructs a null [Signal] with no object nor signal name bound. + Constructs an empty [Signal] with no object nor signal name bound. </description> </constructor> <constructor name="Signal"> @@ -28,7 +48,7 @@ <param index="0" name="object" type="Object" /> <param index="1" name="signal" type="StringName" /> <description> - Creates a new [Signal] with the name [param signal] in the specified [param object]. + Creates a new [Signal] named [param signal] in the specified [param object]. </description> </constructor> </constructors> @@ -38,12 +58,13 @@ <param index="0" name="callable" type="Callable" /> <param index="1" name="flags" type="int" default="0" /> <description> - Connects this signal to the specified [Callable], optionally providing connection flags. You can provide additional arguments to the connected method call by using [method Callable.bind]. + Connects this signal to the specified [param callable]. Optional [param flags] can be also added to configure the connection's behavior (see [enum Object.ConnectFlags] constants). You can provide additional arguments to the connected [param callable] by using [method Callable.bind]. + A signal can only be connected once to the same [Callable]. If the signal is already connected, returns [constant ERR_INVALID_PARAMETER] and pushes an error message, unless the signal is connected with [constant Object.CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first to check for existing connections. [codeblock] for button in $Buttons.get_children(): - button.pressed.connect(on_pressed.bind(button)) + button.pressed.connect(_on_pressed.bind(button)) - func on_pressed(button): + func _on_pressed(button): print(button.name, " was pressed") [/codeblock] </description> @@ -52,13 +73,13 @@ <return type="void" /> <param index="0" name="callable" type="Callable" /> <description> - Disconnects this signal from the specified [Callable]. + Disconnects this signal from the specified [Callable]. If the connection does not exist, generates an error. Use [method is_connected] to make sure that the connection exists. </description> </method> <method name="emit" qualifiers="vararg const"> <return type="void" /> <description> - Emits this signal to all connected objects. + Emits this signal. All [Callable]s connected to this signal will be triggered. This method supports a variable number of arguments, so parameters can be passed as a comma separated list. </description> </method> <method name="get_connections" qualifiers="const"> @@ -95,6 +116,7 @@ <method name="is_null" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the signal's name does not exist in its object, or the object is not valid. </description> </method> </methods> @@ -103,12 +125,14 @@ <return type="bool" /> <param index="0" name="right" type="Signal" /> <description> + Returns [code]true[/code] if the signals do not share the same object and name. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Signal" /> <description> + Returns [code]true[/code] if both signals share the same object and name. </description> </operator> </operators> diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml index 0e626842bd..cecca0a5fb 100644 --- a/doc/classes/Slider.xml +++ b/doc/classes/Slider.xml @@ -17,7 +17,7 @@ <member name="scrollable" type="bool" setter="set_scrollable" getter="is_scrollable" default="true"> If [code]true[/code], the value can be changed using the mouse wheel. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> + <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" /> <member name="tick_count" type="int" setter="set_ticks" getter="get_ticks" default="0"> Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. </member> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 93799b58f0..7d63747bd2 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -46,6 +46,7 @@ </methods> <members> <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> + Changes the alignment of the underlying [LineEdit]. </member> <member name="custom_arrow_step" type="float" setter="set_custom_arrow_step" getter="get_custom_arrow_step" default="0.0"> If not [code]0[/code], [code]value[/code] will always be rounded to a multiple of [code]custom_arrow_step[/code] when interacting with the arrow buttons of the [SpinBox]. @@ -59,6 +60,8 @@ <member name="select_all_on_focus" type="bool" setter="set_select_all_on_focus" getter="is_select_all_on_focus" default="false"> If [code]true[/code], the [SpinBox] will select the whole text when the [LineEdit] gains focus. Clicking the up and down arrows won't trigger this behavior. </member> + <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="1" /> + <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" /> <member name="suffix" type="String" setter="set_suffix" getter="get_suffix" default=""""> Adds the specified [code]suffix[/code] string after the numerical value of the [SpinBox]. </member> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 956e646702..01671aa04e 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -19,6 +19,7 @@ The number of columns in the sprite sheet. </member> <member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false"> + If [code]true[/code], the sprite will use [member region_rect] and display only the specified part of its texture. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index b0b4f74b46..c186952c74 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -27,14 +27,14 @@ <return type="String" /> <param index="0" name="from" type="NodePath" /> <description> - Constructs a new String from the given [NodePath]. + Constructs a new [String] from the given [NodePath]. </description> </constructor> <constructor name="String"> <return type="String" /> <param index="0" name="from" type="StringName" /> <description> - Constructs a new String from the given [StringName]. + Constructs a new [String] from the given [StringName]. </description> </constructor> </constructors> @@ -51,7 +51,7 @@ <description> Returns an array containing the bigrams (pairs of consecutive letters) of this string. [codeblock] - print("Bigrams".bigrams()) # Prints "[Bi, ig, gr, ra, am, ms]" + print("Bigrams".bigrams()) # Prints ["Bi", "ig", "gr", "ra", "am", "ms"] [/codeblock] </description> </method> @@ -80,7 +80,7 @@ <method name="c_unescape" qualifiers="const"> <return type="String" /> <description> - Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are [code]\'[/code], [code]\"[/code], [code]\?[/code], [code]\\[/code], [code]\a[/code], [code]\b[/code], [code]\f[/code], [code]\n[/code], [code]\r[/code], [code]\t[/code], [code]\v[/code]. + Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are [code]\'[/code], [code]\"[/code], [code]\\[/code], [code]\a[/code], [code]\b[/code], [code]\f[/code], [code]\n[/code], [code]\r[/code], [code]\t[/code], [code]\v[/code]. [b]Note:[/b] Unlike the GDScript parser, this method doesn't support the [code]\uXXXX[/code] escape sequence. </description> </method> @@ -738,7 +738,7 @@ </description> </method> <method name="split_floats" qualifiers="const"> - <return type="PackedFloat32Array" /> + <return type="PackedFloat64Array" /> <param index="0" name="delimiter" type="String" /> <param index="1" name="allow_empty" type="bool" default="true" /> <description> @@ -920,66 +920,88 @@ <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if both strings do not contain the same sequence of characters. </description> </operator> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if this [String] is not equivalent to the given [StringName]. </description> </operator> <operator name="operator %"> <return type="String" /> <param index="0" name="right" type="Variant" /> <description> + Formats the [String], replacing the placeholders with one or more parameters. + To pass multiple parameters, [param right] needs to be an [Array]. + [codeblock] + print("I caught %d fishes!" % 2) # Prints "I caught 2 fishes!" + + var my_message = "Travelling to %s, at %2.2f per second." + var location = "Deep Valley" + var speed = 40.3485 + print(my_message % [location, speed]) # Prints "Travelling to Deep Valley, at 40.35 km/h." + [/codeblock] + In C#, there is no direct equivalent to this operator. Use the [method format] method, instead. + For more information, see the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_format_string.html]GDScript format strings[/url] tutorial. </description> </operator> <operator name="operator +"> <return type="String" /> <param index="0" name="right" type="String" /> <description> + Appends [param right] at the end of this [String], also known as a string concatenation. </description> </operator> <operator name="operator <"> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if the left [String] comes before [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order. Useful for sorting. </description> </operator> <operator name="operator <="> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if the left [String] comes before [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order, or if both are equal. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if both strings contain the same sequence of characters. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if this [String] is equivalent to the given [StringName]. </description> </operator> <operator name="operator >"> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if the left [String] comes after [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order. Useful for sorting. </description> </operator> <operator name="operator >="> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if the left [String] comes after [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order, or if both are equal. </description> </operator> <operator name="operator []"> <return type="String" /> <param index="0" name="index" type="int" /> <description> + Returns a new [String] that only contains the character at [param index]. Indices start from [code]0[/code]. If [param index] is greater or equal to [code]0[/code], the character is fetched starting from the beginning of the string. If [param index] is a negative value, it is fetched starting from the end. Accessing a string out-of-bounds will cause a run-time error, pausing the project execution if run from the editor. </description> </operator> </operators> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index c40d8929fc..02e9c62cd6 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -5,7 +5,7 @@ </brief_description> <description> [StringName]s are immutable strings designed for general-purpose representation of unique names (also called "string interning"). [StringName] ensures that only one instance of a given name exists (so two [StringName]s with the same value are the same object). Comparing them is much faster than with regular [String]s, because only the pointers are compared, not the whole strings. - You will usually just pass a [String] to methods expecting a [StringName] and it will be automatically converted, but you may occasionally want to construct a [StringName] ahead of time with [StringName] or the literal syntax [code]&"example"[/code]. + You will usually just pass a [String] to methods expecting a [StringName] and it will be automatically converted, but you may occasionally want to construct a [StringName] ahead of time with [StringName] or, in GDScript, the literal syntax [code]&"example"[/code]. See also [NodePath], which is a similar concept specifically designed to store pre-parsed node paths. </description> <tutorials> @@ -28,7 +28,7 @@ <return type="StringName" /> <param index="0" name="from" type="String" /> <description> - Creates a new [StringName] from the given [String]. [code]StringName("example")[/code] is equivalent to [code]&"example"[/code]. + Creates a new [StringName] from the given [String]. In GDScript, [code]StringName("example")[/code] is equivalent to [code]&"example"[/code]. </description> </constructor> </constructors> @@ -45,48 +45,56 @@ <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if this [StringName] is not equivalent to the given [String]. </description> </operator> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the [StringName] and [param right] do not refer to the same name. Comparisons between [StringName]s are much faster than regular [String] comparisons. </description> </operator> <operator name="operator <"> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the left [String] comes before [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order. Useful for sorting. </description> </operator> <operator name="operator <="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the left [String] comes before [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order, or if both are equal. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="String" /> <description> + Returns [code]true[/code] if this [StringName] is equivalent to the given [String]. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the [StringName] and [param right] refer to the same name. Comparisons between [StringName]s are much faster than regular [String] comparisons. </description> </operator> <operator name="operator >"> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the left [StringName] comes after [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order. Useful for sorting. </description> </operator> <operator name="operator >="> <return type="bool" /> <param index="0" name="right" type="StringName" /> <description> + Returns [code]true[/code] if the left [StringName] comes after [param right] in [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode order[/url], which roughly matches the alphabetical order, or if both are equal. </description> </operator> </operators> diff --git a/doc/classes/Texture.xml b/doc/classes/Texture.xml index df6e0433dc..86c9026fd1 100644 --- a/doc/classes/Texture.xml +++ b/doc/classes/Texture.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Texture" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Base class for all texture types. </brief_description> <description> + [Texture] is the base class for all texture types. Common texture types are [Texture2D] and [ImageTexture]. See also [Image]. </description> <tutorials> </tutorials> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index 3dd8c339b2..aac197090a 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -19,6 +19,8 @@ <param index="2" name="modulate" type="Color" /> <param index="3" name="transpose" type="bool" /> <description> + Called when the entire [Texture2D] is requested to be drawn over a [CanvasItem], with the top-left offset specified in [param pos]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). + [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_draw_rect" qualifiers="virtual const"> @@ -29,6 +31,8 @@ <param index="3" name="modulate" type="Color" /> <param index="4" name="transpose" type="bool" /> <description> + Called when the [Texture2D] is requested to be drawn onto [CanvasItem]'s specified [param rect]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). + [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_draw_rect_region" qualifiers="virtual const"> @@ -40,21 +44,26 @@ <param index="4" name="transpose" type="bool" /> <param index="5" name="clip_uv" type="bool" /> <description> + Called when a part of the [Texture2D] specified by [param src_rect]'s coordinates is requested to be drawn onto [CanvasItem]'s specified [param rect]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). + [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_get_height" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [Texture2D]'s height is queried. </description> </method> <method name="_get_width" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [Texture2D]'s width is queried. </description> </method> <method name="_has_alpha" qualifiers="virtual const"> <return type="bool" /> <description> + Called when the presence of an alpha channel in the [Texture2D] is queried. </description> </method> <method name="_is_pixel_opaque" qualifiers="virtual const"> @@ -62,6 +71,7 @@ <param index="0" name="x" type="int" /> <param index="1" name="y" type="int" /> <description> + Called when a pixel's opaque state in the [Texture2D] is queried at the specified [code](x, y)[/code] position. </description> </method> <method name="draw" qualifiers="const"> @@ -100,7 +110,7 @@ <method name="get_height" qualifiers="const"> <return type="int" /> <description> - Returns the texture height. + Returns the texture height in pixels. </description> </method> <method name="get_image" qualifiers="const"> @@ -113,13 +123,13 @@ <method name="get_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns the texture size. + Returns the texture size in pixels. </description> </method> <method name="get_width" qualifiers="const"> <return type="int" /> <description> - Returns the texture width. + Returns the texture width in pixels. </description> </method> <method name="has_alpha" qualifiers="const"> diff --git a/doc/classes/Texture2DArray.xml b/doc/classes/Texture2DArray.xml index 113f37f974..ec00198db1 100644 --- a/doc/classes/Texture2DArray.xml +++ b/doc/classes/Texture2DArray.xml @@ -4,8 +4,9 @@ A single texture resource which consists of multiple, separate images. Each image has the same dimensions and number of mipmap levels. </brief_description> <description> - A Texture2DArray is different from a Texture3D: The Texture2DArray does not support trilinear interpolation between the [Image]s, i.e. no blending. + A Texture2DArray is different from a Texture3D: The Texture2DArray does not support trilinear interpolation between the [Image]s, i.e. no blending. See also [Cubemap] and [CubemapArray], which are texture arrays with specialized cubemap functions. A Texture2DArray is also different from an [AtlasTexture]: In a Texture2DArray, all images are treated separately. In an atlas, the regions (i.e. the single images) can be of different sizes. Furthermore, you usually need to add a padding around the regions, to prevent accidental UV mapping to more than one region. The same goes for mipmapping: Mipmap chains are handled separately for each layer. In an atlas, the slicing has to be done manually in the fragment shader. + To create such a texture file yourself, reimport your image files using the Godot Editor import presets. </description> <tutorials> </tutorials> diff --git a/doc/classes/Texture3D.xml b/doc/classes/Texture3D.xml index 4968f46fe8..1a66932d62 100644 --- a/doc/classes/Texture3D.xml +++ b/doc/classes/Texture3D.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Texture3D" inherits="Texture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Base class for 3-dimensionnal textures. </brief_description> <description> + Base class for [ImageTexture3D] and [CompressedTexture3D]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. [Texture3D] is the base class for all 3-dimensional texture types. See also [TextureLayered]. + All images need to have the same width, height and number of mipmap levels. + To create such a texture file yourself, reimport your image files using the Godot Editor import presets. </description> <tutorials> </tutorials> @@ -10,61 +14,73 @@ <method name="_get_data" qualifiers="virtual const"> <return type="Image[]" /> <description> + Called when the [Texture3D]'s data is queried. </description> </method> <method name="_get_depth" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [Texture3D]'s depth is queried. </description> </method> <method name="_get_format" qualifiers="virtual const"> <return type="int" enum="Image.Format" /> <description> + Called when the [Texture3D]'s format is queried. </description> </method> <method name="_get_height" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [Texture3D]'s height is queried. </description> </method> <method name="_get_width" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [Texture3D]'s width is queried. </description> </method> <method name="_has_mipmaps" qualifiers="virtual const"> <return type="bool" /> <description> + Called when the presence of mipmaps in the [Texture3D] is queried. </description> </method> <method name="get_data" qualifiers="const"> <return type="Image[]" /> <description> + Returns the [Texture3D]'s data as an array of [Image]s. Each [Image] represents a [i]slice[/i] of the [Texture3D], with different slices mapping to different depth (Z axis) levels. </description> </method> <method name="get_depth" qualifiers="const"> <return type="int" /> <description> + Returns the [Texture3D]'s depth in pixels. Depth is typically represented by the Z axis (a dimension not present in [Texture2D]). </description> </method> <method name="get_format" qualifiers="const"> <return type="int" enum="Image.Format" /> <description> + Returns the current format being used by this texture. See [enum Image.Format] for details. </description> </method> <method name="get_height" qualifiers="const"> <return type="int" /> <description> + Returns the [Texture3D]'s height in pixels. Width is typically represented by the Y axis. </description> </method> <method name="get_width" qualifiers="const"> <return type="int" /> <description> + Returns the [Texture3D]'s width in pixels. Width is typically represented by the X axis. </description> </method> <method name="has_mipmaps" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the [Texture3D] has generated mipmaps. </description> </method> </methods> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index 043eeb9a80..b185828577 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -27,19 +27,19 @@ <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask"> Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. </member> - <member name="texture_disabled" type="Texture2D" setter="set_disabled_texture" getter="get_disabled_texture"> + <member name="texture_disabled" type="Texture2D" setter="set_texture_disabled" getter="get_texture_disabled"> Texture to display when the node is disabled. See [member BaseButton.disabled]. </member> - <member name="texture_focused" type="Texture2D" setter="set_focused_texture" getter="get_focused_texture"> + <member name="texture_focused" type="Texture2D" setter="set_texture_focused" getter="get_texture_focused"> Texture to display when the node has mouse or keyboard focus. [member texture_focused] is displayed [i]over[/i] the base texture, so a partially transparent texture should be used to ensure the base texture remains visible. A texture that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a fully transparent texture of any size. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </member> - <member name="texture_hover" type="Texture2D" setter="set_hover_texture" getter="get_hover_texture"> + <member name="texture_hover" type="Texture2D" setter="set_texture_hover" getter="get_texture_hover"> Texture to display when the mouse hovers the node. </member> - <member name="texture_normal" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture"> + <member name="texture_normal" type="Texture2D" setter="set_texture_normal" getter="get_texture_normal"> Texture to display by default, when the node is [b]not[/b] in the disabled, focused, hover or pressed state. </member> - <member name="texture_pressed" type="Texture2D" setter="set_pressed_texture" getter="get_pressed_texture"> + <member name="texture_pressed" type="Texture2D" setter="set_texture_pressed" getter="get_texture_pressed"> Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the [member BaseButton.shortcut] key. </member> </members> diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index 5e6afcbc5c..8f6dff7acf 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -4,12 +4,11 @@ Base class for texture types which contain the data of multiple [Image]s. Each image is of the same size and format. </brief_description> <description> - Base class for [Texture2DArray], [Cubemap] and [CubemapArray]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. + Base class for [ImageTextureLayered]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [Texture3D]. Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer. All images need to have the same width, height and number of mipmap levels. - A [TextureLayered] can be loaded with [code]method ResourceFormatLoader.load[/code]. - To create such a texture file yourself, re-import your image files using the Godot Editor import presets. - Internally, Godot maps these files to their respective counterparts in the target rendering driver (GLES3, Vulkan). + A [TextureLayered] can be loaded with [method ResourceLoader.load]. + Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, GLES3). </description> <tutorials> </tutorials> @@ -17,37 +16,44 @@ <method name="_get_format" qualifiers="virtual const"> <return type="int" enum="Image.Format" /> <description> + Called when the [TextureLayered]'s format is queried. </description> </method> <method name="_get_height" qualifiers="virtual const"> <return type="int" /> <description> + Called when the the [TextureLayered]'s height is queried. </description> </method> <method name="_get_layer_data" qualifiers="virtual const"> <return type="Image" /> <param index="0" name="layer_index" type="int" /> <description> + Called when the data for a layer in the [TextureLayered] is queried. </description> </method> <method name="_get_layered_type" qualifiers="virtual const"> <return type="int" /> <description> + Called when the layers' type in the [TextureLayered] is queried. </description> </method> <method name="_get_layers" qualifiers="virtual const"> <return type="int" /> <description> + Called when the number of layers in the [TextureLayered] is queried. </description> </method> <method name="_get_width" qualifiers="virtual const"> <return type="int" /> <description> + Called when the [TextureLayered]'s width queried. </description> </method> <method name="_has_mipmaps" qualifiers="virtual const"> <return type="bool" /> <description> + Called when the presence of mipmaps in the [TextureLayered] is queried. </description> </method> <method name="get_format" qualifiers="const"> @@ -59,7 +65,7 @@ <method name="get_height" qualifiers="const"> <return type="int" /> <description> - Returns the height of the texture. Height is typically represented by the Y-axis. + Returns the height of the texture in pixels. Height is typically represented by the Y axis. </description> </method> <method name="get_layer_data" qualifiers="const"> @@ -72,6 +78,7 @@ <method name="get_layered_type" qualifiers="const"> <return type="int" enum="TextureLayered.LayeredType" /> <description> + Returns the [TextureLayered]'s type. The type determines how the data is accessed, with cubemaps having special types. </description> </method> <method name="get_layers" qualifiers="const"> @@ -83,7 +90,7 @@ <method name="get_width" qualifiers="const"> <return type="int" /> <description> - Returns the width of the texture. Width is typically represented by the X-axis. + Returns the width of the texture in pixels. Width is typically represented by the X axis. </description> </method> <method name="has_mipmaps" qualifiers="const"> @@ -95,10 +102,13 @@ </methods> <constants> <constant name="LAYERED_TYPE_2D_ARRAY" value="0" enum="LayeredType"> + Texture is a generic [Texture2DArray]. </constant> <constant name="LAYERED_TYPE_CUBEMAP" value="1" enum="LayeredType"> + Texture is a [Cubemap], with each side in its own layer (6 in total). </constant> <constant name="LAYERED_TYPE_CUBEMAP_ARRAY" value="2" enum="LayeredType"> + Texture is a [CubemapArray], with each cubemap being made of 6 layers. </constant> </constants> </class> diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index ded4dac7da..d7a9d06a15 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -13,6 +13,7 @@ <return type="int" /> <param index="0" name="margin" type="int" enum="Side" /> <description> + Returns the stretch margin with the specified index. See [member stretch_margin_bottom] and related properties. </description> </method> <method name="set_stretch_margin"> @@ -20,6 +21,7 @@ <param index="0" name="margin" type="int" enum="Side" /> <param index="1" name="value" type="int" /> <description> + Sets the stretch margin with the specified index. See [member stretch_margin_bottom] and related properties. </description> </method> </methods> @@ -41,6 +43,8 @@ <member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle" default="0.0"> Starting angle for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]min_value[/code], the texture doesn't show up at all. When the [code]value[/code] increases, the texture fills and tends towards [member radial_fill_degrees]. </member> + <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="1" /> + <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" /> <member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin" default="0"> The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. </member> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index 798a536a88..f815b8d0c3 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TileData" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Settings for a single tile in a [TileSet]. </brief_description> <description> + [TileData] object represents a single tile in a [TileSet]. It is usually edited using the tileset editor, but it can be modified at runtime using [method TileMap._tile_data_runtime_update]. </description> <tutorials> </tutorials> @@ -196,32 +198,43 @@ </methods> <members> <member name="flip_h" type="bool" setter="set_flip_h" getter="get_flip_h" default="false"> + If [code]true[/code], the tile will have its texture flipped horizontally. </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false"> + If [code]true[/code], the tile will have its texture flipped vertically. </member> <member name="material" type="Material" setter="set_material" getter="get_material"> The [Material] to use for this [TileData]. This can be a [CanvasItemMaterial] to use the default shader, or a [ShaderMaterial] to use a custom shader. </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> + Color modulation of the tile. </member> <member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0"> + Relative probability of this tile being selected when drawing a pattern of random tiles. </member> <member name="terrain" type="int" setter="set_terrain" getter="get_terrain" default="-1"> + ID of the terrain from the terrain set that the tile uses. </member> <member name="terrain_set" type="int" setter="set_terrain_set" getter="get_terrain_set" default="-1"> + ID of the terrain set that the tile uses. </member> <member name="texture_offset" type="Vector2i" setter="set_texture_offset" getter="get_texture_offset" default="Vector2i(0, 0)"> + Offsets the position of where the tile is drawn. </member> <member name="transpose" type="bool" setter="set_transpose" getter="get_transpose" default="false"> + If [code]true[/code], the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped. </member> <member name="y_sort_origin" type="int" setter="set_y_sort_origin" getter="get_y_sort_origin" default="0"> + Vertical point of the tile used for determining y-sorted order. </member> <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0"> + Ordering index of this tile, relative to [TileMap]. </member> </members> <signals> <signal name="changed"> <description> + Emitted when any of the properties are changed. </description> </signal> </signals> diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index 314be9adf8..ae2f8d8dff 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -88,6 +88,12 @@ The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. </description> </method> + <method name="get_translated_message_list" qualifiers="const"> + <return type="PackedStringArray" /> + <description> + Returns all the messages (translated text). + </description> + </method> </methods> <members> <member name="locale" type="String" setter="set_locale" getter="get_locale" default=""en""> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 532f6703b2..6a016c3ebd 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -84,6 +84,7 @@ <return type="int" /> <param index="0" name="column" type="int" /> <description> + Returns the expand ratio assigned to the column. </description> </method> <method name="get_column_title" qualifiers="const"> @@ -223,12 +224,14 @@ <return type="bool" /> <param index="0" name="column" type="int" /> <description> + Returns [code]true[/code] if the column has enabled clipping (see [method set_column_clip_content]). </description> </method> <method name="is_column_expanding" qualifiers="const"> <return type="bool" /> <param index="0" name="column" type="int" /> <description> + Returns [code]true[/code] if the column has enabled expanding (see [method set_column_expand]). </description> </method> <method name="scroll_to_item"> @@ -244,6 +247,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="enable" type="bool" /> <description> + Allows to enable clipping for column's content, making the content size ignored. </description> </method> <method name="set_column_custom_minimum_width"> @@ -259,7 +263,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="expand" type="bool" /> <description> - If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio]. + If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their expand ratio in a similar fashion to [member Control.size_flags_stretch_ratio] (see [method set_column_expand_ratio]). </description> </method> <method name="set_column_expand_ratio"> @@ -267,6 +271,7 @@ <param index="0" name="column" type="int" /> <param index="1" name="ratio" type="int" /> <description> + Sets the relative expand ratio for a column. See [method set_column_expand]. </description> </method> <method name="set_column_title"> @@ -293,6 +298,14 @@ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> + <method name="set_selected"> + <return type="void" /> + <param index="0" name="item" type="TreeItem" /> + <param index="1" name="column" type="int" /> + <description> + Selects the specified [TreeItem] and column. + </description> + </method> </methods> <members> <member name="allow_reselect" type="bool" setter="set_allow_reselect" getter="get_allow_reselect" default="false"> diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index 488154106f..4bc98dea6f 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -33,7 +33,7 @@ The background of the area below the grabber. </theme_item> <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> - The background of the area below the grabber, to the left of the grabber. + The background of the area below the grabber that displays when it's being hovered or focused. </theme_item> <theme_item name="slider" data_type="style" type="StyleBox"> The background for the whole slider. Determines the width of the [code]grabber_area[/code]. diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 2f253eda78..4156030d77 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -5,7 +5,8 @@ </brief_description> <description> 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. - It uses floating-point coordinates. See [Vector2i] for its integer counterpart. + It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]float=64[/code]. + See [Vector2i] for its integer counterpart. [b]Note:[/b] In a boolean context, a Vector2 will evaluate to [code]false[/code] if it's equal to [code]Vector2(0, 0)[/code]. Otherwise, a Vector2 will always evaluate to [code]true[/code]. </description> <tutorials> @@ -85,6 +86,16 @@ Returns the aspect ratio of this vector, the ratio of [member x] to [member y]. </description> </method> + <method name="bezier_derivative" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="control_1" type="Vector2" /> + <param index="1" name="control_2" type="Vector2" /> + <param index="2" name="end" type="Vector2" /> + <param index="3" name="t" type="float" /> + <description> + Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points. + </description> + </method> <method name="bezier_interpolate" qualifiers="const"> <return type="Vector2" /> <param index="0" name="control_1" type="Vector2" /> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index cd729d57fb..db6bc8f237 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -5,7 +5,7 @@ </brief_description> <description> 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. - It uses integer coordinates and is therefore preferable to [Vector2] when exact precision is required. + It uses integer coordinates and is therefore preferable to [Vector2] when exact precision is required. Note that the values are limited to 32 bits, and unlike [Vector2] this cannot be configured with an engine build option. Use [int] or [PackedInt64Array] if 64-bit values are needed. [b]Note:[/b] In a boolean context, a Vector2i will evaluate to [code]false[/code] if it's equal to [code]Vector2i(0, 0)[/code]. Otherwise, a Vector2i will always evaluate to [code]true[/code]. </description> <tutorials> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 054ca7e22c..2896408505 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -5,7 +5,8 @@ </brief_description> <description> 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. - It uses floating-point coordinates. See [Vector3i] for its integer counterpart. + It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]float=64[/code]. + See [Vector3i] for its integer counterpart. [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code]. </description> <tutorials> @@ -61,6 +62,16 @@ Returns the unsigned minimum angle to the given vector, in radians. </description> </method> + <method name="bezier_derivative" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="control_1" type="Vector3" /> + <param index="1" name="control_2" type="Vector3" /> + <param index="2" name="end" type="Vector3" /> + <param index="3" name="t" type="float" /> + <description> + Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points. + </description> + </method> <method name="bezier_interpolate" qualifiers="const"> <return type="Vector3" /> <param index="0" name="control_1" type="Vector3" /> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 8b5c5321f2..5c6dc3c1c5 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -5,7 +5,7 @@ </brief_description> <description> 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. - It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required. + It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required. Note that the values are limited to 32 bits, and unlike [Vector3] this cannot be configured with an engine build option. Use [int] or [PackedInt64Array] if 64-bit values are needed. [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code]. </description> <tutorials> diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index b9df1ffb46..d15ae35b59 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -5,7 +5,8 @@ </brief_description> <description> 4-element structure that can be used to represent any quadruplet of numeric values. - It uses floating-point coordinates. See [Vector4i] for its integer counterpart. + It uses floating-point coordinates. By default, these floating-point values use 32-bit precision, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]float=64[/code]. + See [Vector4i] for its integer counterpart. [b]Note:[/b] In a boolean context, a Vector4 will evaluate to [code]false[/code] if it's equal to [code]Vector4(0, 0, 0, 0)[/code]. Otherwise, a Vector4 will always evaluate to [code]true[/code]. </description> <tutorials> diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml index 834d59db66..95797df90a 100644 --- a/doc/classes/Vector4i.xml +++ b/doc/classes/Vector4i.xml @@ -5,7 +5,7 @@ </brief_description> <description> 4-element structure that can be used to represent 4D grid coordinates or sets of integers. - It uses integer coordinates. See [Vector4] for its floating-point counterpart. + It uses integer coordinates and is therefore preferable to [Vector4] when exact precision is required. Note that the values are limited to 32 bits, and unlike [Vector4] this cannot be configured with an engine build option. Use [int] or [PackedInt64Array] if 64-bit values are needed. </description> <tutorials> </tutorials> diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index 955f054cea..6bd64a50bb 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -15,7 +15,6 @@ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link> </tutorials> <members> - <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="true" /> <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 which uses the texture. </member> diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index cc483dbd02..05d5eb6673 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -35,6 +35,16 @@ Returns an array of vectors that denotes the physical play area mapped to the virtual space around the [XROrigin3D] point. The points form a convex polygon that can be used to react to or visualize the play area. This returns an empty array if this feature is not supported or if the information is not yet available. </description> </method> + <method name="get_projection_for_view"> + <return type="Projection" /> + <param index="0" name="view" type="int" /> + <param index="1" name="aspect" type="float" /> + <param index="2" name="near" type="float" /> + <param index="3" name="far" type="float" /> + <description> + Returns the projection matrix for a view/eye. + </description> + </method> <method name="get_render_target_size"> <return type="Vector2" /> <description> @@ -47,6 +57,16 @@ If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. </description> </method> + <method name="get_transform_for_view"> + <return type="Transform3D" /> + <param index="0" name="view" type="int" /> + <param index="1" name="cam_transform" type="Transform3D" /> + <description> + Returns the transform for a view/eye. + [param view] is the view/eye index. + [param cam_transform] is the transform that maps device coordinates to scene coordinates, typically the global_transform of the current XROrigin3D. + </description> + </method> <method name="get_view_count"> <return type="int" /> <description> diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml index c6b215daa3..0fe54e947f 100644 --- a/doc/classes/XRInterfaceExtension.xml +++ b/doc/classes/XRInterfaceExtension.xml @@ -141,13 +141,6 @@ Returns [code]true[/code] if this interface has been initialized. </description> </method> - <method name="_notification" qualifiers="virtual"> - <return type="void" /> - <param index="0" name="what" type="int" /> - <description> - Informs the interface of an applicable system notification. - </description> - </method> <method name="_post_draw_viewport" qualifiers="virtual"> <return type="void" /> <param index="0" name="render_target" type="RID" /> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index e3938fb5d5..a196021249 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -28,6 +28,13 @@ </constructor> <constructor name="float"> <return type="float" /> + <param index="0" name="from" type="String" /> + <description> + Converts a [String] to a [float], following the same rules as [method String.to_float]. + </description> + </constructor> + <constructor name="float"> + <return type="float" /> <param index="0" name="from" type="bool" /> <description> Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0. diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 65ab5d4656..93fc8386c6 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -54,6 +54,13 @@ </constructor> <constructor name="int"> <return type="int" /> + <param index="0" name="from" type="String" /> + <description> + Converts a [String] to an [int], following the same rules as [method String.to_int]. + </description> + </constructor> + <constructor name="int"> + <return type="int" /> <param index="0" name="from" type="bool" /> <description> Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 492a438d9b..e5a0bbb008 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -29,6 +29,12 @@ MARKUP_ALLOWED_SUBSEQUENT = " -.,:;!?\\/'\")]}>" # write in this script (check `translate()` uses), and also hardcoded in # `doc/translations/extract.py` to include them in the source POT file. BASE_STRINGS = [ + "All classes", + "Globals", + "Nodes", + "Resources", + "Other objects", + "Variant types", "Description", "Tutorials", "Properties", @@ -63,6 +69,19 @@ strings_l10n: Dict[str, str] = {} STYLES: Dict[str, str] = {} +CLASS_GROUPS: Dict[str, str] = { + "global": "Globals", + "node": "Nodes", + "resource": "Resources", + "object": "Other objects", + "variant": "Variant types", +} +CLASS_GROUPS_BASE: Dict[str, str] = { + "node": "Node", + "resource": "Resource", + "object": "Object", +} + class State: def __init__(self) -> None: @@ -329,7 +348,7 @@ class State: return cast def sort_classes(self) -> None: - self.classes = OrderedDict(sorted(self.classes.items(), key=lambda t: t[0])) + self.classes = OrderedDict(sorted(self.classes.items(), key=lambda t: t[0].lower())) class TypeName: @@ -601,12 +620,25 @@ def main() -> None: print("Generating the RST class reference...") + grouped_classes: Dict[str, List[str]] = {} + for class_name, class_def in state.classes.items(): if args.filter and not pattern.search(class_def.filepath): continue state.current_class = class_name make_rst_class(class_def, state, args.dry_run, args.output) + group_name = get_class_group(class_def, state) + + if group_name not in grouped_classes: + grouped_classes[group_name] = [] + grouped_classes[group_name].append(class_name) + + print("") + print("Generating the index file...") + + make_rst_index(grouped_classes, args.dry_run, args.output) + print("") if state.num_warnings >= 2: @@ -655,6 +687,42 @@ def translate(string: str) -> str: return strings_l10n.get(string, string) +def get_git_branch() -> str: + if hasattr(version, "docs") and version.docs != "latest": + return version.docs + + return "master" + + +def get_class_group(class_def: ClassDef, state: State) -> str: + group_name = "variant" + class_name = class_def.name + + if class_name.startswith("@"): + group_name = "global" + elif class_def.inherits: + inherits = class_def.inherits.strip() + + while inherits in state.classes: + if inherits == "Node": + group_name = "node" + break + if inherits == "Resource": + group_name = "resource" + break + if inherits == "Object": + group_name = "object" + break + + inode = state.classes[inherits].inherits + if inode: + inherits = inode.strip() + else: + break + + return group_name + + # Generator methods. @@ -672,10 +740,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Warn contributors not to edit this file directly. # Also provide links to the source files for reference. - git_branch = "master" - if hasattr(version, "docs") and version.docs != "latest": - git_branch = version.docs - + git_branch = get_git_branch() source_xml_path = os.path.relpath(class_def.filepath, root_directory).replace("\\", "/") source_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/{source_xml_path}" generator_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/doc/tools/make_rst.py" @@ -723,15 +788,30 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: f.write(make_type(child, state)) f.write("\n\n") + has_description = False + # Brief description - if class_def.brief_description is not None: + if class_def.brief_description is not None and class_def.brief_description.strip() != "": + has_description = True + f.write(f"{format_text_block(class_def.brief_description.strip(), class_def, state)}\n\n") # Class description if class_def.description is not None and class_def.description.strip() != "": + has_description = True + f.write(make_heading("Description", "-")) f.write(f"{format_text_block(class_def.description.strip(), class_def, state)}\n\n") + if not has_description: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) + # Online tutorials if len(class_def.tutorials) > 0: f.write(make_heading("Tutorials", "-")) @@ -872,6 +952,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this annotation. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -904,6 +992,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if property_def.text is not None and property_def.text.strip() != "": f.write(f"{format_text_block(property_def.text.strip(), property_def, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -925,6 +1021,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this constructor. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -945,6 +1049,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -956,17 +1068,24 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: for i, m in enumerate(method_list): if index != 0: f.write("----\n\n") - - if i == 0: - f.write( - f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}_{m.return_type.type_name}:\n\n" - ) - + out = f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}" + for parameter in m.parameters: + out += f"_{parameter.type_name.type_name}" + out += f":\n\n" + f.write(out) ret_type, signature = make_method_signature(class_def, m, "", state) f.write(f"- {ret_type} {signature}\n\n") if m.description is not None and m.description.strip() != "": f.write(f"{format_text_block(m.description.strip(), m, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this operator. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -992,6 +1111,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if theme_item_def.text is not None and theme_item_def.text.strip() != "": f.write(f"{format_text_block(theme_item_def.text.strip(), theme_item_def, state)}\n\n") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) index += 1 @@ -1051,7 +1178,10 @@ def make_method_signature( if isinstance(definition, MethodDef) and ref_type != "": if ref_type == "operator": op_name = definition.name.replace("<", "\\<") # So operator "<" gets correctly displayed. - out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}_{definition.return_type.type_name}>` " + out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}" + for parameter in definition.parameters: + out += f"_{parameter.type_name.type_name}" + out += f">` " else: out += f":ref:`{definition.name}<class_{class_def.name}_{ref_type}_{definition.name}>` " else: @@ -1142,6 +1272,53 @@ def make_link(url: str, title: str) -> str: return f"`{url} <{url}>`__" +def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_dir: str) -> None: + + if dry_run: + f = open(os.devnull, "w", encoding="utf-8") + else: + f = open(os.path.join(output_dir, "index.rst"), "w", encoding="utf-8") + + # Remove the "Edit on Github" button from the online docs page. + f.write(":github_url: hide\n\n") + + # Warn contributors not to edit this file directly. + # Also provide links to the source files for reference. + + git_branch = get_git_branch() + generator_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/doc/tools/make_rst.py" + + f.write(".. DO NOT EDIT THIS FILE!!!\n") + f.write(".. Generated automatically from Godot engine sources.\n") + f.write(f".. Generator: {generator_github_url}.\n\n") + + f.write(".. _doc_class_reference:\n\n") + + main_title = translate("All classes") + f.write(f"{main_title}\n") + f.write(f"{'=' * len(main_title)}\n\n") + + for group_name in CLASS_GROUPS: + if group_name in grouped_classes: + group_title = translate(CLASS_GROUPS[group_name]) + + f.write(f"{group_title}\n") + f.write(f"{'=' * len(group_title)}\n\n") + + f.write(".. toctree::\n") + f.write(" :maxdepth: 1\n") + f.write(f" :name: toc-class-ref-{group_name}s\n") + f.write("\n") + + if group_name in CLASS_GROUPS_BASE: + f.write(f" class_{CLASS_GROUPS_BASE[group_name].lower()}\n") + + for class_name in grouped_classes[group_name]: + f.write(f" class_{class_name.lower()}\n") + + f.write("\n") + + # Formatting helpers. |