diff options
Diffstat (limited to 'doc/classes')
125 files changed, 1244 insertions, 532 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 1b57569582..e30034495c 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -16,7 +16,7 @@ <return type="Variant" /> <param index="0" name="x" type="Variant" /> <description> - Returns the absolute value of a [Variant] parameter [param x] (i.e. non-negative value). Variant types [int], [float] (real), [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. + Returns the absolute value of a [Variant] parameter [param x] (i.e. non-negative value). Variant types [int], [float], [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. [codeblock] var a = abs(-1) # a is 1 @@ -114,7 +114,7 @@ <param index="3" name="end" type="float" /> <param index="4" name="t" type="float" /> <description> - Returns the point at the given [param t] on a one-dimnesional [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. + Returns the point 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="bytes_to_var"> @@ -143,7 +143,7 @@ i = ceil(1.001) # i is 2.0 [/codeblock] See also [method floor], [method round], and [method snapped]. - [b]Note:[/b] For better type safety, you can use [method ceilf], [method ceili], [method Vector2.ceil], [method Vector3.ceil] or [method Vector4.ceil] instead. + [b]Note:[/b] For better type safety, see [method ceilf], [method ceili], [method Vector2.ceil], [method Vector3.ceil] and [method Vector4.ceil]. </description> </method> <method name="ceilf"> @@ -151,7 +151,7 @@ <param index="0" name="x" type="float" /> <description> Rounds [param x] upward (towards positive infinity), returning the smallest whole number that is not less than [param x]. - A type-safe version of [method ceil], specialzied in floats. + A type-safe version of [method ceil], returning a [float]. </description> </method> <method name="ceili"> @@ -159,7 +159,7 @@ <param index="0" name="x" type="float" /> <description> Rounds [param x] upward (towards positive infinity), returning the smallest whole number that is not less than [param x]. - A type-safe version of [method ceil] that returns integer. + A type-safe version of [method ceil], returning an [int]. </description> </method> <method name="clamp"> @@ -168,7 +168,7 @@ <param index="1" name="min" type="Variant" /> <param index="2" name="max" type="Variant" /> <description> - Clamps the [Variant] [param value] and returns a value not less than [param min] and not more than [param max]. Variant types [int], [float] (real), [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. + Clamps the [param value], returning a [Variant] not less than [param min] and not more than [param max]. Variant types [int], [float], [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. [codeblock] var a = clamp(-10, -1, 5) # a is -1 @@ -196,15 +196,13 @@ <param index="1" name="min" type="float" /> <param index="2" name="max" type="float" /> <description> - Clamps the float [param value] and returns a value not less than [param min] and not more than [param max]. + Clamps the [param value], returning a [float] not less than [param min] and not more than [param max]. [codeblock] var speed = 42.1 - # a is 20.0 - var a = clampf(speed, 1.0, 20.0) + var a = clampf(speed, 1.0, 20.5) # a is 20.5 speed = -10.0 - # a is -1.0 - a = clampf(speed, -1.0, 1.0) + var b = clampf(speed, -1.0, 1.0) # b is -1.0 [/codeblock] </description> </method> @@ -214,15 +212,13 @@ <param index="1" name="min" type="int" /> <param index="2" name="max" type="int" /> <description> - Clamps the integer [param value] and returns a value not less than [param min] and not more than [param max]. + Clamps the [param value], returning an [int] not less than [param min] and not more than [param max]. [codeblock] var speed = 42 - # a is 20 - var a = clampi(speed, 1, 20) + var a = clampi(speed, 1, 20) # a is 20 speed = -10 - # a is -1 - a = clampi(speed, -1, 1) + var b = clampi(speed, -1, 1) # b is -1 [/codeblock] </description> </method> @@ -244,8 +240,7 @@ <description> Returns the hyperbolic cosine of [param x] in radians. [codeblock] - # Prints 1.543081 - print(cosh(1)) + print(cosh(1)) # Prints 1.543081 [/codeblock] </description> </method> @@ -257,7 +252,7 @@ <param index="3" name="post" type="float" /> <param index="4" name="weight" type="float" /> <description> - Cubic interpolates between two values by the factor defined in [param weight] with pre and post values. + Cubic interpolates between two values by the factor defined in [param weight] with [param pre] and [param post] values. </description> </method> <method name="cubic_interpolate_angle"> @@ -268,7 +263,7 @@ <param index="3" name="post" type="float" /> <param index="4" name="weight" type="float" /> <description> - Cubic interpolates between two rotation values with shortest path by the factor defined in [param weight] with pre and post values. See also [method lerp_angle]. + Cubic interpolates between two rotation values with shortest path by the factor defined in [param weight] with [param pre] and [param post] values. See also [method lerp_angle]. </description> </method> <method name="cubic_interpolate_angle_in_time"> @@ -282,7 +277,7 @@ <param index="6" name="pre_t" type="float" /> <param index="7" name="post_t" type="float" /> <description> - Cubic interpolates between two rotation values with shortest path by the factor defined in [param weight] with pre and post values. See also [method lerp_angle]. + Cubic interpolates between two rotation values with shortest path by the factor defined in [param weight] with [param pre] and [param post] values. See also [method lerp_angle]. It can perform smoother interpolation than [code]cubic_interpolate()[/code] by the time values. </description> </method> @@ -297,8 +292,8 @@ <param index="6" name="pre_t" type="float" /> <param index="7" name="post_t" type="float" /> <description> - Cubic interpolates between two values by the factor defined in [param weight] with pre and post values. - It can perform smoother interpolation than [code]cubic_interpolate()[/code] by the time values. + Cubic interpolates between two values by the factor defined in [param weight] with [param pre] and [param post] values. + It can perform smoother interpolation than [method cubic_interpolate] by the time values. </description> </method> <method name="db_to_linear"> @@ -314,8 +309,7 @@ <description> Converts an angle expressed in degrees to radians. [codeblock] - # r is 3.141593 - var r = deg_to_rad(180) + var r = deg_to_rad(180) # r is 3.141593 [/codeblock] </description> </method> @@ -342,7 +336,13 @@ <return type="String" /> <param index="0" name="error" type="int" /> <description> - Returns a human-readable name for the given error code. + Returns a human-readable name for the given [enum Error] code. + [codeblock] + print(OK) # Prints 0 + print(error_string(OK)) # Prints OK + print(error_string(ERR_BUSY)) # Prints Busy + print(error_string(ERR_OUT_OF_MEMORY)) # Prints Out of memory + [/codeblock] </description> </method> <method name="exp"> @@ -363,13 +363,11 @@ <description> Rounds [param x] downward (towards negative infinity), returning the largest whole number that is not more than [param x]. Supported types: [int], [float], [Vector2], [Vector3], [Vector4]. [codeblock] - # a is 2.0 - var a = floor(2.99) - # a is -3.0 - a = floor(-2.99) + var a = floor(2.99) # a is 2.0 + a = floor(-2.99) # a is -3.0 [/codeblock] See also [method ceil], [method round], and [method snapped]. - [b]Note:[/b] For better type safety, you can use [method floorf], [method floori], [method Vector2.floor], [method Vector3.floor] or [method Vector4.floor] instead. + [b]Note:[/b] For better type safety, see [method floorf], [method floori], [method Vector2.floor], [method Vector3.floor] and [method Vector4.floor]. </description> </method> <method name="floorf"> @@ -377,7 +375,7 @@ <param index="0" name="x" type="float" /> <description> Rounds [param x] downward (towards negative infinity), returning the largest whole number that is not more than [param x]. - A type-safe version of [method floor], specialzied in floats. + A type-safe version of [method floor], returning a [float]. </description> </method> <method name="floori"> @@ -385,7 +383,8 @@ <param index="0" name="x" type="float" /> <description> Rounds [param x] downward (towards negative infinity), returning the largest whole number that is not more than [param x]. - Equivalent of doing [code]int(x)[/code]. + A type-safe version of [method floor], returning an [int]. + [b]Note:[/b] This function is [i]not[/i] the same as [code]int(x)[/code], which rounds towards 0. </description> </method> <method name="fmod"> @@ -393,10 +392,9 @@ <param index="0" name="x" type="float" /> <param index="1" name="y" type="float" /> <description> - Returns the floating-point remainder of [code]x/y[/code], keeping the sign of [param x]. + Returns the floating-point remainder of [param x] divided by [param y], keeping the sign of [param x]. [codeblock] - # Remainder is 1.5 - var remainder = fmod(7, 5.5) + var remainder = fmod(7, 5.5) # remainder is 1.5 [/codeblock] For the integer remainder operation, use the [code]%[/code] operator. </description> @@ -406,21 +404,23 @@ <param index="0" name="x" type="float" /> <param index="1" name="y" type="float" /> <description> - Returns the floating-point modulus of [code]x/y[/code] that wraps equally in positive and negative. + Returns the floating-point modulus of [param x] divided by [param y], wrapping equally in positive and negative. [codeblock] + print(" (x) (fmod(x, 1.5)) (fposmod(x, 1.5))") for i in 7: - var x = 0.5 * i - 1.5 - print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) + var x = i * 0.5 - 1.5 + print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) [/codeblock] Produces: [codeblock] - -1.5 -0.0 0.0 - -1.0 -1.0 0.5 - -0.5 -0.5 1.0 - 0.0 0.0 0.0 - 0.5 0.5 0.5 - 1.0 1.0 1.0 - 1.5 0.0 0.0 + (x) (fmod(x, 1.5)) (fposmod(x, 1.5)) + -1.5 -0.0 | 0.0 + -1.0 -1.0 | 0.5 + -0.5 -0.5 | 1.0 + 0.0 0.0 | 0.0 + 0.5 0.5 | 0.5 + 1.0 1.0 | 1.0 + 1.5 0.0 | 0.0 [/codeblock] </description> </method> @@ -428,7 +428,7 @@ <return type="int" /> <param index="0" name="variable" type="Variant" /> <description> - Returns the integer hash of the variable passed. + Returns the integer hash of the passed [param variable]. [codeblock] print(hash("a")) # Prints 177670 [/codeblock] @@ -438,7 +438,7 @@ <return type="Object" /> <param index="0" name="instance_id" type="int" /> <description> - Returns the Object that corresponds to [param instance_id]. All Objects have a unique instance ID. + Returns the [Object] that corresponds to [param instance_id]. All Objects have a unique instance ID. See also [method Object.get_instance_id]. [codeblock] var foo = "bar" func _ready(): @@ -458,12 +458,13 @@ [codeblock] # The interpolation ratio in the `lerp()` call below is 0.75. var middle = lerp(20, 30, 0.75) - # `middle` is now 27.5. + # middle is now 27.5. + # Now, we pretend to have forgotten the original ratio and want to get it back. var ratio = inverse_lerp(20, 30, 27.5) - # `ratio` is now 0.75. + # ratio is now 0.75. [/codeblock] - See also [method lerp] which performs the reverse of this operation, and [method remap] to map a continuous series of values to another. + See also [method lerp], which performs the reverse of this operation, and [method remap] to map a continuous series of values to another. </description> </method> <method name="is_equal_approx"> @@ -472,15 +473,22 @@ <param index="1" name="b" type="float" /> <description> Returns [code]true[/code] if [param a] and [param b] are approximately equal to each other. - Here, approximately equal means that [param a] and [param b] are within a small internal epsilon of each other, which scales with the magnitude of the numbers. + Here, "approximately equal" means that [param a] and [param b] are within a small internal epsilon of each other, which scales with the magnitude of the numbers. Infinity values of the same sign are considered equal. </description> </method> + <method name="is_finite"> + <return type="bool" /> + <param index="0" name="x" type="float" /> + <description> + Returns whether [code]x[/code] is a finite value, i.e. it is not [constant @GDScript.NAN], positive infinity, or negative infinity. + </description> + </method> <method name="is_inf"> <return type="bool" /> <param index="0" name="x" type="float" /> <description> - Returns whether [param x] is an infinity value (either positive infinity or negative infinity). + Returns [code]true[/code] if [param x] is either positive infinity or negative infinity. </description> </method> <method name="is_instance_id_valid"> @@ -494,14 +502,14 @@ <return type="bool" /> <param index="0" name="instance" type="Variant" /> <description> - Returns whether [param instance] is a valid object (e.g. has not been deleted from memory). + Returns [code]true[/code] if [param instance] is a valid Object (e.g. has not been deleted from memory). </description> </method> <method name="is_nan"> <return type="bool" /> <param index="0" name="x" type="float" /> <description> - Returns whether [param x] is a NaN ("Not a Number" or invalid) value. + Returns [code]true[/code] if [param x] is a NaN ("Not a Number" or invalid) value. </description> </method> <method name="is_zero_approx"> @@ -509,7 +517,7 @@ <param index="0" name="x" type="float" /> <description> Returns [code]true[/code] if [param x] is zero or almost zero. - This method is faster than using [method is_equal_approx] with one value as zero. + This function is faster than using [method is_equal_approx] with one value as zero. </description> </method> <method name="lerp"> @@ -518,13 +526,13 @@ <param index="1" name="to" type="Variant" /> <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]. Use [method clamp] on the result of [method lerp] if this is not desired. - Both [param from] and [param to] must have matching types. Supported types: [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis]. + 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]. [codeblock] lerp(0, 4, 0.75) # Returns 3.0 [/codeblock] See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep]. See also [method remap] to map a continuous series of values to another. - [b]Note:[/b] For better type safety, you can use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp] or [method Basis.slerp] instead. + [b]Note:[/b] For better type safety, use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp] or [method Basis.slerp]. </description> </method> <method name="lerp_angle"> @@ -533,7 +541,7 @@ <param index="1" name="to" type="float" /> <param index="2" name="weight" type="float" /> <description> - Linearly interpolates between two angles (in radians) by a normalized value. + Linearly interpolates between two angles (in radians) by a [param weight] value between 0.0 and 1.0. Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU]. To perform eased interpolation with [method lerp_angle], combine it with [method ease] or [method smoothstep]. [codeblock] extends Sprite @@ -544,7 +552,7 @@ rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta [/codeblock] - [b]Note:[/b] This method lerps through the shortest path between [param from] and [param to]. However, when these two angles are approximately [code]PI + k * TAU[/code] apart for any integer [code]k[/code], it's not obvious which way they lerp due to floating-point precision errors. For example, [code]lerp_angle(0, PI, weight)[/code] lerps counter-clockwise, while [code]lerp_angle(0, PI + 5 * TAU, weight)[/code] lerps clockwise. + [b]Note:[/b] This function lerps through the shortest path between [param from] and [param to]. However, when these two angles are approximately [code]PI + k * TAU[/code] apart for any integer [code]k[/code], it's not obvious which way they lerp due to floating-point precision errors. For example, [code]lerp_angle(0, PI, weight)[/code] lerps counter-clockwise, while [code]lerp_angle(0, PI + 5 * TAU, weight)[/code] lerps clockwise. </description> </method> <method name="lerpf"> @@ -553,7 +561,7 @@ <param index="1" name="to" type="float" /> <param index="2" name="weight" type="float" /> <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]. + 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 clampf] on the result of this function. [codeblock] lerp(0, 4, 0.75) # Returns 3.0 [/codeblock] @@ -577,7 +585,7 @@ <return type="float" /> <param index="0" name="x" type="float" /> <description> - Natural logarithm. The amount of time needed to reach a certain level of continuous growth. + Returns the natural logarithm of [param x]. This is the amount of time needed to reach a certain level of continuous growth. [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. [codeblock] log(10) # Returns 2.302585 @@ -588,7 +596,7 @@ <method name="max" qualifiers="vararg"> <return type="Variant" /> <description> - Returns the maximum of the given values. This method can take any number of arguments. + Returns the maximum of the given values. This function can take any number of arguments. [codeblock] max(1, 7, 3, -6, 5) # Returns 7 [/codeblock] @@ -599,9 +607,9 @@ <param index="0" name="a" type="float" /> <param index="1" name="b" type="float" /> <description> - Returns the maximum of two float values. + Returns the maximum of two [float] values. [codeblock] - maxf(3.6, 24) # Returns 24.0 + maxf(3.6, 24) # Returns 24.0 maxf(-3.99, -4) # Returns -3.99 [/codeblock] </description> @@ -611,9 +619,9 @@ <param index="0" name="a" type="int" /> <param index="1" name="b" type="int" /> <description> - Returns the maximum of two int values. + Returns the maximum of two [int] values. [codeblock] - maxi(1, 2) # Returns 2 + maxi(1, 2) # Returns 2 maxi(-3, -4) # Returns -3 [/codeblock] </description> @@ -621,7 +629,7 @@ <method name="min" qualifiers="vararg"> <return type="Variant" /> <description> - Returns the minimum of the given values. This method can take any number of arguments. + Returns the minimum of the given values. This function can take any number of arguments. [codeblock] min(1, 7, 3, -6, 5) # Returns -6 [/codeblock] @@ -632,9 +640,9 @@ <param index="0" name="a" type="float" /> <param index="1" name="b" type="float" /> <description> - Returns the minimum of two float values. + Returns the minimum of two [float] values. [codeblock] - minf(3.6, 24) # Returns 3.6 + minf(3.6, 24) # Returns 3.6 minf(-3.99, -4) # Returns -4.0 [/codeblock] </description> @@ -644,9 +652,9 @@ <param index="0" name="a" type="int" /> <param index="1" name="b" type="int" /> <description> - Returns the minimum of two int values. + Returns the minimum of two [int] values. [codeblock] - mini(1, 2) # Returns 1 + mini(1, 2) # Returns 1 mini(-3, -4) # Returns -4 [/codeblock] </description> @@ -660,8 +668,8 @@ Moves [param from] toward [param to] by the [param delta] value. Use a negative [param delta] value to move away. [codeblock] - move_toward(5, 10, 4) # Returns 9 - move_toward(10, 5, 4) # Returns 6 + move_toward(5, 10, 4) # Returns 9 + move_toward(10, 5, 4) # Returns 6 move_toward(10, 5, -1.5) # Returns 11.5 [/codeblock] </description> @@ -670,17 +678,17 @@ <return type="int" /> <param index="0" name="value" type="int" /> <description> - Returns the nearest equal or larger power of 2 for integer [param value]. + Returns the nearest equal or larger power of 2 for the integer [param value]. In other words, returns the smallest value [code]a[/code] where [code]a = pow(2, n)[/code] such that [code]value <= a[/code] for some non-negative integer [code]n[/code]. [codeblock] nearest_po2(3) # Returns 4 nearest_po2(4) # Returns 4 nearest_po2(5) # Returns 8 - nearest_po2(0) # Returns 0 (this may not be what you expect) - nearest_po2(-1) # Returns 0 (this may not be what you expect) + nearest_po2(0) # Returns 0 (this may not be expected) + nearest_po2(-1) # Returns 0 (this may not be expected) [/codeblock] - [b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [param value] (in reality, 1 is the smallest integer power of 2). + [b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for negative values of [param value] (in reality, 1 is the smallest integer power of 2). </description> </method> <method name="pingpong"> @@ -688,18 +696,18 @@ <param index="0" name="value" type="float" /> <param index="1" name="length" type="float" /> <description> - Returns the [param value] wrapped between [code]0[/code] and the [param length]. If the limit is reached, the next value the function returned is decreased to the [code]0[/code] side or increased to the [param length] side (like a triangle wave). If [param length] is less than zero, it becomes positive. + Wraps [param value] between [code]0[/code] and the [param length]. If the limit is reached, the next value the function returns is decreased to the [code]0[/code] side or increased to the [param length] side (like a triangle wave). If [param length] is less than zero, it becomes positive. [codeblock] - pingpong(-3.0, 3.0) # Returns 3 - pingpong(-2.0, 3.0) # Returns 2 - pingpong(-1.0, 3.0) # Returns 1 - pingpong(0.0, 3.0) # Returns 0 - pingpong(1.0, 3.0) # Returns 1 - pingpong(2.0, 3.0) # Returns 2 - pingpong(3.0, 3.0) # Returns 3 - pingpong(4.0, 3.0) # Returns 2 - pingpong(5.0, 3.0) # Returns 1 - pingpong(6.0, 3.0) # Returns 0 + pingpong(-3.0, 3.0) # Returns 3.0 + pingpong(-2.0, 3.0) # Returns 2.0 + pingpong(-1.0, 3.0) # Returns 1.0 + pingpong(0.0, 3.0) # Returns 0.0 + pingpong(1.0, 3.0) # Returns 1.0 + pingpong(2.0, 3.0) # Returns 2.0 + pingpong(3.0, 3.0) # Returns 3.0 + pingpong(4.0, 3.0) # Returns 2.0 + pingpong(5.0, 3.0) # Returns 1.0 + pingpong(6.0, 3.0) # Returns 0.0 [/codeblock] </description> </method> @@ -708,20 +716,22 @@ <param index="0" name="x" type="int" /> <param index="1" name="y" type="int" /> <description> - Returns the integer modulus of [code]x/y[/code] that wraps equally in positive and negative. + Returns the integer modulus of [param x] divided by [param y] that wraps equally in positive and negative. [codeblock] + print("#(i) (i % 3) (posmod(i, 3))") for i in range(-3, 4): - print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) + print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)]) [/codeblock] Produces: [codeblock] - -3 0 0 - -2 -2 1 - -1 -1 2 - 0 0 0 - 1 1 1 - 2 2 2 - 3 0 0 + (i) (i % 3) (posmod(i, 3)) + -3 0 | 0 + -2 -2 | 1 + -1 -1 | 2 + 0 0 | 0 + 1 1 | 1 + 2 2 | 2 + 3 0 | 0 [/codeblock] </description> </method> @@ -731,6 +741,7 @@ <param index="1" name="exp" type="float" /> <description> Returns the result of [param base] raised to the power of [param exp]. + In GDScript, this is the equivalent of the [code]**[/code] operator. [codeblock] pow(2, 5) # Returns 32 [/codeblock] @@ -743,7 +754,7 @@ var a = [1, 2, 3] print("a", "b", a) # Prints ab[1, 2, 3] [/codeblock] - [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. + [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. </description> </method> <method name="print_rich" qualifiers="vararg"> @@ -771,11 +782,12 @@ </method> <method name="printraw" qualifiers="vararg"> <description> - Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. + 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. [codeblock] printraw("A") printraw("B") - # Prints AB + printraw("C") + # Prints ABC [/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> @@ -802,7 +814,7 @@ [codeblock] push_error("test error") # Prints "test error" to debugger and terminal as error call [/codeblock] - [b]Note:[/b] Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead. + [b]Note:[/b] This function does not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead. </description> </method> <method name="push_warning" qualifiers="vararg"> @@ -820,6 +832,8 @@ Converts an angle expressed in radians to degrees. [codeblock] rad_to_deg(0.523599) # Returns 30 + rad_to_deg(PI) # Returns 180 + rad_to_deg(PI * 2) # Returns 360 [/codeblock] </description> </method> @@ -827,7 +841,14 @@ <return type="PackedInt64Array" /> <param index="0" name="seed" type="int" /> <description> - Random from seed: pass a [param seed], and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. + Given a [param seed], returns a [PackedInt64Array] of size [code]2[/code], where its first element is the randomised [int] value, and the second element is the same as [param seed]. Passing the same [param seed] consistently returns the same array. + [b]Note:[/b] "Seed" here refers to the internal state of the pseudo random number generator, currently implemented as a 64 bit integer. + [codeblock] + var a = rand_from_seed(4) + + print(a[0]) # Prints 2879024997 + print(a[1]) # Prints 4 + [/codeblock] </description> </method> <method name="randf"> @@ -844,9 +865,10 @@ <param index="0" name="from" type="float" /> <param index="1" name="to" type="float" /> <description> - Returns a random floating point value on the interval between [param from] and [param to] (inclusive). + Returns a random floating point value between [param from] and [param to] (inclusive). [codeblock] - prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 + randf_range(0, 20.5) # Returns e.g. 7.45315 + randf_range(-10, 10) # Returns e.g. -3.844535 [/codeblock] </description> </method> @@ -877,15 +899,15 @@ <description> Returns a random signed 32-bit integer between [param from] and [param to] (inclusive). If [param to] is lesser than [param from], they are swapped. [codeblock] - print(randi_range(0, 1)) # Prints 0 or 1 - print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 + randi_range(0, 1) # Returns either 0 or 1 + randi_range(-10, 1000) # Returns random integer between -10 and 1000 [/codeblock] </description> </method> <method name="randomize"> <description> - Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. - [b]Note:[/b] This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use [method seed] to initialize the random number generator. + Randomizes the seed (or the internal state) of the random number generator. The current implementation uses a number based on the device's time. + [b]Note:[/b] This function is called automatically when the project is run. If you need to fix the seed to have consistent, reproducible results, use [method seed] to initialize the random number generator. </description> </method> <method name="remap"> @@ -896,63 +918,67 @@ <param index="3" name="ostart" type="float" /> <param index="4" name="ostop" type="float" /> <description> - Maps a [param value] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. See also [method lerp] and [method inverse_lerp]. If [param value] is outside [code][istart, istop][/code], then the resulting value will also be outside [code][ostart, ostop][/code]. Use [method clamp] on the result of [method remap] if this is not desired. + Maps a [param value] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. See also [method lerp] and [method inverse_lerp]. If [param value] is outside [code][istart, istop][/code], then the resulting value will also be outside [code][ostart, ostop][/code]. If this is not desired, use [method clamp] on the result of this function. [codeblock] remap(75, 0, 100, -1, 1) # Returns 0.5 [/codeblock] - For complex use cases where you need multiple ranges, consider using [Curve] or [Gradient] instead. + For complex use cases where multiple ranges are needed, consider using [Curve] or [Gradient] instead. </description> </method> <method name="rid_allocate_id"> <return type="int" /> <description> - Allocate a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers. + Allocates a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers. </description> </method> <method name="rid_from_int64"> <return type="RID" /> <param index="0" name="base" type="int" /> <description> - Create a RID from an int64. This is used mainly from native extensions to build servers. + Creates a RID from a [param base]. This is used mainly from native extensions to build servers. </description> </method> <method name="round"> <return type="Variant" /> <param index="0" name="x" type="Variant" /> <description> - Rounds [param x] to the nearest whole number, with halfway cases rounded away from zero. Supported types: [int], [float], [Vector2], [Vector3], [Vector4]. + Rounds [param x] to the nearest whole number, with halfway cases rounded away from 0. Supported types: [int], [float], [Vector2], [Vector3], [Vector4]. [codeblock] round(2.4) # Returns 2 round(2.5) # Returns 3 round(2.6) # Returns 3 [/codeblock] See also [method floor], [method ceil], and [method snapped]. - [b]Note:[/b] For better type safety, you can use [method roundf], [method roundi], [method Vector2.round], [method Vector3.round] or [method Vector4.round] instead. + [b]Note:[/b] For better type safety, use [method roundf], [method roundi], [method Vector2.round], [method Vector3.round] or [method Vector4.round], instead. </description> </method> <method name="roundf"> <return type="float" /> <param index="0" name="x" type="float" /> <description> - Rounds [param x] to the nearest whole number, with halfway cases rounded away from zero. - A type-safe version of [method round], specialzied in floats. + Rounds [param x] to the nearest whole number, with halfway cases rounded away from 0. + A type-safe version of [method round], returning a [float]. </description> </method> <method name="roundi"> <return type="int" /> <param index="0" name="x" type="float" /> <description> - Rounds [param x] to the nearest whole number, with halfway cases rounded away from zero. - A type-safe version of [method round] that returns integer. + Rounds [param x] to the nearest whole number, with halfway cases rounded away from 0. + A type-safe version of [method round], returning an [int]. </description> </method> <method name="seed"> <param index="0" name="base" type="int" /> <description> - Sets seed for the random number generator. + Sets the seed for the random number generator to [param base]. Setting the seed manually can ensure consistent, repeatable results for most random functions. [codeblock] - var my_seed = "Godot Rocks" - seed(my_seed.hash()) + var my_seed = "Godot Rocks".hash() + seed(my_seed) + var a = randf() + randi() + seed(my_seed) + var b = randf() + randi() + # a and b are now identical [/codeblock] </description> </method> @@ -960,7 +986,7 @@ <return type="Variant" /> <param index="0" name="x" type="Variant" /> <description> - Returns the sign of [param x] as same type of [Variant] as [param x] with each component being -1, 0 and 1 for each negative, zero and positive values respectivelu. Variant types [int], [float] (real), [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. + Returns the sign of [param x] as same type of [Variant] as [param x] with each component being -1, 0 and 1 for each negative, zero and positive values respectively. Variant types [int], [float], [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported. [codeblock] sign(-6.0) # Returns -1 sign(0.0) # Returns 0 @@ -974,11 +1000,11 @@ <return type="float" /> <param index="0" name="x" type="float" /> <description> - Returns the sign of [param x] as a float: -1.0 or 1.0. Returns 0.0 if [param x] is 0. + Returns the sign of [param x] as a [float]: -1.0 or 1.0. Returns 0.0 if [param x] is 0.0. [codeblock] - sign(-6.0) # Returns -1.0 + sign(-6.5) # Returns -1.0 sign(0.0) # Returns 0.0 - sign(6.0) # Returns 1.0 + sign(6.5) # Returns 1.0 [/codeblock] </description> </method> @@ -986,7 +1012,7 @@ <return type="int" /> <param index="0" name="x" type="int" /> <description> - Returns the sign of [param x] as an integer: -1 or 1. Returns 0 if [param x] is 0. + Returns the sign of [param x] as an [int]: -1 or 1. Returns 0 if [param x] is 0. [codeblock] sign(-6) # Returns -1 sign(0) # Returns 0 @@ -1040,7 +1066,7 @@ <param index="0" name="x" type="float" /> <param index="1" name="step" type="float" /> <description> - Snaps float value [param x] to a given [param step]. This can also be used to round a floating point number to an arbitrary number of decimals. + Snaps the float value [param x] to a given [param step]. This can also be used to round a floating point number to an arbitrary number of decimals. [codeblock] snapped(100, 32) # Returns 96 snapped(3.14159, 0.01) # Returns 3.14 @@ -1054,9 +1080,11 @@ <description> Returns the square root of [param x], where [param x] is a non-negative number. [codeblock] - sqrt(9) # Returns 3 + sqrt(9) # Returns 3 + sqrt(10.24) # Returns 3.2 + sqrt(-1) # Returns NaN [/codeblock] - [b]Note:[/b] Negative values of [param x] return NaN. If you need negative inputs, use [code]System.Numerics.Complex[/code] in C#. + [b]Note:[/b] Negative values of [param x] return NaN ("Not a Number"). in C#, if you need negative inputs, use [code]System.Numerics.Complex[/code]. </description> </method> <method name="step_decimals"> @@ -1065,30 +1093,27 @@ <description> Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. [codeblock] - # n is 0 - var n = step_decimals(5) - # n is 4 - n = step_decimals(1.0005) - # n is 9 - n = step_decimals(0.000000005) + var n = step_decimals(5) # n is 0 + n = step_decimals(1.0005) # n is 4 + n = step_decimals(0.000000005) # n is 9 [/codeblock] </description> </method> <method name="str" qualifiers="vararg"> <return type="String" /> <description> - Converts one or more arguments of any type to string in the best way possible. + Converts one or more arguments of any [Variant] type to [String] in the best way possible. </description> </method> <method name="str_to_var"> <return type="Variant" /> <param index="0" name="string" type="String" /> <description> - Converts a formatted [param string] that was returned by [method var_to_str] to the original value. + Converts a formatted [param string] that was returned by [method var_to_str] to the original [Variant]. [codeblock] - var a = '{ "a": 1, "b": 2 }' - var b = str_to_var(a) - print(b["a"]) # Prints 1 + var a = '{ "a": 1, "b": 2 }' # a is a String + var b = str_to_var(a) # b is a Dictionary + print(b["a"]) # Prints 1 [/codeblock] </description> </method> @@ -1109,7 +1134,7 @@ Returns the hyperbolic tangent of [param x]. [codeblock] var a = log(2.0) # Returns 0.693147 - tanh(a) # Returns 0.6 + tanh(a) # Returns 0.6 [/codeblock] </description> </method> @@ -1117,7 +1142,7 @@ <return type="int" /> <param index="0" name="variable" type="Variant" /> <description> - Returns the internal type of the given Variant object, using the [enum Variant.Type] values. + Returns the internal type of the given [param variable], using the [enum Variant.Type] values. [codeblock] var json = JSON.new() json.parse('["a", "b", "c"]') @@ -1141,19 +1166,19 @@ <return type="PackedByteArray" /> <param index="0" name="variable" type="Variant" /> <description> - Encodes a [Variant] value to a byte array. Encoding objects is allowed (and can potentially include code). Deserialization can be done with [method bytes_to_var_with_objects]. + Encodes a [Variant] value to a byte array. Encoding objects is allowed (and can potentially include executable code). Deserialization can be done with [method bytes_to_var_with_objects]. </description> </method> <method name="var_to_str"> <return type="String" /> <param index="0" name="variable" type="Variant" /> <description> - Converts a Variant [param variable] to a formatted string that can later be parsed using [method str_to_var]. + Converts a [Variant] [param variable] to a formatted [String] that can then be parsed using [method str_to_var]. [codeblock] a = { "a": 1, "b": 2 } print(var_to_str(a)) [/codeblock] - prints + Prints: [codeblock] { "a": 1, @@ -1166,7 +1191,7 @@ <return type="Variant" /> <param index="0" name="obj" type="Variant" /> <description> - Returns a weak reference to an object, or [code]null[/code] if the argument is invalid. + Returns a weak reference to an object, or [code]null[/code] if [param obj] is invalid. A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it. </description> </method> @@ -1176,9 +1201,8 @@ <param index="1" name="min" type="Variant" /> <param index="2" name="max" type="Variant" /> <description> - Wraps the [Variant] [param value] between [param min] and [param max]. - Usable for creating loop-alike behavior or infinite surfaces. - Variant types [int] and [float] (real) are supported. If any of the argument is [float] the result will be [float], otherwise it is [int]. + Wraps the [Variant] [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. + Variant types [int] and [float] are supported. If any of the arguments is [float] this function returns a [float], otherwise it returns an [int]. [codeblock] var a = wrap(4, 5, 10) # a is 9 (int) @@ -1197,8 +1221,7 @@ <param index="1" name="min" type="float" /> <param index="2" name="max" type="float" /> <description> - Wraps float [param value] between [param min] and [param max]. - Usable for creating loop-alike behavior or infinite surfaces. + Wraps the float [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. [codeblock] # Infinite loop between 5.0 and 9.9 value = wrapf(value + 0.1, 5.0, 10.0) @@ -1221,8 +1244,7 @@ <param index="1" name="min" type="int" /> <param index="2" name="max" type="int" /> <description> - Wraps integer [param value] between [param min] and [param max]. - Usable for creating loop-alike behavior or infinite surfaces. + Wraps the integer [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. [codeblock] # Infinite loop between 5 and 9 frame = wrapi(frame + 1, 5, 10) @@ -1283,6 +1305,7 @@ The [Marshalls] singleton. </member> <member name="NativeExtensionManager" type="NativeExtensionManager" setter="" getter=""> + The [NativeExtensionManager] singleton. </member> <member name="NavigationMeshGenerator" type="NavigationMeshGenerator" setter="" getter=""> The [NavigationMeshGenerator] singleton. @@ -1377,8 +1400,10 @@ General horizontal alignment, usually used for [Separator], [ScrollBar], [Slider], etc. </constant> <constant name="CLOCKWISE" value="0" enum="ClockDirection"> + Clockwise rotation. Used by some methods (e.g. [method Image.rotate_90]). </constant> <constant name="COUNTERCLOCKWISE" value="1" enum="ClockDirection"> + Counter-clockwise rotation. Used by some methods (e.g. [method Image.rotate_90]). </constant> <constant name="HORIZONTAL_ALIGNMENT_LEFT" value="0" enum="HorizontalAlignment"> Horizontal left alignment, usually for text-derived classes. @@ -1873,34 +1898,34 @@ / key. </constant> <constant name="KEY_0" value="48" enum="Key"> - Number 0. + Number 0 key. </constant> <constant name="KEY_1" value="49" enum="Key"> - Number 1. + Number 1 key. </constant> <constant name="KEY_2" value="50" enum="Key"> - Number 2. + Number 2 key. </constant> <constant name="KEY_3" value="51" enum="Key"> - Number 3. + Number 3 key. </constant> <constant name="KEY_4" value="52" enum="Key"> - Number 4. + Number 4 key. </constant> <constant name="KEY_5" value="53" enum="Key"> - Number 5. + Number 5 key. </constant> <constant name="KEY_6" value="54" enum="Key"> - Number 6. + Number 6 key. </constant> <constant name="KEY_7" value="55" enum="Key"> - Number 7. + Number 7 key. </constant> <constant name="KEY_8" value="56" enum="Key"> - Number 8. + Number 8 key. </constant> <constant name="KEY_9" value="57" enum="Key"> - Number 9. + Number 9 key. </constant> <constant name="KEY_COLON" value="58" enum="Key"> : key. @@ -2260,10 +2285,10 @@ Enum value which doesn't correspond to any mouse button. This is used to initialize [enum MouseButton] properties with a generic state. </constant> <constant name="MOUSE_BUTTON_LEFT" value="1" enum="MouseButton"> - Primary mouse button, usually the left button. + Primary mouse button, usually assigned to the left button. </constant> <constant name="MOUSE_BUTTON_RIGHT" value="2" enum="MouseButton"> - Secondary mouse button, usually the right button. + Secondary mouse button, usually assigned to the right button. </constant> <constant name="MOUSE_BUTTON_MIDDLE" value="3" enum="MouseButton"> Middle mouse button. @@ -2281,10 +2306,10 @@ Mouse wheel right button (only present on some mice). </constant> <constant name="MOUSE_BUTTON_XBUTTON1" value="8" enum="MouseButton"> - Extra mouse button 1 (only present on some mice). + Extra mouse button 1. This is sometimes present, usually to the sides of the mouse. </constant> <constant name="MOUSE_BUTTON_XBUTTON2" value="9" enum="MouseButton"> - Extra mouse button 2 (only present on some mice). + Extra mouse button 2. This is sometimes present, usually to the sides of the mouse. </constant> <constant name="MOUSE_BUTTON_MASK_LEFT" value="1" enum="MouseButton"> Primary mouse button mask, usually for the left button. @@ -2350,7 +2375,7 @@ Game controller D-pad right button. </constant> <constant name="JOY_BUTTON_MISC1" value="15" enum="JoyButton"> - Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo capture button. + Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo Switch capture button. </constant> <constant name="JOY_BUTTON_PADDLE1" value="16" enum="JoyButton"> Game controller SDL paddle 1 button. @@ -2372,9 +2397,9 @@ </constant> <constant name="JOY_BUTTON_MAX" value="128" enum="JoyButton"> The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: - - Android: Up to 36 buttons. - - Linux: Up to 80 buttons. - - Windows and macOS: Up to 128 buttons. + - [b]Android:[/b] Up to 36 buttons. + - [b]Linux:[/b] Up to 80 buttons. + - [b]Windows[/b] and [b]macOS:[/b] Up to 128 buttons. </constant> <constant name="JOY_AXIS_INVALID" value="-1" enum="JoyAxis"> An invalid game controller axis. @@ -2461,16 +2486,18 @@ MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself. </constant> <constant name="OK" value="0" enum="Error"> - Methods that return [enum Error] return [constant OK] when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. - Since [constant OK] has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: + Methods that return [enum Error] return [constant OK] when no error occurred. + Since [constant OK] has value 0, and all other error constants are positive integers, it can also be used in boolean checks. For example: [codeblock] - var err = method_that_returns_error() - if err != OK: - print("Failure!") - # Or, equivalent: - if err: - print("Still failing!") + var error = method_that_returns_error() + if error != OK: + printerr("Failure!") + + # Or, alternatively: + if error: + printerr("Still failing!") [/codeblock] + [b]Note:[/b] Many functions do not return an error code, but will print error messages to standard output. </constant> <constant name="FAILED" value="1" enum="Error"> Generic error. @@ -2608,100 +2635,101 @@ Skip error. </constant> <constant name="ERR_HELP" value="46" enum="Error"> - Help error. + Help error. Used internally when passing [code]--version[/code] or [code]--help[/code] as executable options. </constant> <constant name="ERR_BUG" value="47" enum="Error"> - Bug error. + Bug error, caused by an implementation issue in the method. + [b]Note:[/b] If a built-in method returns this code, please open an issue on [url=https://github.com/godotengine/godot/issues]the GitHub Issue Tracker[/url]. </constant> <constant name="ERR_PRINTER_ON_FIRE" value="48" enum="Error"> - Printer on fire error. (This is an easter egg, no engine methods return this error code.) + Printer on fire error (This is an easter egg, no built-in methods return this error code). </constant> <constant name="PROPERTY_HINT_NONE" value="0" enum="PropertyHint"> - No hint for the edited property. + The property has no hint for the editor. </constant> <constant name="PROPERTY_HINT_RANGE" value="1" enum="PropertyHint"> - Hints that an integer or float property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_less"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,or_greater,or_less"[/code]. + Hints that an [int] or [float] property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_less"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,or_greater,or_less"[/code]. Additionally, other keywords can be included: [code]"exp"[/code] for exponential range editing, [code]"radians"[/code] for editing radian angles in degrees, [code]"degrees"[/code] to hint at an angle and [code]"hide_slider"[/code] to hide the slider. </constant> <constant name="PROPERTY_HINT_ENUM" value="2" enum="PropertyHint"> - Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string. - The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. For integer and float properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending [code]:integer[/code] to the name, e.g. [code]"Zero,One,Three:3,Four,Six:6"[/code]. + Hints that an [int], [float], or [String] property is an enumerated value to pick in a list specified via a hint string. + The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. Whitespaces are [b]not[/b] removed from either end of a name. For integer and float properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending [code]:integer[/code] to the name, e.g. [code]"Zero,One,Three:3,Four,Six:6"[/code]. </constant> <constant name="PROPERTY_HINT_ENUM_SUGGESTION" value="3" enum="PropertyHint"> - Hints that a string property can be an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. - Unlike [constant PROPERTY_HINT_ENUM] a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. + Hints that a [String] property can be an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. + Unlike [constant PROPERTY_HINT_ENUM], a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. </constant> <constant name="PROPERTY_HINT_EXP_EASING" value="4" enum="PropertyHint"> - Hints that a float property should be edited via an exponential easing function. The hint string can include [code]"attenuation"[/code] to flip the curve horizontally and/or [code]"positive_only"[/code] to exclude in/out easing and limit values to be greater than or equal to zero. + Hints that a [float] property should be edited via an exponential easing function. The hint string can include [code]"attenuation"[/code] to flip the curve horizontally and/or [code]"positive_only"[/code] to exclude in/out easing and limit values to be greater than or equal to zero. </constant> <constant name="PROPERTY_HINT_LINK" value="5" enum="PropertyHint"> - Hints that a vector property should allow linking values (e.g. to edit both [code]x[/code] and [code]y[/code] together). + Hints that a vector property should allow its components to be linked. For example, this allows [member Vector2.x] and [member Vector2.y] to be edited together. </constant> <constant name="PROPERTY_HINT_FLAGS" value="6" enum="PropertyHint"> - Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like [code]"Bit0,Bit1,Bit2,,Bit4"[/code]. + Hints that an [int] property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like [code]"Bit0,Bit1,Bit2,,Bit4"[/code]. </constant> <constant name="PROPERTY_HINT_LAYERS_2D_RENDER" value="7" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 2D render layers. + Hints that an [int] property is a bitmask using the optionally named 2D render layers. </constant> <constant name="PROPERTY_HINT_LAYERS_2D_PHYSICS" value="8" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 2D physics layers. + Hints that an [int] property is a bitmask using the optionally named 2D physics layers. </constant> <constant name="PROPERTY_HINT_LAYERS_2D_NAVIGATION" value="9" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + Hints that an [int] property is a bitmask using the optionally named 2D navigation layers. </constant> <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="10" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 3D render layers. + Hints that an [int] property is a bitmask using the optionally named 3D render layers. </constant> <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="11" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 3D physics layers. + Hints that an [int] property is a bitmask using the optionally named 3D physics layers. </constant> <constant name="PROPERTY_HINT_LAYERS_3D_NAVIGATION" value="12" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 3D navigation layers. + Hints that an [int] property is a bitmask using the optionally named 3D navigation layers. </constant> <constant name="PROPERTY_HINT_FILE" value="13" enum="PropertyHint"> - Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. + Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. </constant> <constant name="PROPERTY_HINT_DIR" value="14" enum="PropertyHint"> - Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. + Hints that a [String] property is a path to a directory. Editing it will show a file dialog for picking the path. </constant> <constant name="PROPERTY_HINT_GLOBAL_FILE" value="15" enum="PropertyHint"> - Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. + Hints that a [String] property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards, like [code]"*.png,*.jpg"[/code]. </constant> <constant name="PROPERTY_HINT_GLOBAL_DIR" value="16" enum="PropertyHint"> - Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. + Hints that a [String] property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. </constant> <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="17" enum="PropertyHint"> Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. [code]"Texture2D"[/code]). Editing it will show a popup menu of valid resource types to instantiate. </constant> <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="18" enum="PropertyHint"> - Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. + Hints that a [String] property is text with line breaks. Editing it will show a text input field where line breaks can be typed. </constant> <constant name="PROPERTY_HINT_EXPRESSION" value="19" enum="PropertyHint"> - Hints that a string property is an [Expression]. + Hints that a [String] property is an [Expression]. </constant> <constant name="PROPERTY_HINT_PLACEHOLDER_TEXT" value="20" enum="PropertyHint"> - Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. + Hints that a [String] property should show a placeholder text on its input field, if empty. The hint string is the placeholder text to use. </constant> <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="21" enum="PropertyHint"> - Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. + 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. + Hints that an image is compressed using lossy compression. The editor does not internally use this property hint. </constant> <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="23" enum="PropertyHint"> - Hints that an image is compressed using lossless compression. + 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"> - 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: + 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. For example: [codeblock] - hint_string = "%s:" % [TYPE_INT] # Array of inteters. + hint_string = "%s:" % [TYPE_INT] # Array of integers. hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats. hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources. hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources. [/codeblock] - [b]Note:[/b] The final colon is required to specify for properly detecting built-in types. + [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> @@ -2722,6 +2750,7 @@ <constant name="PROPERTY_HINT_PROPERTY_OF_SCRIPT" value="34" 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> <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="36" enum="PropertyHint"> </constant> @@ -2731,39 +2760,42 @@ </constant> <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="39" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_INT_IS_POINTER" value="41" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_POINTER" value="40" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_ARRAY_TYPE" value="40" enum="PropertyHint"> + <constant name="PROPERTY_HINT_ARRAY_TYPE" value="41" 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. + 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. + 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> <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="45" enum="PropertyHint"> - Hints that a quaternion property should disable the temporary euler editor. + 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, and every character is replaced with the secret character. + 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> <constant name="PROPERTY_HINT_MAX" value="47" enum="PropertyHint"> + Represents the size of the [enum PropertyHint] enum. </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. </constant> <constant name="PROPERTY_USAGE_STORAGE" value="2" enum="PropertyUsageFlags"> The property is serialized and saved in the scene file (default). </constant> <constant name="PROPERTY_USAGE_EDITOR" value="4" enum="PropertyUsageFlags"> - The property is shown in the editor inspector (default). + The property is shown in the [EditorInspector] (default). </constant> <constant name="PROPERTY_USAGE_CHECKABLE" value="8" enum="PropertyUsageFlags"> - The property can be checked in the editor inspector. + The property can be checked in the [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_CHECKED" value="16" enum="PropertyUsageFlags"> - The property is checked in the editor inspector. + The property is checked in the [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="32" enum="PropertyUsageFlags"> The property is a translatable string. @@ -2803,8 +2835,10 @@ <constant name="PROPERTY_USAGE_INTERNAL" value="524288" enum="PropertyUsageFlags"> </constant> <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="1048576" enum="PropertyUsageFlags"> + If the property is a [Resource], a new copy of it is always created when calling [method Node.duplicate] or [method Resource.duplicate]. </constant> <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="2097152" enum="PropertyUsageFlags"> + The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). </constant> <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="4194304" enum="PropertyUsageFlags"> </constant> @@ -2819,9 +2853,10 @@ <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags"> </constant> <constant name="PROPERTY_USAGE_READ_ONLY" value="268435456" enum="PropertyUsageFlags"> - The property is read-only in the editor inspector. + The property is read-only in the [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_ARRAY" value="536870912" enum="PropertyUsageFlags"> + The property is an array. </constant> <constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags"> Default usage (storage, editor and network). @@ -2845,14 +2880,16 @@ Flag for a virtual method. </constant> <constant name="METHOD_FLAG_VARARG" value="16" enum="MethodFlags"> + Flag for a method with a variable number of arguments. </constant> <constant name="METHOD_FLAG_STATIC" value="32" enum="MethodFlags"> + Flag for a static method. </constant> <constant name="METHOD_FLAG_OBJECT_CORE" value="64" enum="MethodFlags"> - Used internally. Allows to not dump core virtuals such as [code]_notification[/code] to the JSON API. + Used internally. Allows to not dump core virtual methods (such as [method Object._notification]) to the JSON API. </constant> <constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags"> - Default method flags. + Default method flags (normal). </constant> <constant name="TYPE_NIL" value="0" enum="Variant.Type"> Variable is [code]null[/code]. @@ -2864,7 +2901,7 @@ Variable is of type [int]. </constant> <constant name="TYPE_FLOAT" value="3" enum="Variant.Type"> - Variable is of type [float] (real). + Variable is of type [float]. </constant> <constant name="TYPE_STRING" value="4" enum="Variant.Type"> Variable is of type [String]. @@ -2891,8 +2928,10 @@ Variable is of type [Transform2D]. </constant> <constant name="TYPE_VECTOR4" value="12" enum="Variant.Type"> + Variable is of type [Vector4]. </constant> <constant name="TYPE_VECTOR4I" value="13" enum="Variant.Type"> + Variable is of type [Vector4i]. </constant> <constant name="TYPE_PLANE" value="14" enum="Variant.Type"> Variable is of type [Plane]. @@ -2910,6 +2949,7 @@ Variable is of type [Transform3D]. </constant> <constant name="TYPE_PROJECTION" value="19" enum="Variant.Type"> + Variable is of type [Projection]. </constant> <constant name="TYPE_COLOR" value="20" enum="Variant.Type"> Variable is of type [Color]. diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index 23dd41f275..ca454cafa3 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -188,6 +188,7 @@ <param index="0" name="from" type="Vector3" /> <param index="1" name="dir" type="Vector3" /> <description> + Returns [code]true[/code] if the given ray intersects with this [AABB]. Ray length is infinite. </description> </method> <method name="intersects_segment" qualifiers="const"> @@ -205,6 +206,12 @@ Returns [code]true[/code] if this [AABB] and [param aabb] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this [AABB] is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="merge" qualifiers="const"> <return type="AABB" /> <param index="0" name="with" type="AABB" /> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 6e76df647e..2414b068e6 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -271,7 +271,7 @@ <return type="void" /> <param index="0" name="num_nodes" type="int" /> <description> - Reserves space internally for [param num_nodes] points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. + Reserves space internally for [param num_nodes] points, useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. </description> </method> <method name="set_point_disabled"> diff --git a/doc/classes/AStar3D.xml b/doc/classes/AStar3D.xml index 45b1019bab..4e8394195d 100644 --- a/doc/classes/AStar3D.xml +++ b/doc/classes/AStar3D.xml @@ -298,7 +298,7 @@ <return type="void" /> <param index="0" name="num_nodes" type="int" /> <description> - Reserves space internally for [param num_nodes] points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. + Reserves space internally for [param num_nodes] points. Useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. </description> </method> <method name="set_point_disabled"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index df0fb11ac7..008296713d 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -26,6 +26,7 @@ [/csharp] [/codeblocks] Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types. + [b]Note:[/b] 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. </description> <tutorials> <link title="Animation documentation index">$DOCS_URL/tutorials/animation/index.html</link> @@ -209,6 +210,7 @@ <param index="1" name="time" type="float" /> <param index="2" name="amount" type="float" /> <description> + Inserts a key in a given blend shape track. Returns the key index. </description> </method> <method name="clear"> @@ -223,6 +225,8 @@ <param index="1" name="fps" type="int" default="120" /> <param index="2" name="split_tolerance" type="float" default="4.0" /> <description> + Compress the animation and all its tracks in-place. This will make [method track_is_compressed] return [code]true[/code] once called on this [Animation]. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions. + [b]Note:[/b] Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them. </description> </method> <method name="copy_track"> @@ -278,6 +282,7 @@ <param index="1" name="time" type="float" /> <param index="2" name="position" type="Vector3" /> <description> + Inserts a key in a given 3D position track. Returns the key index. </description> </method> <method name="remove_track"> @@ -293,6 +298,7 @@ <param index="1" name="time" type="float" /> <param index="2" name="rotation" type="Quaternion" /> <description> + Inserts a key in a given 3D rotation track. Returns the key index. </description> </method> <method name="scale_track_insert_key"> @@ -301,6 +307,7 @@ <param index="1" name="time" type="float" /> <param index="2" name="scale" type="Vector3" /> <description> + Inserts a key in a given 3D scale track. Returns the key index. </description> </method> <method name="track_find_key" qualifiers="const"> @@ -385,6 +392,7 @@ <return type="bool" /> <param index="0" name="track_idx" type="int" /> <description> + Returns [code]true[/code] if the track is compressed, [code]false[/code] otherwise. See also [method compress]. </description> </method> <method name="track_is_enabled" qualifiers="const"> @@ -569,15 +577,19 @@ </signals> <constants> <constant name="TYPE_VALUE" value="0" enum="TrackType"> - Value tracks set values in node properties, but only those which can be Interpolated. + 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. </constant> <constant name="TYPE_POSITION_3D" value="1" enum="TrackType"> + 3D position track (values are stored in [Vector3]s). </constant> <constant name="TYPE_ROTATION_3D" value="2" enum="TrackType"> + 3D rotation track (values are stored in [Quaternion]s). </constant> <constant name="TYPE_SCALE_3D" value="3" enum="TrackType"> + 3D scale track (values are stored in [Vector3]s). </constant> <constant name="TYPE_BLEND_SHAPE" value="4" enum="TrackType"> + Blend shape track. </constant> <constant name="TYPE_METHOD" value="5" enum="TrackType"> Method tracks call functions with given arguments per key. @@ -598,7 +610,7 @@ Linear interpolation. </constant> <constant name="INTERPOLATION_CUBIC" value="2" enum="InterpolationType"> - Cubic interpolation. + Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to [constant INTERPOLATION_LINEAR] for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return. </constant> <constant name="INTERPOLATION_LINEAR_ANGLE" value="3" enum="InterpolationType"> Linear interpolation with shortest path rotation. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index b7ac1ff7f8..9efd3ac939 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -217,7 +217,7 @@ </member> <member name="current_animation" type="String" setter="set_current_animation" getter="get_current_animation" default=""""> The key of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [method play] for more information on playing animations. - [b]Note:[/b] while this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation]. + [b]Note:[/b] While this property appears in the Inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation]. </member> <member name="current_animation_length" type="float" setter="" getter="get_current_animation_length"> The length (in seconds) of the currently playing animation. @@ -242,7 +242,7 @@ The process notification in which to update animations. </member> <member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> - The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. + The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. </member> <member name="reset_on_save" type="bool" setter="set_reset_on_save_enabled" getter="is_reset_on_save_enabled" default="true"> This is used by the editor. If set to [code]true[/code], the scene will be saved with the effects of the reset animation (the animation with the key [code]"RESET"[/code]) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving. @@ -268,6 +268,11 @@ [b]Note:[/b] This signal is not emitted if an animation is looping. </description> </signal> + <signal name="animation_libraries_updated"> + <description> + Notifies when the animation libraries have changed. + </description> + </signal> <signal name="animation_list_changed"> <description> Notifies when an animation list is changed. diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index ce49be9bc1..ea8cab324d 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -110,11 +110,11 @@ <member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount" default="0.0"> The degree to which this area applies reverb to its associated audio. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision. </member> - <member name="reverb_bus_enable" type="bool" setter="set_use_reverb_bus" getter="is_using_reverb_bus" default="false"> + <member name="reverb_bus_enabled" type="bool" setter="set_use_reverb_bus" getter="is_using_reverb_bus" default="false"> If [code]true[/code], the area applies reverb to its associated audio. </member> - <member name="reverb_bus_name" type="StringName" setter="set_reverb_bus" getter="get_reverb_bus" default="&"Master""> - The reverb bus name to use for this area's associated audio. + <member name="reverb_bus_name" type="StringName" setter="set_reverb_bus_name" getter="get_reverb_bus_name" default="&"Master""> + The name of the reverb bus to use for this area's associated audio. </member> <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" default="0.0"> The degree to which this area's reverb is a uniform effect. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision. diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index d8c4b8fdb5..b8e0ac0c2a 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -58,6 +58,7 @@ <param index="2" name="class_name" type="StringName" /> <param index="3" name="script" type="Variant" /> <description> + Creates a typed array from the [param base] array. The base array can't be already typed. See [method set_typed] for more details. </description> </constructor> <constructor name="Array"> @@ -271,6 +272,7 @@ array.Fill(0); // Initialize the 10 elements to 0. [/csharp] [/codeblocks] + [b]Note:[/b] If [param value] is of a reference type ([Object]-derived, [Array], [Dictionary], etc.) then the array is filled with the references to the same object, i.e. no duplicates are created. </description> </method> <method name="filter" qualifiers="const"> @@ -315,16 +317,19 @@ <method name="get_typed_builtin" qualifiers="const"> <return type="int" /> <description> + Returns the [code]TYPE[/code] constant for a typed array. If the [Array] is not typed, returns [constant @GlobalScope.TYPE_NIL]. </description> </method> <method name="get_typed_class_name" qualifiers="const"> <return type="StringName" /> <description> + Returns a class name of a typed [Array] of type [constant @GlobalScope.TYPE_OBJECT]. </description> </method> <method name="get_typed_script" qualifiers="const"> <return type="Variant" /> <description> + Returns the script associated with a typed array tied to a class name. </description> </method> <method name="has" qualifiers="const"> @@ -393,11 +398,13 @@ <method name="is_read_only" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the array is read-only. See [method set_read_only]. Arrays are automatically read-only if declared with [code]const[/code] keyword. </description> </method> <method name="is_typed" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the array is typed. Typed arrays can only store elements of their associated type and provide type safety for the [code][][/code] operator. Methods of typed array still return [Variant]. </description> </method> <method name="map" qualifiers="const"> @@ -429,6 +436,16 @@ Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> + <method name="pick_random" qualifiers="const"> + <return type="Variant" /> + <description> + Returns a random value from the target array. + [codeblock] + var array: Array[int] = [1, 2, 3, 4] + print(array.pick_random()) # Prints either of the four numbers. + [/codeblock] + </description> + </method> <method name="pop_at"> <return type="Variant" /> <param index="0" name="position" type="int" /> @@ -517,6 +534,7 @@ <return type="void" /> <param index="0" name="enable" type="bool" /> <description> + Makes the [Array] read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays. </description> </method> <method name="set_typed"> @@ -525,6 +543,8 @@ <param index="1" name="class_name" type="StringName" /> <param index="2" name="script" type="Variant" /> <description> + Makes the [Array] typed. The [param type] should be one of the [@GlobalScope] [code]TYPE[/code] constants. [param class_name] is optional and can only be provided for [constant @GlobalScope.TYPE_OBJECT]. [param script] can only be provided if [param class_name] is not empty. + The method fails if an array is already typed. </description> </method> <method name="shuffle"> @@ -557,6 +577,7 @@ <return type="void" /> <description> Sorts the array. + [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that values considered equal may have their order changed when using [method sort]. [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: [codeblocks] [gdscript] @@ -581,7 +602,8 @@ <param index="0" name="func" type="Callable" /> <description> Sorts the array using a custom method. The custom method receives two arguments (a pair of elements from the array) and must return either [code]true[/code] or [code]false[/code]. For two elements [code]a[/code] and [code]b[/code], if the given method returns [code]true[/code], element [code]b[/code] will be after element [code]a[/code] in the array. - [b]Note:[/b] You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. + [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that values considered equal may have their order changed when using [method sort_custom]. + [b]Note:[/b] You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Randomizing the return value will result in unexpected behavior. [codeblocks] [gdscript] func sort_ascending(a, b): @@ -608,6 +630,7 @@ <return type="bool" /> <param index="0" name="array" type="Array" /> <description> + Assigns a different [Array] to this array reference. It the array is typed, the new array's type must be compatible and its elements will be automatically converted. </description> </method> </methods> diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index 1c02dbd3ce..c16198c5c6 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -27,7 +27,7 @@ <method name="get_frames_available" qualifiers="const"> <return type="int" /> <description> - Returns the number of audio data frames left to play. If this returned number reaches [code]0[/code], the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking. + Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is [code]0[/code], the buffer is full. </description> </method> <method name="get_skips" qualifiers="const"> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 02192a9b7c..11d6e9cc7a 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -7,7 +7,7 @@ Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting [member attenuation_filter_cutoff_hz] to [code]20500[/code]. By default, audio is heard from the camera position. This can be changed by adding an [AudioListener3D] node to the scene and enabling it by calling [method AudioListener3D.make_current] on it. See also [AudioStreamPlayer] to play a sound non-positionally. - [b]Note:[/b] Hiding an [AudioStreamPlayer3D] node does not disable its audio output. To temporarily disable an [AudioStreamPlayer3D]'s audio output, set [member unit_db] to a very low value like [code]-100[/code] (which isn't audible to human hearing). + [b]Note:[/b] Hiding an [AudioStreamPlayer3D] node does not disable its audio output. To temporarily disable an [AudioStreamPlayer3D]'s audio output, set [member volume_db] to a very low value like [code]-100[/code] (which isn't audible to human hearing). </description> <tutorials> <link title="Audio streams">$DOCS_URL/tutorials/audio/audio_streams.html</link> @@ -102,12 +102,12 @@ <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> If [code]true[/code], the playback is paused. You can resume it by setting [member stream_paused] to [code]false[/code]. </member> - <member name="unit_db" type="float" setter="set_unit_db" getter="get_unit_db" default="0.0"> - The base sound level unaffected by dampening, in decibels. - </member> <member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size" default="10.0"> The factor for the attenuation effect. Higher values make the sound audible over a larger distance. </member> + <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> + The base sound level unaffected by dampening, in decibels. + </member> </members> <signals> <signal name="finished"> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 629675132a..47e1f85c97 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -68,9 +68,6 @@ <member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut"> [Shortcut] associated to the button. </member> - <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> - The [Node] which must be a parent of the focused GUI [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. - </member> <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled"> If [code]true[/code], the button will add information about its shortcut in the tooltip. </member> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index cbb58a3e1e..de980eab0c 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -115,7 +115,7 @@ The color used by the backlight effect. Represents the light passing through an object. </member> <member name="backlight_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> - If [code]true[/code], the backlight effect is enabled. + If [code]true[/code], the backlight effect is enabled. See also [member subsurf_scatter_transmittance_enabled]. </member> <member name="backlight_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture used to control the backlight effect per-pixel. Added to [member backlight]. @@ -289,6 +289,7 @@ [b]Note:[/b] If [member detail_enabled] is [code]true[/code], the [member detail_albedo] texture is drawn [i]below[/i] the [member normal_texture]. To display a normal map [i]above[/i] the [member detail_albedo] texture, use [member detail_normal] instead. </member> <member name="orm_texture" type="Texture2D" setter="set_texture" getter="get_texture"> + The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of [member ao_texture], [member roughness_texture] and [member metallic_texture] in [ORMMaterial3D]. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored. </member> <member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames"> The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. @@ -305,7 +306,7 @@ <member name="proximity_fade_distance" type="float" setter="set_proximity_fade_distance" getter="get_proximity_fade_distance" default="1.0"> Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. </member> - <member name="proximity_fade_enable" type="bool" setter="set_proximity_fade" getter="is_proximity_fade_enabled" default="false"> + <member name="proximity_fade_enabled" type="bool" setter="set_proximity_fade_enabled" getter="is_proximity_fade_enabled" default="false"> If [code]true[/code], the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. </member> <member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -350,13 +351,13 @@ </member> <member name="specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" enum="BaseMaterial3D.SpecularMode" default="0"> The method for rendering the specular blob. See [enum SpecularMode]. - [b]Note:[/b] Only applies to the specular blob. Does not affect specular reflections from the Sky, SSR, or ReflectionProbes. + [b]Note:[/b] [member specular_mode] only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, [VoxelGI], SDFGI or [ReflectionProbe]s. To disable reflections from these sources as well, set [member metallic_specular] to [code]0.0[/code] instead. </member> <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. </member> <member name="subsurf_scatter_skin_mode" type="bool" setter="set_flag" getter="get_flag" default="false"> - If [code]true[/code], subsurface scattering will use a special mode optimized for the color and density of human skin. + If [code]true[/code], subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering. </member> <member name="subsurf_scatter_strength" type="float" setter="set_subsurface_scattering_strength" getter="get_subsurface_scattering_strength" default="0.0"> The strength of the subsurface scattering effect. @@ -365,14 +366,19 @@ Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength]. </member> <member name="subsurf_scatter_transmittance_boost" type="float" setter="set_transmittance_boost" getter="get_transmittance_boost" default="0.0"> + The intensity of the subsurface scattering transmittance effect. </member> <member name="subsurf_scatter_transmittance_color" type="Color" setter="set_transmittance_color" getter="get_transmittance_color" default="Color(1, 1, 1, 1)"> + The color to multiply the subsurface scattering transmittance effect with. Ignored if [member subsurf_scatter_skin_mode] is [code]true[/code]. </member> <member name="subsurf_scatter_transmittance_depth" type="float" setter="set_transmittance_depth" getter="get_transmittance_depth" default="0.1"> + The depth of the subsurface scattering transmittance effect. </member> <member name="subsurf_scatter_transmittance_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> + If [code]true[/code], enables subsurface scattering transmittance. Only effective if [member subsurf_scatter_enabled] is [code]true[/code]. See also [member backlight_enabled]. </member> <member name="subsurf_scatter_transmittance_texture" type="Texture2D" setter="set_texture" getter="get_texture"> + The texture to use for multiplying the intensity of the subsurface scattering transmitteance intensity. See also [member subsurf_scatter_texture]. Ignored if [member subsurf_scatter_skin_mode] is [code]true[/code]. </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="BaseMaterial3D.TextureFilter" default="3"> Filter flags for the texture. See [enum TextureFilter] for options. @@ -385,6 +391,7 @@ If [code]true[/code], transparency is enabled on the body. See also [member blend_mode]. </member> <member name="use_particle_trails" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. </member> <member name="use_point_size" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], render point size can be changed. @@ -682,6 +689,7 @@ Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin. </constant> <constant name="FLAG_PARTICLE_TRAILS_MODE" value="19" enum="Flags"> + Enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. </constant> <constant name="FLAG_ALBEDO_TEXTURE_MSDF" value="20" enum="Flags"> Enables multichannel signed distance field rendering shader. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 6d9b679fbc..652d6d2407 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -70,6 +70,7 @@ <param index="0" name="euler" type="Vector3" /> <param index="1" name="order" type="int" default="2" /> <description> + Constructs a pure rotation Basis matrix from Euler angles in the specified Euler rotation order. By default, use YXZ order (most common). </description> </method> <method name="from_scale" qualifiers="static"> @@ -112,6 +113,12 @@ Returns [code]true[/code] if this basis and [param b] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this basis is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="looking_at" qualifiers="static"> <return type="Basis" /> <param index="0" name="target" type="Vector3" /> @@ -191,16 +198,22 @@ </members> <constants> <constant name="EULER_ORDER_XYZ" value="0"> + Euler angle composing/decomposing order where X component is first, then Y, then Z. </constant> <constant name="EULER_ORDER_XZY" value="1"> + Euler angle composing/decomposing order where X component is first, then Z, then Y. </constant> <constant name="EULER_ORDER_YXZ" value="2"> + Euler angle composing/decomposing order where Y component is first, then X, then Z. </constant> <constant name="EULER_ORDER_YZX" value="3"> + Euler angle composing/decomposing order where Y component is first, then Z, then X. </constant> <constant name="EULER_ORDER_ZXY" value="4"> + Euler angle composing/decomposing order where Z component is first, then X, then Y. </constant> <constant name="EULER_ORDER_ZYX" value="5"> + Euler angle composing/decomposing order where Z component is first, then Y, then X. </constant> <constant name="IDENTITY" value="Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)"> The identity basis, with no rotation or scaling applied. diff --git a/doc/classes/BoneMap.xml b/doc/classes/BoneMap.xml index f7a4845b7d..7135406d3c 100644 --- a/doc/classes/BoneMap.xml +++ b/doc/classes/BoneMap.xml @@ -8,6 +8,7 @@ By assigning the actual [Skeleton3D] bone name as the key value, it maps the [Skeleton3D] to the [SkeletonProfile]. </description> <tutorials> + <link title="Retargeting 3D Skeletons">$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html</link> </tutorials> <methods> <method name="find_profile_bone_name" qualifiers="const"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index e78cdfc951..1ff51b48be 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -11,7 +11,7 @@ func _ready(): var button = Button.new() button.text = "Click me" - button.connect("pressed", self, "_button_pressed") + button.pressed.connect(self._button_pressed) add_child(button) func _button_pressed(): @@ -22,7 +22,7 @@ { var button = new Button(); button.Text = "Click me"; - button.Connect("pressed", this, nameof(ButtonPressed)); + button.Pressed += ButtonPressed; AddChild(button); } diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 906789d09f..314e46d9d0 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -29,12 +29,14 @@ <return type="float" /> <param index="0" name="param" type="int" enum="CPUParticles2D.Parameter" /> <description> + Returns the maximum value range for the given parameter. </description> </method> <method name="get_param_min" qualifiers="const"> <return type="float" /> <param index="0" name="param" type="int" enum="CPUParticles2D.Parameter" /> <description> + Returns the minimum value range for the given parameter. </description> </method> <method name="get_particle_flag" qualifiers="const"> @@ -63,6 +65,7 @@ <param index="0" name="param" type="int" enum="CPUParticles2D.Parameter" /> <param index="1" name="value" type="float" /> <description> + Sets the maximum value for the given parameter. </description> </method> <method name="set_param_min"> @@ -70,6 +73,7 @@ <param index="0" name="param" type="int" enum="CPUParticles2D.Parameter" /> <param index="1" name="value" type="float" /> <description> + Sets the minimum value for the given parameter. </description> </method> <method name="set_particle_flag"> @@ -89,29 +93,38 @@ Each particle's rotation will be animated along this [Curve]. </member> <member name="angle_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum initial rotation applied to each particle, in degrees. </member> <member name="angle_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member angle_max]. </member> <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's angular velocity will vary along this [Curve]. </member> <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. </member> <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member angular_velocity_max]. </member> <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. </member> <member name="anim_offset_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum animation offset that corresponds to frame index in the texture. [code]0[/code] is the first frame, [code]1[/code] is the last one. See [member CanvasItemMaterial.particles_animation]. </member> <member name="anim_offset_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member anim_offset_max]. </member> <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation speed will vary along this [Curve]. </member> <member name="anim_speed_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum particle animation speed. Animation speed of [code]1[/code] means that the particles will make full [code]0[/code] to [code]1[/code] offset cycle during lifetime, [code]2[/code] means [code]2[/code] cycles etc. + With animation speed greater than [code]1[/code], remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. </member> <member name="anim_speed_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member anim_speed_max]. </member> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. @@ -126,8 +139,10 @@ Damping will vary along this [Curve]. </member> <member name="damping_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + The maximum rate at which particles lose velocity. For example value of [code]100[/code] means that the particle will go from [code]100[/code] velocity to [code]0[/code] in [code]1[/code] second. </member> <member name="damping_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member damping_max]. </member> <member name="direction" type="Vector2" setter="set_direction" getter="get_direction" default="Vector2(1, 0)"> Unit vector specifying the particles' emission direction. @@ -160,7 +175,7 @@ How rapidly particles in an emission cycle are emitted. If greater than [code]0[/code], there will be a gap in emissions before the next cycle begins. </member> <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="0"> - The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. </member> <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. @@ -172,12 +187,16 @@ Each particle's hue will vary along this [Curve]. </member> <member name="hue_variation_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum initial hue variation applied to each particle. It will shift the particle color's hue. </member> <member name="hue_variation_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member hue_variation_max]. </member> <member name="initial_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. </member> <member name="initial_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member initial_velocity_max]. </member> <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. @@ -189,8 +208,10 @@ Each particle's linear acceleration will vary along this [Curve]. </member> <member name="linear_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum linear acceleration applied to each particle in the direction of motion. </member> <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member linear_accel_max]. </member> <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="false"> If [code]true[/code], particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. If [code]false[/code], particles use global coordinates; they will not move or rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. @@ -202,8 +223,10 @@ Each particle's orbital velocity will vary along this [Curve]. </member> <member name="orbit_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. </member> <member name="orbit_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member orbit_velocity_max]. </member> <member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false"> Align Y axis of particle with the direction of its velocity. @@ -215,8 +238,10 @@ Each particle's radial acceleration will vary along this [Curve]. </member> <member name="radial_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. </member> <member name="radial_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member radial_accel_max]. </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0"> Emission lifetime randomness ratio. @@ -225,17 +250,24 @@ Each particle's scale will vary along this [Curve]. </member> <member name="scale_amount_max" type="float" setter="set_param_max" getter="get_param_max" default="1.0"> + Maximum initial scale applied to each particle. </member> <member name="scale_amount_min" type="float" setter="set_param_min" getter="get_param_min" default="1.0"> + Minimum equivalent of [member scale_amount_max]. </member> <member name="scale_curve_x" type="Curve" setter="set_scale_curve_x" getter="get_scale_curve_x"> + Each particle's horizontal scale will vary along this [Curve]. + [member split_scale] must be enabled. </member> <member name="scale_curve_y" type="Curve" setter="set_scale_curve_y" getter="get_scale_curve_y"> + Each particle's vertical scale will vary along this [Curve]. + [member split_scale] must be enabled. </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles. </member> <member name="split_scale" type="bool" setter="set_split_scale" getter="get_split_scale" default="false"> + If [code]true[/code], the scale curve will be split into x and y components. See [member scale_curve_x] and [member scale_curve_y]. </member> <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0"> Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. @@ -244,8 +276,10 @@ Each particle's tangential acceleration will vary along this [Curve]. </member> <member name="tangential_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> <member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member tangential_accel_max]. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> Particle texture. If [code]null[/code], particles will be squares. diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index 6b39c08b3f..3a15a117f5 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -28,12 +28,14 @@ <return type="float" /> <param index="0" name="param" type="int" enum="CPUParticles3D.Parameter" /> <description> + Returns the maximum value range for the given parameter. </description> </method> <method name="get_param_min" qualifiers="const"> <return type="float" /> <param index="0" name="param" type="int" enum="CPUParticles3D.Parameter" /> <description> + Returns the minimum value range for the given parameter. </description> </method> <method name="get_particle_flag" qualifiers="const"> @@ -62,7 +64,7 @@ <param index="0" name="param" type="int" enum="CPUParticles3D.Parameter" /> <param index="1" name="value" type="float" /> <description> - Sets the maximum value for the given parameter + Sets the maximum value for the given parameter. </description> </method> <method name="set_param_min"> @@ -70,7 +72,7 @@ <param index="0" name="param" type="int" enum="CPUParticles3D.Parameter" /> <param index="1" name="value" type="float" /> <description> - Sets the minimum value for the given parameter + Sets the minimum value for the given parameter. </description> </method> <method name="set_particle_flag"> @@ -187,7 +189,7 @@ How rapidly particles in an emission cycle are emitted. If greater than [code]0[/code], there will be a gap in emissions before the next cycle begins. </member> <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="0"> - The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. + The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. </member> <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0"> Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane. diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 671ecb6af1..9315a85e1f 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -52,14 +52,14 @@ <return type="Vector2" /> <description> Returns this camera's target position, in global coordinates. - [b]Note:[/b] The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member smoothing_enabled] is [code]true[/code] (see [method get_screen_center_position]). + [b]Note:[/b] The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member position_smoothing_enabled] is [code]true[/code] (see [method get_screen_center_position]). </description> </method> <method name="reset_smoothing"> <return type="void" /> <description> Sets the camera's position immediately to its current smoothing destination. - This method has no effect if [member smoothing_enabled] is [code]false[/code]. + This method has no effect if [member position_smoothing_enabled] is [code]false[/code]. </description> </method> <method name="set_drag_margin"> @@ -138,7 +138,7 @@ </member> <member name="limit_smoothed" type="bool" setter="set_limit_smoothing_enabled" getter="is_limit_smoothing_enabled" default="false"> If [code]true[/code], the camera smoothly stops when reaches its limits. - This property has no effect if [member smoothing_enabled] is [code]false[/code]. + This property has no effect if [member position_smoothing_enabled] is [code]false[/code]. [b]Note:[/b] To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing]. </member> <member name="limit_top" type="int" setter="set_limit" getter="get_limit" default="-10000000"> @@ -147,6 +147,12 @@ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. </member> + <member name="position_smoothing_enabled" type="bool" setter="set_position_smoothing_enabled" getter="is_position_smoothing_enabled" default="false"> + If [code]true[/code], the camera's view smoothly moves towards its target position at [member position_smoothing_speed]. + </member> + <member name="position_smoothing_speed" type="float" setter="set_position_smoothing_speed" getter="get_position_smoothing_speed" default="5.0"> + Speed in pixels per second of the camera's smoothing effect when [member position_smoothing_enabled] is [code]true[/code]. + </member> <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1"> The camera's process callback. See [enum Camera2DProcessCallback]. </member> @@ -157,12 +163,6 @@ <member name="rotation_smoothing_speed" type="float" setter="set_rotation_smoothing_speed" getter="get_rotation_smoothing_speed" default="5.0"> The angular, asymptotic speed of the camera's rotation smoothing effect when [member rotation_smoothing_enabled] is [code]true[/code]. </member> - <member name="smoothing_enabled" type="bool" setter="set_enable_follow_smoothing" getter="is_follow_smoothing_enabled" default="false"> - If [code]true[/code], the camera smoothly moves towards the target at [member smoothing_speed]. - </member> - <member name="smoothing_speed" type="float" setter="set_follow_smoothing" getter="get_follow_smoothing" default="5.0"> - Speed in pixels per second of the camera's smoothing effect when [member smoothing_enabled] is [code]true[/code]. - </member> <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" default="Vector2(1, 1)"> The camera's zoom. A zoom of [code]Vector(2, 2)[/code] doubles the size seen in the viewport. A zoom of [code]Vector(0.5, 0.5)[/code] halves the size seen in the viewport. </member> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 947e6a3d4c..34837478f4 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -416,7 +416,7 @@ <method name="get_global_transform" qualifiers="const"> <return type="Transform2D" /> <description> - Returns the global transform matrix of this item. + Returns the global transform matrix of this item, i.e. the combined transform up to the topmost [CanvasItem] node. The topmost item is a [CanvasItem] that either has no parent, has non-[CanvasItem] parent or it has [member top_level] enabled. </description> </method> <method name="get_global_transform_with_canvas" qualifiers="const"> @@ -535,7 +535,7 @@ </method> </methods> <members> - <member name="clip_children" type="bool" setter="set_clip_children" getter="is_clipping_children" default="false"> + <member name="clip_children" type="int" setter="set_clip_children_mode" getter="get_clip_children_mode" enum="CanvasItem.ClipChildrenMode" default="0"> Allows the current node to clip children nodes, essentially acting as a mask. </member> <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1"> @@ -653,5 +653,13 @@ <constant name="TEXTURE_REPEAT_MAX" value="4" enum="TextureRepeat"> Represents the size of the [enum TextureRepeat] enum. </constant> + <constant name="CLIP_CHILDREN_DISABLED" value="0" enum="ClipChildrenMode"> + </constant> + <constant name="CLIP_CHILDREN_ONLY" value="1" enum="ClipChildrenMode"> + </constant> + <constant name="CLIP_CHILDREN_AND_DRAW" value="2" enum="ClipChildrenMode"> + </constant> + <constant name="CLIP_CHILDREN_MAX" value="3" enum="ClipChildrenMode"> + </constant> </constants> </class> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index 50c0860d1f..7c1b19b961 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -5,6 +5,7 @@ </brief_description> <description> Canvas drawing layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). + Embedded [Window]s are placed in layer 1024. CanvasItems in layer 1025 or above appear in front of embedded windows, CanvasItems in layer 1023 or below appear behind embedded windows. </description> <tutorials> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml index ac18c2d474..2dc83790c7 100644 --- a/doc/classes/CanvasTexture.xml +++ b/doc/classes/CanvasTexture.xml @@ -1,25 +1,36 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CanvasTexture" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Texture with optional normal and specular maps for use in 2D rendering. </brief_description> <description> + [CanvasTexture] is an alternative to [ImageTexture] for 2D rendering. It allows using normal maps and specular maps in any node that inherits from [CanvasItem]. [CanvasTexture] also allows overriding the texture's filter and repeat mode independently of the node's properties (or the project settings). + [b]Note:[/b] [CanvasTexture] cannot be used in 3D rendering. For physically-based materials in 3D, use [BaseMaterial3D] instead. </description> <tutorials> </tutorials> <members> <member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture"> + The diffuse (color) texture to use. This is the main texture you want to set in most cases. </member> <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture"> + 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="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> <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0"> + The specular exponent for [Light2D] specular reflections. Higher values result in a more glossy/"wet" look, with reflections becoming more localized and less visible overall. The default value of [code]1.0[/code] disables specular reflections entirely. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. </member> <member name="specular_texture" type="Texture2D" setter="set_specular_texture" getter="get_specular_texture"> + The specular map to use for [Light2D] specular reflections. This should be a grayscale or colored texture, with brighter areas resulting in a higher [member specular_shininess] value. Using a colored [member specular_texture] allows controlling specular shininess on a per-channel basis. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> + The texture filtering mode to use when drawing this [CanvasTexture]. </member> <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0"> + The texture repeat mode to use when drawing this [CanvasTexture]. </member> </members> </class> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 2ffe880971..699e872e99 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -4,7 +4,7 @@ Binary choice user interface widget. See also [CheckButton]. </brief_description> <description> - A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. + A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For example, it could be used when toggling it will only do something once a confirmation button is pressed. See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index 2f584103be..dfbaa7cbee 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -4,7 +4,7 @@ Checkable button. See also [CheckBox]. </brief_description> <description> - CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. + CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For example, it could be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 58a536406f..5d3c6210f6 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -13,7 +13,7 @@ <return type="bool" /> <param index="0" name="class" type="StringName" /> <description> - Returns [code]true[/code] if you can instance objects from the specified [param class], [code]false[/code] in other case. + Returns [code]true[/code] if objects can be instantiated from the specified [param class], otherwise returns [code]false[/code]. </description> </method> <method name="class_exists" qualifiers="const"> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index ca482a39e0..4c62ab2a7f 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -616,8 +616,8 @@ <theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Sets the font [Color] when [member TextEdit.editable] is disabled. </theme_item> - <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> - Sets the [Color] of the selected text. [member TextEdit.override_selected_font_color] has to be enabled. + <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + Sets the [Color] of the selected text. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored. </theme_item> <theme_item name="line_length_guideline_color" data_type="color" type="Color" default="Color(0.3, 0.5, 0.8, 0.1)"> [Color] of the main line length guideline, secondary guidelines will have 50% alpha applied. diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 3a3803c1da..a11d7157f1 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -145,6 +145,11 @@ <return type="int" /> <param index="0" name="name" type="String" /> <description> + Returns the index of a named color. Use [method get_named_color] to get the actual color. + [codeblock] + var idx = Color.find_named_color("khaki") + modulate = Color.get_named_color(idx) + [/codeblock] </description> </method> <method name="from_hsv" qualifiers="static"> @@ -187,6 +192,7 @@ <return type="Color" /> <param index="0" name="rgbe" type="int" /> <description> + Encodes a [Color] from a RGBE9995 format integer. See [constant Image.FORMAT_RGBE9995]. </description> </method> <method name="from_string" qualifiers="static"> @@ -194,6 +200,7 @@ <param index="0" name="str" type="String" /> <param index="1" name="default" type="Color" /> <description> + Creates a [Color] from string, which can be either a HTML color code or a named color. Fallbacks to [param default] if the string does not denote any valid color. </description> </method> <method name="get_luminance" qualifiers="const"> @@ -208,29 +215,37 @@ <return type="Color" /> <param index="0" name="idx" type="int" /> <description> + Returns a named color with the given index. You can get the index from [method find_named_color] or iteratively from [method get_named_color_count]. </description> </method> <method name="get_named_color_count" qualifiers="static"> <return type="int" /> <description> + Returns the number of available named colors. </description> </method> <method name="get_named_color_name" qualifiers="static"> <return type="String" /> <param index="0" name="idx" type="int" /> <description> + Returns the name of a color with the given index. You can get the index from [method find_named_color] or iteratively from [method get_named_color_count]. </description> </method> <method name="hex" qualifiers="static"> <return type="Color" /> <param index="0" name="hex" type="int" /> <description> + Returns the [Color] associated with the provided integer number, with 8 bits per channel in ARGB order. The integer should be 32-bit. Best used with hexadecimal notation. + [codeblock] + modulate = Color.hex(0xffff0000) # red + [/codeblock] </description> </method> <method name="hex64" qualifiers="static"> <return type="Color" /> <param index="0" name="hex" type="int" /> <description> + Same as [method hex], but takes 64-bit integer and the color uses 16 bits per channel. </description> </method> <method name="html" qualifiers="static"> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index d09b7f003e..cd1d0b016d 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -131,6 +131,7 @@ The width of the hue selection slider. </theme_item> <theme_item name="label_width" data_type="constant" type="int" default="10"> + The minimum width of the color labels next to sliders. </theme_item> <theme_item name="margin" data_type="constant" type="int" default="4"> The margin around the [ColorPicker]. @@ -160,8 +161,10 @@ The indicator used to signalize that the color value is outside the 0-1 range. </theme_item> <theme_item name="picker_cursor" data_type="icon" type="Texture2D"> + The image displayed over the color box/circle (depending on the [member picker_shape]), marking the currently selected color. </theme_item> <theme_item name="sample_bg" data_type="icon" type="Texture2D"> + Background panel for the color preview box (visible when the color is translucent). </theme_item> <theme_item name="screen_picker" data_type="icon" type="Texture2D"> The icon for the screen color picker button. diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index d4c503857d..48b4df9126 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -8,10 +8,10 @@ To get cancel action, you can use: [codeblocks] [gdscript] - get_cancel().connect("pressed", self, "cancelled") + get_cancel_button().pressed.connect(self.cancelled) [/gdscript] [csharp] - GetCancel().Connect("pressed", this, nameof(Cancelled)); + GetCancelButton().Pressed += Cancelled; [/csharp] [/codeblocks] </description> diff --git a/doc/classes/Container.xml b/doc/classes/Container.xml index a13e1598b2..0e1ef02573 100644 --- a/doc/classes/Container.xml +++ b/doc/classes/Container.xml @@ -14,14 +14,14 @@ <method name="_get_allowed_size_flags_horizontal" qualifiers="virtual const"> <return type="PackedInt32Array" /> <description> - Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the inspector dock. + Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. [b]Note:[/b] Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. </description> </method> <method name="_get_allowed_size_flags_vertical" qualifiers="virtual const"> <return type="PackedInt32Array" /> <description> - Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the inspector dock. + Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. [b]Note:[/b] Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. </description> </method> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 9c7cb7b089..c1fa1a2bf1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -12,7 +12,7 @@ Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. - [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the inspector. + [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the Inspector. [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class. </description> <tutorials> @@ -383,7 +383,7 @@ <method name="get_global_rect" qualifiers="const"> <return type="Rect2" /> <description> - Returns the position and size of the control relative to the top-left corner of the screen. See [member position] and [member size]. + Returns the position and size of the control relative to the [CanvasLayer]. See [member global_position] and [member size]. </description> </method> <method name="get_minimum_size" qualifiers="const"> @@ -972,7 +972,7 @@ <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false"> Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. </member> - <member name="custom_minimum_size" type="Vector2i" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2i(0, 0)"> + <member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> @@ -999,7 +999,7 @@ If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. </member> <member name="global_position" type="Vector2" setter="_set_global_position" getter="get_global_position"> - The node's global position, relative to the world (usually to the top-left corner of the window). + The node's global position, relative to the world (usually to the [CanvasLayer]). </member> <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1"> Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. @@ -1051,6 +1051,9 @@ [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] 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"> + The [Node] which must be a parent of the focused [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. + </member> <member name="size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. </member> diff --git a/doc/classes/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml index 6ff142da59..dcb14ec945 100644 --- a/doc/classes/CylinderShape3D.xml +++ b/doc/classes/CylinderShape3D.xml @@ -5,6 +5,7 @@ </brief_description> <description> Cylinder shape for collisions. Like [CapsuleShape3D], but without hemispheres at the cylinder's ends. + [b]Note:[/b] There are several known bugs with cylinder collision shapes. Using [CapsuleShape3D] or [BoxShape3D] instead is recommended. [b]Performance:[/b] Being a primitive collision shape, [CylinderShape3D] is fast to check collisions against (though not as fast as [SphereShape3D]). [CylinderShape3D] is also more demanding compared to [CapsuleShape3D]. </description> <tutorials> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index a86aff060d..ac1f63af56 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -325,18 +325,21 @@ <return type="bool" /> <param index="0" name="right" type="Dictionary" /> <description> + Returns [code]true[/code] if the dictionaries differ, i.e. their key or value lists are different (including the order). </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Dictionary" /> <description> + Returns [code]true[/code] if both dictionaries have the same contents, i.e. their keys list and value list are equal. </description> </operator> <operator name="operator []"> <return type="Variant" /> <param index="0" name="key" type="Variant" /> <description> + Retunrs a value at the given [param key] or [code]null[/code] and error if the key does not exist. For safe access, use [method get] or [method has]. </description> </operator> </operators> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 0dbaa9c86f..4bb3657cf7 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="DisplayServer" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Singleton for window management functions. </brief_description> <description> + [DisplayServer] handles everything related to window management. This is separated from [OS] as a single operating system may support multiple display servers. + [b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] disables all rendering and window management functions. Most functions from [DisplayServer] will return dummy values in this case. </description> <tutorials> </tutorials> @@ -16,8 +19,8 @@ <method name="clipboard_get_primary" qualifiers="const"> <return type="String" /> <description> - Returns the user's primary clipboard as a string if possible. - [b]Note:[/b] This method is only implemented on Linux. + Returns the user's [url=https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer]primary[/url] clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. + [b]Note:[/b] This method is only implemented on Linux (X11). </description> </method> <method name="clipboard_has" qualifiers="const"> @@ -37,22 +40,14 @@ <return type="void" /> <param index="0" name="clipboard_primary" type="String" /> <description> - Sets the user's primary clipboard content to the given string. - [b]Note:[/b] This method is only implemented on Linux. - </description> - </method> - <method name="create_sub_window"> - <return type="int" /> - <param index="0" name="mode" type="int" enum="DisplayServer.WindowMode" /> - <param index="1" name="vsync_mode" type="int" enum="DisplayServer.VSyncMode" /> - <param index="2" name="flags" type="int" /> - <param index="3" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" /> - <description> + Sets the user's [url=https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer]primary[/url] clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. + [b]Note:[/b] This method is only implemented on Linux (X11). </description> </method> <method name="cursor_get_shape" qualifiers="const"> <return type="int" enum="DisplayServer.CursorShape" /> <description> + Returns the default mouse cursor shape set by [method cursor_set_shape]. </description> </method> <method name="cursor_set_custom_image"> @@ -61,18 +56,14 @@ <param index="1" name="shape" type="int" enum="DisplayServer.CursorShape" default="0" /> <param index="2" name="hotspot" type="Vector2" default="Vector2(0, 0)" /> <description> + Sets a custom mouse cursor image for the defined [param shape]. This means the user's operating system and mouse cursor theme will no longer influence the mouse cursor's appearance. The image must be [code]256x256[/code] or smaller for correct appearance. [param hotspot] can optionally be set to define the area where the cursor will click. By default, [param hotspot] is set to [code]Vector2(0, 0)[/code], which is the top-left corner of the image. See also [method cursor_set_shape]. </description> </method> <method name="cursor_set_shape"> <return type="void" /> <param index="0" name="shape" type="int" enum="DisplayServer.CursorShape" /> <description> - </description> - </method> - <method name="delete_sub_window"> - <return type="void" /> - <param index="0" name="window_id" type="int" /> - <description> + Sets the default mouse cursor shape. The cursor's appearance will vary depending on the user's operating system and mouse cursor theme. See also [method cursor_get_shape] and [method cursor_set_custom_image]. </description> </method> <method name="dialog_input_text"> @@ -82,6 +73,8 @@ <param index="2" name="existing_text" type="String" /> <param index="3" name="callback" type="Callable" /> <description> + Shows a text input dialog which uses the operating system's native look-and-feel. [param callback] will be called with a [String] argument equal to the text field's contents when the dialog is closed for any reason. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="dialog_show"> @@ -91,17 +84,23 @@ <param index="2" name="buttons" type="PackedStringArray" /> <param index="3" name="callback" type="Callable" /> <description> + Shows a text dialog which uses the operating system's native look-and-feel. [param callback] will be called when the dialog is closed for any reason. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="enable_for_stealing_focus"> <return type="void" /> <param index="0" name="process_id" type="int" /> <description> + Allows the [param process_id] PID to steal focus from this window. In other words, this disables the operating system's focus stealing protection for the specified PID. + [b]Note:[/b] This method is implemented on Windows. </description> </method> <method name="force_process_and_drop_events"> <return type="void" /> <description> + Forces window manager processing while ignoring all [InputEvent]s. See also [method process_events]. + [b]Note:[/b] This method is implemented on Windows and macOS. </description> </method> <method name="get_accent_color" qualifiers="const"> @@ -127,27 +126,43 @@ <method name="get_name" qualifiers="const"> <return type="String" /> <description> + Returns the name of the [DisplayServer] currently in use. Most operating systems only have a single [DisplayServer], but Linux has access to more than one [DisplayServer] (although only X11 is currently implemented in Godot). + The names of built-in display servers are [code]Windows[/code], [code]macOS[/code], [code]X11[/code] (Linux), [code]Android[/code], [code]iOS[/code], [code]web[/code] (HTML5) and [code]headless[/code] (when started with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]). </description> </method> <method name="get_screen_count" qualifiers="const"> <return type="int" /> <description> + Returns the number of displays available. </description> </method> <method name="get_swap_cancel_ok"> <return type="bool" /> <description> + Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok]. + [b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show]. </description> </method> <method name="get_window_at_screen_position" qualifiers="const"> <return type="int" /> <param index="0" name="position" type="Vector2i" /> <description> + Returns the ID of the window at the specified screen [param position] (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + [codeblock] + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + [/codeblock] </description> </method> <method name="get_window_list" qualifiers="const"> <return type="PackedInt32Array" /> <description> + Returns the list of Godot window IDs belonging to this process. + [b]Note:[/b] Native dialogs are not included in this list. </description> </method> <method name="global_menu_add_check_item"> @@ -362,6 +377,14 @@ [b]Note:[/b] This method is implemented on macOS. </description> </method> + <method name="global_menu_get_item_count" qualifiers="const"> + <return type="int" /> + <param index="0" name="menu_root" type="String" /> + <description> + Returns number of items in the global menu with ID [param menu_root]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> <method name="global_menu_get_item_icon" qualifiers="const"> <return type="Texture2D" /> <param index="0" name="menu_root" type="String" /> @@ -665,37 +688,42 @@ <return type="bool" /> <param index="0" name="feature" type="int" enum="DisplayServer.Feature" /> <description> + Returns [code]true[/code] if the specified [param feature] is supported by the current [DisplayServer], [code]false[/code] otherwise. </description> </method> <method name="ime_get_selection" qualifiers="const"> <return type="Vector2i" /> <description> + Returns the text selection in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] composition string, with the [Vector2i]'s [code]x[/code] component being the caret position and [code]y[/code] being the length of the selection. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="ime_get_text" qualifiers="const"> <return type="String" /> <description> + Returns the composition string contained within the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] window. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="is_dark_mode" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if OS is using dark mode. - [b]Note:[/b] This method is implemented on macOS, Windows and Linux. + [b]Note:[/b] This method is implemented on macOS, Windows and Linux (X11). </description> </method> <method name="is_dark_mode_supported" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if OS supports dark mode. - [b]Note:[/b] This method is implemented on macOS, Windows and Linux. + [b]Note:[/b] This method is implemented on macOS, Windows and Linux (X11). </description> </method> <method name="keyboard_get_current_layout" qualifiers="const"> <return type="int" /> <description> Returns active keyboard layout index. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="keyboard_get_keycode_from_physical" qualifiers="const"> @@ -703,14 +731,14 @@ <param index="0" name="keycode" type="int" enum="Key" /> <description> Converts a physical (US QWERTY) [param keycode] to one in the active keyboard layout. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="keyboard_get_layout_count" qualifiers="const"> <return type="int" /> <description> Returns the number of keyboard layouts. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="keyboard_get_layout_language" qualifiers="const"> @@ -718,7 +746,7 @@ <param index="0" name="index" type="int" /> <description> Returns the ISO-639/BCP-47 language code of the keyboard layout at position [param index]. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="keyboard_get_layout_name" qualifiers="const"> @@ -726,25 +754,27 @@ <param index="0" name="index" type="int" /> <description> Returns the localized name of the keyboard layout at position [param index]. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="keyboard_set_current_layout"> <return type="void" /> <param index="0" name="index" type="int" /> <description> - Sets active keyboard layout. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + Sets the active keyboard layout. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="mouse_get_button_state" qualifiers="const"> <return type="int" enum="MouseButton" /> <description> + Returns the current state of mouse buttons (whether each button is pressed) as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method Input.get_mouse_button_mask]. </description> </method> <method name="mouse_get_mode" qualifiers="const"> <return type="int" enum="DisplayServer.MouseMode" /> <description> + Returns the current mouse mode. See also [method mouse_set_mode]. </description> </method> <method name="mouse_get_position" qualifiers="const"> @@ -757,11 +787,13 @@ <return type="void" /> <param index="0" name="mouse_mode" type="int" enum="DisplayServer.MouseMode" /> <description> + Sets the current mouse mode. See also [method mouse_get_mode]. </description> </method> <method name="process_events"> <return type="void" /> <description> + Perform window manager processing, including input flushing. See also [method force_process_and_drop_events], [method Input.flush_buffered_events] and [member Input.use_accumulated_input]. </description> </method> <method name="screen_get_dpi" qualifiers="const"> @@ -779,7 +811,7 @@ xxhdpi - 480 dpi xxxhdpi - 640 dpi [/codeblock] - [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms. + [b]Note:[/b] This method is implemented on Android, Linux (X11), macOS and Windows. Returns [code]72[/code] on unsupported platforms. </description> </method> <method name="screen_get_max_scale" qualifiers="const"> @@ -794,12 +826,24 @@ <return type="int" enum="DisplayServer.ScreenOrientation" /> <param index="0" name="screen" type="int" default="-1" /> <description> + Returns the [param screen]'s current orientation. See also [method screen_set_orientation]. + [b]Note:[/b] This method is implemented on Android and iOS. </description> </method> <method name="screen_get_position" qualifiers="const"> <return type="Vector2i" /> <param index="0" name="screen" type="int" default="-1" /> <description> + Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + [codeblock] + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + [/codeblock] + See also [method screen_get_size]. </description> </method> <method name="screen_get_refresh_rate" qualifiers="const"> @@ -829,29 +873,34 @@ <return type="Vector2i" /> <param index="0" name="screen" type="int" default="-1" /> <description> + Returns the screen's size in pixels. See also [method screen_get_position] and [method screen_get_usable_rect]. </description> </method> <method name="screen_get_usable_rect" qualifiers="const"> <return type="Rect2i" /> <param index="0" name="screen" type="int" default="-1" /> <description> + Returns the portion of the screen that is not obstructed by a status bar in pixels. See also [method screen_get_size]. </description> </method> <method name="screen_is_kept_on" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the screen should never be turned off by the operating system's power-saving measures. See also [method screen_set_keep_on]. </description> </method> <method name="screen_is_touchscreen" qualifiers="const"> <return type="bool" /> <param index="0" name="screen" type="int" default="-1" /> <description> + Returns [code]true[/code] if the screen can send touch events or if [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is [code]true[/code]. </description> </method> <method name="screen_set_keep_on"> <return type="void" /> <param index="0" name="enable" type="bool" /> <description> + Sets whether the screen should never be turned off by the operating system's power-saving measures. See also [method screen_is_kept_on]. </description> </method> <method name="screen_set_orientation"> @@ -859,18 +908,21 @@ <param index="0" name="orientation" type="int" enum="DisplayServer.ScreenOrientation" /> <param index="1" name="screen" type="int" default="-1" /> <description> + Sets the [param screen]'s [param orientation]. See also [method screen_get_orientation]. </description> </method> <method name="set_icon"> <return type="void" /> <param index="0" name="image" type="Image" /> <description> + Sets the window icon (usually displayed in the top-left corner) in the operating system's [i]native[/i] format. To use icons in the operating system's native format, use [method set_native_icon] instead. </description> </method> <method name="set_native_icon"> <return type="void" /> <param index="0" name="filename" type="String" /> <description> + Sets the window icon (usually displayed in the top-left corner) in the operating system's [i]native[/i] format. The file at [param filename] must be in [code].ico[/code] format on Windows or [code].icns[/code] on macOS. By using specially crafted [code].ico[/code] or [code].icns[/code] icons, [method set_native_icon] allows specifying different icons depending on the size the icon is displayed at. This size is determined by the operating system and user preferences (including the display scale factor). To use icons in other formats, use [method set_icon] instead. </description> </method> <method name="tablet_get_current_driver" qualifiers="const"> @@ -911,7 +963,7 @@ - [code]name[/code] is voice name. - [code]id[/code] is voice identifier. - [code]language[/code] is language code in [code]lang_Variant[/code] format. [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And [code]Variant[/code] part is an engine dependent string describing country, region or/and dialect. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_get_voices_for_language" qualifiers="const"> @@ -919,35 +971,35 @@ <param index="0" name="language" type="String" /> <description> Returns an [PackedStringArray] of voice identifiers for the [param language]. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_is_paused" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the synthesizer is in a paused state. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_is_speaking" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the synthesizer is generating speech, or have utterance waiting in the queue. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_pause"> <return type="void" /> <description> Puts the synthesizer into a paused state. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_resume"> <return type="void" /> <description> Resumes the synthesizer if it was paused. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_set_utterance_callback"> @@ -959,7 +1011,7 @@ - [code]TTS_UTTERANCE_STARTED[/code], [code]TTS_UTTERANCE_ENDED[/code], and [code]TTS_UTTERANCE_CANCELED[/code] callable's method should take one [int] parameter, the utterance id. - [code]TTS_UTTERANCE_BOUNDARY[/code] callable's method should take two [int] parameters, the index of the character and the utterance id. [b]Note:[/b] The granularity of the boundary callbacks is engine dependent. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_speak"> @@ -978,16 +1030,16 @@ - [param pitch] ranges from [code]0.0[/code] (lowest) to [code]2.0[/code] (highest), [code]1.0[/code] is default pitch for the current voice. - [param rate] ranges from [code]0.1[/code] (lowest) to [code]10.0[/code] (highest), [code]1.0[/code] is a normal speaking rate. Other values act as a percentage relative. - [param utterance_id] is passed as a parameter to the callback functions. - [b]Note:[/b] On Windows and Linux, utterance [param text] can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling [method tts_speak]. + [b]Note:[/b] On Windows and Linux (X11), utterance [param text] can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling [method tts_speak]. [b]Note:[/b] The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="tts_stop"> <return type="void" /> <description> Stops synthesis in progress and removes all utterances from the queue. - [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. + [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. </description> </method> <method name="virtual_keyboard_get_height" qualifiers="const"> @@ -1028,17 +1080,11 @@ Sets the mouse cursor position to the given [param position] relative to an origin at the upper left corner of the currently focused game Window Manager window. </description> </method> - <method name="window_attach_instance_id"> - <return type="void" /> - <param index="0" name="instance_id" type="int" /> - <param index="1" name="window_id" type="int" default="0" /> - <description> - </description> - </method> <method name="window_can_draw" qualifiers="const"> <return type="bool" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns [code]true[/code] if anything can be drawn in the window specified by [param window_id], [code]false[/code] otherwise. Using the [code]--disable-render-loop[/code] command line argument or a headless build will return [code]false[/code]. </description> </method> <method name="window_get_active_popup" qualifiers="const"> @@ -1051,12 +1097,14 @@ <return type="int" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the [method Object.get_instance_id] of the [Window] the [param window_id] is attached to. also [method window_get_attached_instance_id]. </description> </method> <method name="window_get_current_screen" qualifiers="const"> <return type="int" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the screen the window specified by [param window_id] is currently positioned on. If the screen overlaps multiple displays, the screen where the window's center is located is returned. See also [method window_set_current_screen]. </description> </method> <method name="window_get_flag" qualifiers="const"> @@ -1071,12 +1119,14 @@ <return type="Vector2i" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the window's maximum size (in pixels). See also [method window_set_max_size]. </description> </method> <method name="window_get_min_size" qualifiers="const"> <return type="Vector2i" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the window's minimum size (in pixels). See also [method window_set_min_size]. </description> </method> <method name="window_get_mode" qualifiers="const"> @@ -1092,7 +1142,7 @@ <param index="1" name="window_id" type="int" default="0" /> <description> Returns internal structure pointers for use in plugins. - [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. + [b]Note:[/b] This method is implemented on Android, Linux (X11), macOS and Windows. </description> </method> <method name="window_get_popup_safe_rect" qualifiers="const"> @@ -1113,19 +1163,21 @@ <return type="Vector2i" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the size of the window specified by [param window_id] (in pixels), including the borders drawn by the operating system. See also [method window_get_size]. </description> </method> <method name="window_get_safe_title_margins" qualifiers="const"> - <return type="Vector2i" /> + <return type="Vector3i" /> <param index="0" name="window_id" type="int" default="0" /> <description> - Returns left and right margins of the title that are safe to use (contains no buttons or other elements) when [constant WINDOW_FLAG_EXTEND_TO_TITLE] flag is set. + Returns left margins ([code]x[/code]), right margins ([code]y[/code]) adn height ([code]z[/code]) of the title that are safe to use (contains no buttons or other elements) when [constant WINDOW_FLAG_EXTEND_TO_TITLE] flag is set. </description> </method> <method name="window_get_size" qualifiers="const"> <return type="Vector2i" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Returns the size of the window specified by [param window_id] (in pixels), excluding the borders drawn by the operating system. This is also called the "client area". See also [method window_get_real_size], [method window_set_size] and [method window_get_position]. </description> </method> <method name="window_get_vsync_mode" qualifiers="const"> @@ -1135,6 +1187,13 @@ Returns the V-Sync mode of the given window. </description> </method> + <method name="window_is_maximize_allowed" qualifiers="const"> + <return type="bool" /> + <param index="0" name="window_id" type="int" default="0" /> + <description> + Returns [code]true[/code] if the given window can be maximized (the maximize button is enabled). + </description> + </method> <method name="window_maximize_on_title_dbl_click" qualifiers="const"> <return type="bool" /> <description> @@ -1153,12 +1212,14 @@ <return type="void" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Moves the window specified by [param window_id] to the foreground, so that it is visible over other windows. </description> </method> <method name="window_request_attention"> <return type="void" /> <param index="0" name="window_id" type="int" default="0" /> <description> + Makes the window specified by [param window_id] request attention, which is materialized by the window title and taskbar entry blinking until the window is focused. This usually has no visible effect if the window is currently focused. The exact behavior varies depending on the operating system. </description> </method> <method name="window_set_current_screen"> @@ -1166,6 +1227,7 @@ <param index="0" name="screen" type="int" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Moves the window specified by [param window_id] to the specified [param screen]. See also [method window_get_current_screen]. </description> </method> <method name="window_set_drop_files_callback"> @@ -1173,6 +1235,8 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the [param callback] that should be called when files are dropped from the operating system's file manager to the window specified by [param window_id]. + [b]Note:[/b] This method is implemented on Windows, macOS, Linux (X11) and Web. </description> </method> <method name="window_set_exclusive"> @@ -1199,6 +1263,7 @@ <param index="0" name="active" type="bool" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets whether [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] should be enabled for the window specified by [param window_id]. See also [method window_set_ime_position]. </description> </method> <method name="window_set_ime_position"> @@ -1206,6 +1271,7 @@ <param index="0" name="position" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the position of the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] popup for the specified [param window_id]. Only effective if [method window_set_ime_active] was set to [code]true[/code] for the specified [param window_id]. </description> </method> <method name="window_set_input_event_callback"> @@ -1213,6 +1279,7 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the [param callback] that should be called when any [InputEvent] is sent to the window specified by [param window_id]. </description> </method> <method name="window_set_input_text_callback"> @@ -1220,6 +1287,7 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the [param callback] that should be called when text is entered using the virtual keyboard to the window specified by [param window_id]. </description> </method> <method name="window_set_max_size"> @@ -1227,6 +1295,8 @@ <param index="0" name="max_size" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the maximum size of the window specified by [param window_id] in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also [method window_get_max_size]. + [b]Note:[/b] Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. </description> </method> <method name="window_set_min_size"> @@ -1234,8 +1304,9 @@ <param index="0" name="min_size" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the minimum size for the given window to [param min_size] (in pixels). + Sets the minimum size for the given window to [param min_size] (in pixels). Normally, the user will not be able to drag the window to make it larger than the specified size. See also [method window_get_min_size]. [b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size. + [b]Note:[/b] Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. </description> </method> <method name="window_set_mode"> @@ -1276,8 +1347,8 @@ DisplayServer.WindowSetMousePassthrough(new Vector2[] {}); [/csharp] [/codeblocks] - [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. - [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is. + [b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows. </description> </method> <method name="window_set_popup_safe_rect"> @@ -1293,7 +1364,16 @@ <param index="0" name="position" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the position of the given window to [param position]. + Sets the position of the given window to [param position]. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + [codeblock] + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + [/codeblock] + See also [method window_get_position] and [method window_set_size]. </description> </method> <method name="window_set_rect_changed_callback"> @@ -1301,6 +1381,7 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the [param callback] that will be called when the window specified by [param window_id] is moved or resized. </description> </method> <method name="window_set_size"> @@ -1308,7 +1389,7 @@ <param index="0" name="size" type="Vector2i" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the size of the given window to [param size]. + Sets the size of the given window to [param size] (in pixels). See also [method window_get_size] and [method window_get_position]. </description> </method> <method name="window_set_title"> @@ -1317,6 +1398,7 @@ <param index="1" name="window_id" type="int" default="0" /> <description> Sets the title of the given window to [param title]. + [b]Note:[/b] Avoid changing the window title every frame, as this can cause performance issues on certain window managers. Try to change the window title only a few times per second at most. </description> </method> <method name="window_set_transient"> @@ -1352,51 +1434,70 @@ <param index="0" name="callback" type="Callable" /> <param index="1" name="window_id" type="int" default="0" /> <description> + Sets the [param callback] that will be called when an event occurs in the window specified by [param window_id]. </description> </method> </methods> <constants> <constant name="FEATURE_GLOBAL_MENU" value="0" enum="Feature"> + Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. [b]macOS[/b] </constant> <constant name="FEATURE_SUBWINDOWS" value="1" enum="Feature"> + Display server supports multiple windows that can be moved outside of the main window. [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_TOUCHSCREEN" value="2" enum="Feature"> + Display server supports touchscreen input. [b]Windows, Linux (X11), Android, iOS, Web[/b] </constant> <constant name="FEATURE_MOUSE" value="3" enum="Feature"> + Display server supports mouse input. [b]Windows, macOS, Linux (X11), Android, Web[/b] </constant> <constant name="FEATURE_MOUSE_WARP" value="4" enum="Feature"> + Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_CLIPBOARD" value="5" enum="Feature"> + Display server supports setting and getting clipboard data. See also [constant FEATURE_CLIPBOARD_PRIMARY]. [b]Windows, macOS, Linux (X11), Android, iOS, Web[/b] </constant> <constant name="FEATURE_VIRTUAL_KEYBOARD" value="6" enum="Feature"> + Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. [b]Android, iOS, Web[/b] </constant> <constant name="FEATURE_CURSOR_SHAPE" value="7" enum="Feature"> + Display server supports setting the mouse cursor shape to be different from the default. [b]Windows, macOS, Linux (X11), Android, Web[/b] </constant> <constant name="FEATURE_CUSTOM_CURSOR_SHAPE" value="8" enum="Feature"> + Display server supports setting the mouse cursor shape to a custom image. [b]Windows, macOS, Linux (X11), Web[/b] </constant> <constant name="FEATURE_NATIVE_DIALOG" value="9" enum="Feature"> + Display server supports spawning dialogs using the operating system's native look-and-feel. [b]macOS[/b] </constant> <constant name="FEATURE_IME" value="10" enum="Feature"> + Display server supports [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url], which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_WINDOW_TRANSPARENCY" value="11" enum="Feature"> + Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_HIDPI" value="12" enum="Feature"> + Display server supports querying the operating system's display scale factor. This allows for [i]reliable[/i] automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). [b]Windows, macOS[/b] </constant> <constant name="FEATURE_ICON" value="13" enum="Feature"> + Display server supports changing the window icon (usually displayed in the top-left corner). [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_NATIVE_ICON" value="14" enum="Feature"> + Display server supports changing the window icon (usually displayed in the top-left corner). [b]Windows, macOS[/b] </constant> <constant name="FEATURE_ORIENTATION" value="15" enum="Feature"> + Display server supports changing the screen orientation. [b]Android, iOS[/b] </constant> <constant name="FEATURE_SWAP_BUFFERS" value="16" enum="Feature"> + Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). [b]Windows, macOS, Linux (X11)[/b] </constant> <constant name="FEATURE_CLIPBOARD_PRIMARY" value="18" enum="Feature"> + Display server supports Primary clipboard can be used. This is a different clipboard from [constant FEATURE_CLIPBOARD]. [b]Linux (X11)[/b] </constant> <constant name="FEATURE_TEXT_TO_SPEECH" value="19" enum="Feature"> - Display server supports text-to-speech. See [code]tts_*[/code] methods. + Display server supports text-to-speech. See [code]tts_*[/code] methods. [b]Windows, macOS, Linux (X11), Android, iOS, Web[/b] </constant> <constant name="FEATURE_EXTEND_TO_TITLE" value="20" enum="Feature"> - Display server supports expanding window content to the title. See [constant WINDOW_FLAG_EXTEND_TO_TITLE]. + Display server supports expanding window content to the title. See [constant WINDOW_FLAG_EXTEND_TO_TITLE]. [b]macOS[/b] </constant> <constant name="MOUSE_MODE_VISIBLE" value="0" enum="MouseMode"> Makes the mouse cursor visible if it is hidden. @@ -1415,24 +1516,34 @@ Confines the mouse cursor to the game window, and make it hidden. </constant> <constant name="SCREEN_OF_MAIN_WINDOW" value="-1"> + Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens. </constant> <constant name="MAIN_WINDOW_ID" value="0"> + The ID of the main window spawned by the engine, which can be passed to methods expecting a [code]window_id[/code]. </constant> <constant name="INVALID_WINDOW_ID" value="-1"> + The ID that refers to a nonexisting window. This is be returned by some [DisplayServer] methods if no window matches the requested result. </constant> <constant name="SCREEN_LANDSCAPE" value="0" enum="ScreenOrientation"> + Default landscape orientation. </constant> <constant name="SCREEN_PORTRAIT" value="1" enum="ScreenOrientation"> + Default portrait orienstation. </constant> <constant name="SCREEN_REVERSE_LANDSCAPE" value="2" enum="ScreenOrientation"> + Reverse landscape orientation (upside down). </constant> <constant name="SCREEN_REVERSE_PORTRAIT" value="3" enum="ScreenOrientation"> + Reverse portrait orientation (upside down). </constant> <constant name="SCREEN_SENSOR_LANDSCAPE" value="4" enum="ScreenOrientation"> + Automatic landscape orientation (default or reverse depending on sensor). </constant> <constant name="SCREEN_SENSOR_PORTRAIT" value="5" enum="ScreenOrientation"> + Automatic portrait orientation (default or reverse depending on sensor). </constant> <constant name="SCREEN_SENSOR" value="6" enum="ScreenOrientation"> + Automatic landscape or portrait orientation (default or reverse depending on sensor). </constant> <constant name="KEYBOARD_TYPE_DEFAULT" value="0" enum="VirtualKeyboardType"> Default text virtual keyboard. @@ -1460,40 +1571,58 @@ Virtual keyboard with additional keys to assist with typing URLs. </constant> <constant name="CURSOR_ARROW" value="0" enum="CursorShape"> + Arrow cursor shape. This is the default when not pointing anything that overrides the mouse cursor, such as a [LineEdit] or [TextEdit]. </constant> <constant name="CURSOR_IBEAM" value="1" enum="CursorShape"> + I-beam cursor shape. This is used by default when hovering a control that accepts text input, such as [LineEdit] or [TextEdit]. </constant> <constant name="CURSOR_POINTING_HAND" value="2" enum="CursorShape"> + Pointing hand cursor shape. This is used by default when hovering a [LinkButton] or an URL tag in a [RichTextLabel].⋅ </constant> <constant name="CURSOR_CROSS" value="3" enum="CursorShape"> + Crosshair cursor. This is intended to be displayed when the user needs precise aim over an element, such as a rectangle selection tool or a color picker. </constant> <constant name="CURSOR_WAIT" value="4" enum="CursorShape"> + Wait cursor. On most cursor themes, this displays a spinning icon [i]besides[/i] the arrow. Intended to be used for non-blocking operations (when the user can do something else at the moment). See also [constant CURSOR_BUSY]. </constant> <constant name="CURSOR_BUSY" value="5" enum="CursorShape"> + Wait cursor. On most cursor themes, this [i]replaces[/i] the arrow with a spinning icon. Intended to be used for blocking operations (when the user can't do anything else at the moment). See also [constant CURSOR_WAIT]. </constant> <constant name="CURSOR_DRAG" value="6" enum="CursorShape"> + Dragging hand cursor. This is displayed during drag-and-drop operations. See also [constant CURSOR_CAN_DROP]. </constant> <constant name="CURSOR_CAN_DROP" value="7" enum="CursorShape"> + "Can drop" cursor. This is displayed during drag-and-drop operations if hovering over a [Control] that can accept the drag-and-drop event. On most cursor themes, this displays a dragging hand with an arrow symbol besides it. See also [constant CURSOR_DRAG]. </constant> <constant name="CURSOR_FORBIDDEN" value="8" enum="CursorShape"> + Forbidden cursor. This is displayed during drag-and-drop operations if the hovered [Control] can't accept the drag-and-drop event. </constant> <constant name="CURSOR_VSIZE" value="9" enum="CursorShape"> + Vertical resize cursor. Intended to be displayed when the hovered [Control] can be vertically resized using the mouse. See also [constant CURSOR_VSPLIT]. </constant> <constant name="CURSOR_HSIZE" value="10" enum="CursorShape"> + Horizontal resize cursor. Intended to be displayed when the hovered [Control] can be horizontally resized using the mouse. See also [constant CURSOR_HSPLIT]. </constant> <constant name="CURSOR_BDIAGSIZE" value="11" enum="CursorShape"> + Secondary diagonal resize cursor (top-right/bottom-left). Intended to be displayed when the hovered [Control] can be resized on both axes at once using the mouse. </constant> <constant name="CURSOR_FDIAGSIZE" value="12" enum="CursorShape"> + Main diagonal resize cursor (top-left/bottom-right). Intended to be displayed when the hovered [Control] can be resized on both axes at once using the mouse. </constant> <constant name="CURSOR_MOVE" value="13" enum="CursorShape"> + Move cursor. Intended to be displayed when the hovered [Control] can be moved using the mouse. </constant> <constant name="CURSOR_VSPLIT" value="14" enum="CursorShape"> + Vertical split cursor. This is displayed when hovering a [Control] with splits that can be vertically resized using the mouse, such as [VSplitContainer]. On some cursor themes, this cursor may have the same appearance as [constant CURSOR_VSIZE]. </constant> <constant name="CURSOR_HSPLIT" value="15" enum="CursorShape"> + Horizontal split cursor. This is displayed when hovering a [Control] with splits that can be horizontally resized using the mouse, such as [HSplitContainer]. On some cursor themes, this cursor may have the same appearance as [constant CURSOR_HSIZE]. </constant> <constant name="CURSOR_HELP" value="16" enum="CursorShape"> + Help cursor. On most cursor themes, this displays a question mark icon instead of the mouse cursor. Intended to be used when the user has requested help on the next element that will be clicked. </constant> <constant name="CURSOR_MAX" value="17" enum="CursorShape"> + Represents the size of the [enum CursorShape] enum. </constant> <constant name="WINDOW_MODE_WINDOWED" value="0" enum="WindowMode"> Windowed mode, i.e. [Window] doesn't occupy the whole screen (unless set to the size of the screen). @@ -1505,7 +1634,7 @@ Maximized window mode, i.e. [Window] will occupy whole screen area except task bar and still display its borders. Normally happens when the minimize button is pressed. </constant> <constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode"> - Full screen window mode. Note that this is not [i]exclusive[/i] full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. + Full screen window mode. Note that this is not [i]exclusive[/i] full screen. On Windows and Linux (X11), a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. 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"> @@ -1525,7 +1654,7 @@ <constant name="WINDOW_FLAG_TRANSPARENT" value="3" enum="WindowFlags"> The window background can be transparent. [b]Note:[/b] This flag has no effect if [member ProjectSettings.display/window/per_pixel_transparency/allowed] is set to [code]false[/code]. - [b]Note:[/b] Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. + [b]Note:[/b] Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. </constant> <constant name="WINDOW_FLAG_NO_FOCUS" value="4" enum="WindowFlags"> The window can't be focused. No-focus window will ignore all input, except mouse clicks. @@ -1570,26 +1699,26 @@ [b]Note:[/b] This flag is implemented on macOS. </constant> <constant name="VSYNC_DISABLED" value="0" enum="VSyncMode"> - No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). + No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (nonwithstanding [member Engine.max_fps]). </constant> <constant name="VSYNC_ENABLED" value="1" enum="VSyncMode"> - Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). + Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (nonwithstanding [member Engine.max_fps]). </constant> <constant name="VSYNC_ADAPTIVE" value="2" enum="VSyncMode"> - Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible), otherwise vertical synchronization is enabled to avoid tearing. + Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (nonwithstanding [member Engine.max_fps]). </constant> <constant name="VSYNC_MAILBOX" value="3" enum="VSyncMode"> - Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). - Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag. + Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (nonwithstanding [member Engine.max_fps]). + Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). [constant VSYNC_MAILBOX] works best when at least twice as many frames as the display refresh rate are rendered. </constant> <constant name="DISPLAY_HANDLE" value="0" enum="HandleType"> Display handle: - - Linux: [code]X11::Display*[/code] for the display. + - Linux (X11): [code]X11::Display*[/code] for the display. </constant> <constant name="WINDOW_HANDLE" value="1" enum="HandleType"> Window handle: - Windows: [code]HWND[/code] for the window. - - Linux: [code]X11::Window*[/code] for the window. + - Linux (X11): [code]X11::Window*[/code] for the window. - macOS: [code]NSWindow*[/code] for the window. - iOS: [code]UIViewController*[/code] for the view controller. - Android: [code]jObject[/code] for the activity. diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml index e216059364..99e97fc25f 100644 --- a/doc/classes/EditorFeatureProfile.xml +++ b/doc/classes/EditorFeatureProfile.xml @@ -28,7 +28,7 @@ <return type="bool" /> <param index="0" name="class_name" type="StringName" /> <description> - Returns [code]true[/code] if editing for the class specified by [param class_name] is disabled. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. + Returns [code]true[/code] if editing for the class specified by [param class_name] is disabled. When disabled, the class will still appear in the Create New Node dialog but the Inspector will be read-only when selecting a node that extends the class. </description> </method> <method name="is_class_property_disabled" qualifiers="const"> @@ -36,7 +36,7 @@ <param index="0" name="class_name" type="StringName" /> <param index="1" name="property" type="StringName" /> <description> - Returns [code]true[/code] if [param property] is disabled in the class specified by [param class_name]. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by [param class_name]. + Returns [code]true[/code] if [param property] is disabled in the class specified by [param class_name]. When a property is disabled, it won't appear in the Inspector when selecting a node that extends the class specified by [param class_name]. </description> </method> <method name="is_feature_disabled" qualifiers="const"> @@ -73,7 +73,7 @@ <param index="0" name="class_name" type="StringName" /> <param index="1" name="disable" type="bool" /> <description> - If [param disable] is [code]true[/code], disables editing for the class specified by [param class_name]. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. + If [param disable] is [code]true[/code], disables editing for the class specified by [param class_name]. When disabled, the class will still appear in the Create New Node dialog but the Inspector will be read-only when selecting a node that extends the class. </description> </method> <method name="set_disable_class_property"> @@ -82,7 +82,7 @@ <param index="1" name="property" type="StringName" /> <param index="2" name="disable" type="bool" /> <description> - If [param disable] is [code]true[/code], disables editing for [param property] in the class specified by [param class_name]. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by [param class_name]. + If [param disable] is [code]true[/code], disables editing for [param property] in the class specified by [param class_name]. When a property is disabled, it won't appear in the Inspector when selecting a node that extends the class specified by [param class_name]. </description> </method> <method name="set_disable_feature"> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 891c8d7d92..51e3706981 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -4,6 +4,7 @@ A modified version of [FileDialog] used by the editor. </brief_description> <description> + [EditorFileDialog] is an enhanced version of [FileDialog] avaiable only to editor plugins. Additional features include list of favorited/recent files and ability to see files as thumbnails grid instead of list. </description> <tutorials> </tutorials> @@ -62,7 +63,7 @@ The dialog's open or save mode, which affects the selection behavior. See [enum FileMode] </member> <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false"> - If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog]. + If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog]. This property is synchronized with [member EditorSettings.filesystem/file_dialog/show_hidden_files]. </member> <member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default=""Save a File"" /> </members> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index a1a43dd5bf..108c670f59 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -33,7 +33,7 @@ <signal name="object_id_selected"> <param index="0" name="id" type="int" /> <description> - Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree inspector. + Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree Inspector. </description> </signal> <signal name="property_deleted"> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index c8a499260e..ba2f7b24bf 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="EditorInspectorPlugin" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Plugin for adding custom property editors on inspector. + Plugin for adding custom property editors on the inspector. </brief_description> <description> [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector]. diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 1e3b1f07ee..594c180894 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -70,6 +70,7 @@ <method name="get_editor_paths"> <return type="EditorPaths" /> <description> + Returns the [EditorPaths] singleton. </description> </method> <method name="get_editor_scale" qualifiers="const"> @@ -151,6 +152,12 @@ Shows the given property on the given [param object] in the editor's Inspector dock. If [param inspector_only] is [code]true[/code], plugins will not attempt to edit [param object]. </description> </method> + <method name="is_movie_maker_enabled" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if Movie Maker mode is enabled in the editor. See also [method set_movie_maker_enabled]. See [MovieWriter] for more information. + </description> + </method> <method name="is_playing_scene" qualifiers="const"> <return type="bool" /> <description> @@ -240,6 +247,13 @@ Sets the editor's current main screen to the one specified in [param name]. [param name] must match the text of the tab in question exactly ([code]2D[/code], [code]3D[/code], [code]Script[/code], [code]AssetLib[/code]). </description> </method> + <method name="set_movie_maker_enabled"> + <return type="void" /> + <param index="0" name="enabled" type="bool" /> + <description> + Sets whether Movie Maker mode is enabled in the editor. See also [method is_movie_maker_enabled]. See [MovieWriter] for more information. + </description> + </method> <method name="set_plugin_enabled"> <return type="void" /> <param index="0" name="plugin" type="String" /> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 563987e2a3..e413c526f4 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -691,11 +691,13 @@ </signal> <signal name="project_settings_changed"> <description> + Emitted when any project setting has changed. </description> </signal> <signal name="resource_saved"> <param index="0" name="resource" type="Resource" /> <description> + Emitted when the given [param resource] was saved on disc. </description> </signal> <signal name="scene_changed"> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 9170c449bf..2aca19510b 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -61,6 +61,7 @@ <method name="update_property"> <return type="void" /> <description> + Forces refresh of the property display. </description> </method> </methods> diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index dfc04c9cde..a02fd215d8 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -30,6 +30,7 @@ [/csharp] [/codeblocks] [b]Note:[/b] The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot [b]Output[/b] dock. + [b]Note:[/b] EditorScript is [RefCounted], meaning it is destroyed when nothing references it. This can cause errors during asynchronous operations if there are no references to the script. </description> <tutorials> </tutorials> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 7f3ffce9b7..799bd45cee 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -196,10 +196,10 @@ The thumbnail size to use in the FileSystem dock (in pixels). See also [member filesystem/file_dialog/thumbnail_size]. </member> <member name="docks/property_editor/auto_refresh_interval" type="float" setter="" getter=""> - The refresh interval to use for the inspector dock's properties. The effect of this setting is mainly noticeable when adjusting gizmos in the 2D/3D editor and looking at the inspector at the same time. Lower values make the inspector more often, but take up more CPU time. + The refresh interval to use for the Inspector dock's properties. The effect of this setting is mainly noticeable when adjusting gizmos in the 2D/3D editor and looking at the inspector at the same time. Lower values make the inspector more often, but take up more CPU time. </member> <member name="docks/property_editor/subresource_hue_tint" type="float" setter="" getter=""> - The tint intensity to use for the subresources background in the inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference. + The tint intensity to use for the subresources background in the Inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference. </member> <member name="docks/scene_tree/auto_expand_to_selected" type="bool" setter="" getter=""> If [code]true[/code], the scene tree dock will automatically unfold nodes when a node that has folded parents is selected. @@ -363,7 +363,7 @@ The color to use for the selection box that surrounds selected nodes in the 3D editor viewport. The color's alpha channel influences the selection box's opacity. </member> <member name="editors/3d_gizmos/gizmo_colors/instantiated" type="Color" setter="" getter=""> - The color override to use for 3D editor gizmos if the [Node3D] in question is part of an instanced scene file (from the perspective of the current scene). + The color override to use for 3D editor gizmos if the [Node3D] in question is part of an instantiated scene file (from the perspective of the current scene). </member> <member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter=""> The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s. @@ -457,6 +457,12 @@ If [code]true[/code], when saving a file, the editor will rename the old file to a different name, save a new file, then only remove the old file once the new file has been saved. This makes loss of data less likely to happen if the editor or operating system exits unexpectedly while saving (e.g. due to a crash or power outage). [b]Note:[/b] On Windows, this feature can interact negatively with certain antivirus programs. In this case, you may have to set this to [code]false[/code] to prevent file locking issues. </member> + <member name="interface/editor/accept_dialog_cancel_ok_buttons" type="int" setter="" getter=""> + How to position the Cancel and OK buttons in the editor's [AcceptDialog]s. Different platforms have different standard behaviors for this, which can be overridden using this setting. This is useful if you use Godot both on Windows and macOS/Linux and your Godot muscle memory is stronger than your OS specific one. + - [b]Auto[/b] follows the platform convention: Cancel first on macOS and Linux, OK first on Windows. + - [b]Cancel First[/b] forces the ordering Cancel/OK. + - [b]OK First[/b] forces the ordering OK/Cancel. + </member> <member name="interface/editor/automatically_open_screenshots" type="bool" setter="" getter=""> If [code]true[/code], automatically opens screenshots with the default program associated to [code].png[/code] files after a screenshot is taken using the [b]Editor > Take Screenshot[/b] action. </member> @@ -671,19 +677,19 @@ If [code]true[/code], displays line length guidelines to help you keep line lengths in check. See also [member text_editor/appearance/guidelines/line_length_guideline_soft_column] and [member text_editor/appearance/guidelines/line_length_guideline_hard_column]. </member> <member name="text_editor/appearance/gutters/highlight_type_safe_lines" type="bool" setter="" getter=""> - If [code]true[/code], highlights type-safe lines by displaying their line number color with [member text_editor/theme/highlighting/safe_line_number_color] instead of [member text_editor/theme/highlighting/line_number_color]. Type-safe lines are lines of code where the type of all variables is known at compile-time. These type-safe lines will run faster in Godot 4.0 and later thanks to typed instructions. + If [code]true[/code], highlights type-safe lines by displaying their line number color with [member text_editor/theme/highlighting/safe_line_number_color] instead of [member text_editor/theme/highlighting/line_number_color]. Type-safe lines are lines of code where the type of all variables is known at compile-time. These type-safe lines may run faster thanks to typed instructions. </member> <member name="text_editor/appearance/gutters/line_numbers_zero_padded" type="bool" setter="" getter=""> If [code]true[/code], displays line numbers with zero padding (e.g. [code]007[/code] instead of [code]7[/code]). </member> <member name="text_editor/appearance/gutters/show_bookmark_gutter" type="bool" setter="" getter=""> - If [code]true[/code], displays a gutter at the left containing icons for bookmarks. + If [code]true[/code], displays icons for bookmarks in a gutter at the left. Bookmarks remain functional when this setting is disabled. </member> <member name="text_editor/appearance/gutters/show_info_gutter" type="bool" setter="" getter=""> If [code]true[/code], displays a gutter at the left containing icons for methods with signal connections. </member> <member name="text_editor/appearance/gutters/show_line_numbers" type="bool" setter="" getter=""> - If [code]true[/code], displays line numbers in the gutter at the left. + If [code]true[/code], displays line numbers in a gutter at the left. </member> <member name="text_editor/appearance/lines/code_folding" type="bool" setter="" getter=""> If [code]true[/code], displays the folding arrows next to indented code sections and allows code folding. If [code]false[/code], hides the folding arrows next to indented code sections and disallows code folding. @@ -752,7 +758,7 @@ [b]Note:[/b] You can hold down [kbd]Alt[/kbd] while using the mouse wheel to temporarily scroll 5 times faster. </member> <member name="text_editor/completion/add_type_hints" type="bool" setter="" getter=""> - If [code]true[/code], adds static typing hints such as [code]-> void[/code] and [code]: int[/code] when performing method definition autocompletion. + If [code]true[/code], adds static typing hints such as [code]-> void[/code] and [code]: int[/code] when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the [kbd]Ctrl[/kbd] key. </member> <member name="text_editor/completion/auto_brace_complete" type="bool" setter="" getter=""> If [code]true[/code], automatically completes braces when making use of code completion. @@ -803,7 +809,7 @@ The script editor's background color. If set to a translucent color, the editor theme's base color will be visible behind. </member> <member name="text_editor/theme/highlighting/base_type_color" type="Color" setter="" getter=""> - The script editor's base type color (used for types like [Vector2], [Vector3], ...). + The script editor's base type color (used for types like [Vector2], [Vector3], [Color], ...). </member> <member name="text_editor/theme/highlighting/bookmark_color" type="Color" setter="" getter=""> The script editor's bookmark icon color (displayed in the gutter). @@ -863,10 +869,10 @@ [b]Note:[/b] When using the GDScript syntax highlighter, this is replaced by the function definition color configured in the syntax theme for function definitions (e.g. [code]func _ready():[/code]). </member> <member name="text_editor/theme/highlighting/keyword_color" type="Color" setter="" getter=""> - The script editor's non-control flow keyword color (used for keywords like [code]var[/code], [code]func[/code], some built-in methods, ...). + The script editor's non-control flow keyword color (used for keywords like [code]var[/code], [code]func[/code], [code]extends[/code], ...). </member> <member name="text_editor/theme/highlighting/line_length_guideline_color" type="Color" setter="" getter=""> - The script editor's color for the line length guideline. The "hard" line length guideline will be drawn with this color, whereas the "soft" line length guideline will be drawn with an opacity twice as low. + The script editor's color for the line length guideline. The "hard" line length guideline will be drawn with this color, whereas the "soft" line length guideline will be drawn with half of its opacity. </member> <member name="text_editor/theme/highlighting/line_number_color" type="Color" setter="" getter=""> The script editor's color for line numbers. See also [member text_editor/theme/highlighting/safe_line_number_color]. @@ -907,7 +913,7 @@ The script editor's background color for text. This should be set to a translucent color so that it can display on top of other line color modifiers such as [member text_editor/theme/highlighting/current_line_color]. </member> <member name="text_editor/theme/highlighting/user_type_color" type="Color" setter="" getter=""> - The script editor's color for user-defined types (using [code]@class_name[/code]). + The script editor's color for user-defined types (using [code]class_name[/code]). </member> <member name="text_editor/theme/highlighting/word_highlighted_color" type="Color" setter="" getter=""> The script editor's color for words highlighted by selecting them. Only visible if [member text_editor/appearance/caret/highlight_all_occurrences] is [code]true[/code]. diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 2ada211dab..9961e11f7d 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -10,13 +10,16 @@ </tutorials> <members> <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> + If [code]true[/code], the slider will not draw background. </member> <member name="hide_slider" type="bool" setter="set_hide_slider" getter="is_hiding_slider" default="false"> If [code]true[/code], the slider is hidden. </member> <member name="label" type="String" setter="set_label" getter="get_label" default=""""> + The text that displays to the left of the value. </member> <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="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. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 2b8663e039..821fae37a6 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -146,11 +146,13 @@ <return type="ScriptLanguage" /> <param index="0" name="index" type="int" /> <description> + Returns an instance of a [ScriptLanguage] with the given index. </description> </method> <method name="get_script_language_count"> <return type="int" /> <description> + Returns the number of available script languages. Use with [method get_script_language]. </description> </method> <method name="get_singleton" qualifiers="const"> @@ -163,6 +165,7 @@ <method name="get_singleton_list" qualifiers="const"> <return type="PackedStringArray" /> <description> + Returns a list of available global singletons. </description> </method> <method name="get_version_info" qualifiers="const"> @@ -244,6 +247,7 @@ <return type="void" /> <param index="0" name="language" type="ScriptLanguage" /> <description> + Registers a [ScriptLanguage] instance to be available with [code]ScriptServer[/code]. </description> </method> <method name="register_singleton"> @@ -251,12 +255,14 @@ <param index="0" name="name" type="StringName" /> <param index="1" name="instance" type="Object" /> <description> + Registers the given object as a singleton, globally available under [param name]. </description> </method> <method name="unregister_singleton"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> + Unregisters the singleton registered under [param name]. The singleton object is not freed. Only works with user-defined singletons created with [method register_singleton]. </description> </method> </methods> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 243a28e73d..33b6a786ae 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -301,6 +301,7 @@ <member name="volumetric_fog_density" type="float" setter="set_volumetric_fog_density" getter="get_volumetric_fog_density" default="0.05"> The base [i]exponential[/i] density of the volumetric fog. Set this to the lowest density you want to have globally. [FogVolume]s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life. A value of [code]0.0[/code] disables global volumetric fog while allowing [FogVolume]s to display volumetric fog in specific areas. + To make volumetric fog work as a volumetric [i]lighting[/i] solution, set [member volumetric_fog_density] to the lowest non-zero value ([code]0.0001[/code]) then increase lights' [member Light3D.light_volumetric_fog_energy] to values between [code]10000[/code] and [code]100000[/code] to compensate for the very low density. </member> <member name="volumetric_fog_detail_spread" type="float" setter="set_volumetric_fog_detail_spread" getter="get_volumetric_fog_detail_spread" default="2.0"> The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera. diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index 3a397f56a9..4670e0c382 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -12,7 +12,7 @@ var expression = Expression.new() func _ready(): - $LineEdit.connect("text_submitted", self, "_on_text_submitted") + $LineEdit.text_submitted.connect(self._on_text_submitted) func _on_text_submitted(command): var error = expression.parse(command) @@ -28,7 +28,7 @@ public override void _Ready() { - GetNode("LineEdit").Connect("text_submitted", this, nameof(OnTextEntered)); + GetNode("LineEdit").TextSubmitted += OnTextEntered; } private void OnTextEntered(string command) diff --git a/doc/classes/FogMaterial.xml b/doc/classes/FogMaterial.xml index 7428d6169a..aab6be4212 100644 --- a/doc/classes/FogMaterial.xml +++ b/doc/classes/FogMaterial.xml @@ -15,6 +15,7 @@ </member> <member name="density" type="float" setter="set_density" getter="get_density" default="1.0"> The density of the [FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other [FogVolume]s or global volumetric fog. + [b]Note:[/b] Due to limited precision, [member density] values between [code]-0.001[/code] and [code]0.001[/code] (exclusive) act like [code]0.0[/code]. This does not apply to [member Environment.volumetric_fog_density]. </member> <member name="density_texture" type="Texture3D" setter="set_density_texture" getter="get_density_texture"> The 3D texture that is used to scale the [member density] of the [FogVolume]. This can be used to vary fog density within the [FogVolume] with any kind of static pattern. For animated effects, consider using a custom [url=$DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml index df378d9d2f..dac822ae2f 100644 --- a/doc/classes/FontFile.xml +++ b/doc/classes/FontFile.xml @@ -262,7 +262,7 @@ <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + Returns a copy of the array containing glyph packing data. </description> </method> <method name="get_transform" qualifiers="const"> @@ -522,7 +522,7 @@ <param index="2" name="texture_index" type="int" /> <param index="3" name="offset" type="PackedInt32Array" /> <description> - Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support). + Sets array containing glyph packing data. </description> </method> <method name="set_transform"> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index f41e34c43a..4916171900 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -9,7 +9,8 @@ </description> <tutorials> <link title="Particle systems (2D)">$DOCS_URL/tutorials/2d/particle_systems_2d.html</link> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + <link title="2D Particles Demo">https://godotengine.org/asset-library/asset/118</link> + <link title="2D Dodge The Creeps Demo (uses GPUParticles2D for the trail behind the player)">https://godotengine.org/asset-library/asset/515</link> </tutorials> <methods> <method name="capture_rect" qualifiers="const"> @@ -52,7 +53,7 @@ How rapidly particles in an emission cycle are emitted. If greater than [code]0[/code], there will be a gap in emissions before the next cycle begins. </member> <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="30"> - The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. </member> <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index e7b436010e..d0be4d784a 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -84,7 +84,7 @@ Time ratio between each emission. If [code]0[/code], particles are emitted continuously. If [code]1[/code], all particles are emitted simultaneously. </member> <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="30"> - The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. </member> <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 510f14ec54..88cea6820e 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -26,7 +26,7 @@ <param index="1" name="src_rect" type="Rect2i" /> <param index="2" name="dst" type="Vector2i" /> <description> - Alpha-blends [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image [b]must[/b] have the same format. [param src_rect] with not positive size is treated as empty. + Alpha-blends [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image [b]must[/b] have the same format. [param src_rect] with non-positive size is treated as empty. </description> </method> <method name="blend_rect_mask"> @@ -36,7 +36,7 @@ <param index="2" name="src_rect" type="Rect2i" /> <param index="3" name="dst" type="Vector2i" /> <description> - Alpha-blends [param src_rect] from [param src] image to this image using [param mask] image at coordinates [param dst], clipped accordingly to both image bounds. Alpha channels are required for both [param src] and [param mask]. [param dst] pixels and [param src] pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and [param src] image [b]must[/b] have the same format. [param src] image and [param mask] image [b]must[/b] have the same size (width and height) but they can have different formats. [param src_rect] with not positive size is treated as empty. + Alpha-blends [param src_rect] from [param src] image to this image using [param mask] image at coordinates [param dst], clipped accordingly to both image bounds. Alpha channels are required for both [param src] and [param mask]. [param dst] pixels and [param src] pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and [param src] image [b]must[/b] have the same format. [param src] image and [param mask] image [b]must[/b] have the same size (width and height) but they can have different formats. [param src_rect] with non-positive size is treated as empty. </description> </method> <method name="blit_rect"> @@ -45,7 +45,7 @@ <param index="1" name="src_rect" type="Rect2i" /> <param index="2" name="dst" type="Vector2i" /> <description> - Copies [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image [b]must[/b] have the same format. [param src_rect] with not positive size is treated as empty. + Copies [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image [b]must[/b] have the same format. [param src_rect] with non-positive size is treated as empty. </description> </method> <method name="blit_rect_mask"> @@ -55,7 +55,7 @@ <param index="2" name="src_rect" type="Rect2i" /> <param index="3" name="dst" type="Vector2i" /> <description> - Blits [param src_rect] area from [param src] image to this image at the coordinates given by [param dst], clipped accordingly to both image bounds. [param src] pixel is copied onto [param dst] if the corresponding [param mask] pixel's alpha value is not 0. This image and [param src] image [b]must[/b] have the same format. [param src] image and [param mask] image [b]must[/b] have the same size (width and height) but they can have different formats. [param src_rect] with not positive size is treated as empty. + Blits [param src_rect] area from [param src] image to this image at the coordinates given by [param dst], clipped accordingly to both image bounds. [param src] pixel is copied onto [param dst] if the corresponding [param mask] pixel's alpha value is not 0. This image and [param src] image [b]must[/b] have the same format. [param src] image and [param mask] image [b]must[/b] have the same size (width and height) but they can have different formats. [param src_rect] with non-positive size is treated as empty. </description> </method> <method name="bump_map_to_normal_map"> @@ -111,8 +111,8 @@ Copies [param src] image to this image. </description> </method> - <method name="create"> - <return type="void" /> + <method name="create" qualifiers="static"> + <return type="Image" /> <param index="0" name="width" type="int" /> <param index="1" name="height" type="int" /> <param index="2" name="use_mipmaps" type="bool" /> @@ -121,8 +121,8 @@ 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"> - <return type="void" /> + <method name="create_from_data" qualifiers="static"> + <return type="Image" /> <param index="0" name="width" type="int" /> <param index="1" name="height" type="int" /> <param index="2" name="use_mipmaps" type="bool" /> @@ -454,6 +454,17 @@ Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [param lossy] is true, the image will be saved lossy, using the [param quality] setting between 0.0 and 1.0 (inclusive). </description> </method> + <method name="set_data"> + <return type="void" /> + <param index="0" name="width" type="int" /> + <param index="1" name="height" type="int" /> + <param index="2" name="use_mipmaps" type="bool" /> + <param index="3" name="format" type="int" enum="Image.Format" /> + <param index="4" name="data" type="PackedByteArray" /> + <description> + Overwrites data of an existing [Image]. Non-static equivalent of [method create_from_data]. + </description> + </method> <method name="set_pixel"> <return type="void" /> <param index="0" name="x" type="int" /> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 56b95fc755..89d52caa02 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -157,7 +157,7 @@ <method name="get_mouse_button_mask" qualifiers="const"> <return type="int" enum="MouseButton" /> <description> - Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. + Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method DisplayServer.mouse_get_button_state]. </description> </method> <method name="get_vector" qualifiers="const"> diff --git a/doc/classes/InputEventMIDI.xml b/doc/classes/InputEventMIDI.xml index 2af88149b6..04d8cab065 100644 --- a/doc/classes/InputEventMIDI.xml +++ b/doc/classes/InputEventMIDI.xml @@ -90,7 +90,7 @@ The pressure of the MIDI signal. This value ranges from 0 to 127. For many devices, this value is always zero. </member> <member name="velocity" type="int" setter="set_velocity" getter="get_velocity" default="0"> - The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. + The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. Note that some MIDI devices may send a [constant MIDI_MESSAGE_NOTE_ON] message with zero velocity and expect this to be treated the same as a [constant MIDI_MESSAGE_NOTE_OFF] message, but device implementations vary so Godot reports event data exactly as received. </member> </members> </class> diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml index fb50454917..346b6bf732 100644 --- a/doc/classes/InputEventScreenTouch.xml +++ b/doc/classes/InputEventScreenTouch.xml @@ -11,6 +11,9 @@ <link title="InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link> </tutorials> <members> + <member name="double_tap" type="bool" setter="set_double_tap" getter="is_double_tap" default="false"> + If [code]true[/code], the touch's state is a double tap. + </member> <member name="index" type="int" setter="set_index" getter="get_index" default="0"> The touch index in the case of a multi-touch event. One index = one finger. </member> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index e9ebbc0a41..60e20cd97d 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -55,6 +55,7 @@ </member> <member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0"> The light's angular size in degrees. Increasing this will make shadows softer at greater distances. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code]. + [b]Note:[/b] [member light_angular_distance] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). </member> <member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="2"> The light's bake mode. This will affect the global illumination techniques that have an effect on the light's rendering. See [enum BakeMode]. @@ -91,6 +92,7 @@ </member> <member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0"> The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent. + [b]Note:[/b] [member light_size] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). </member> <member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5"> The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 14fb864ca8..e57cc68b36 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -224,6 +224,9 @@ <member name="secret_character" type="String" setter="set_secret_character" getter="get_secret_character" default=""•""> The character to use to mask secret input (defaults to "•"). Only a single character can be used as the secret character. </member> + <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 [LineEdit] will select the whole text when it gains focus. + </member> <member name="selecting_enabled" type="bool" setter="set_selecting_enabled" getter="is_selecting_enabled" default="true"> If [code]false[/code], it's impossible to select the text using mouse nor keyboard. </member> diff --git a/doc/classes/Marker3D.xml b/doc/classes/Marker3D.xml index 5ad1cdf513..0d49b376a8 100644 --- a/doc/classes/Marker3D.xml +++ b/doc/classes/Marker3D.xml @@ -8,4 +8,9 @@ </description> <tutorials> </tutorials> + <members> + <member name="gizmo_extents" type="float" setter="set_gizmo_extents" getter="get_gizmo_extents" default="0.25"> + Size of the gizmo cross that appears in the editor. + </member> + </members> </class> diff --git a/doc/classes/MenuBar.xml b/doc/classes/MenuBar.xml index 3ef0572e9f..e8505937ff 100644 --- a/doc/classes/MenuBar.xml +++ b/doc/classes/MenuBar.xml @@ -106,9 +106,6 @@ <member name="prefer_global_menu" type="bool" setter="set_prefer_global_menu" getter="is_prefer_global_menu" default="true"> If [code]true[/code], [MenuBar] will use system global menu when supported. </member> - <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> - The [Node] which must be a parent of the focused GUI [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. - </member> <member name="start_index" type="int" setter="set_start_index" getter="get_start_index" default="-1"> Position in the global menu to insert first [MenuBar] item at. </member> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index d3d5a7bfaa..facbe5fd0f 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -129,7 +129,7 @@ <method name="get_aabb" qualifiers="const"> <return type="AABB" /> <description> - Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. See also [method VisualInstance3D.get_transformed_aabb]. + Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. [b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh]. </description> </method> diff --git a/doc/classes/MovieWriter.xml b/doc/classes/MovieWriter.xml index f2509ad2b2..1652dd52aa 100644 --- a/doc/classes/MovieWriter.xml +++ b/doc/classes/MovieWriter.xml @@ -4,7 +4,7 @@ Abstract class for non-real-time video recording encoders. </brief_description> <description> - Godot can record videos with non-real-time simulation. Like the [code]--fixed-fps[/code] command line argument, this forces the reported [code]delta[/code] in [method Node._process] functions to be identical across frames, regardless of how long it actually took to render the frame. This can be used to record high-quality videos with perfect frame pacing regardless of your hardware's capabilities. + Godot can record videos with non-real-time simulation. Like the [code]--fixed-fps[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url], this forces the reported [code]delta[/code] in [method Node._process] functions to be identical across frames, regardless of how long it actually took to render the frame. This can be used to record high-quality videos with perfect frame pacing regardless of your hardware's capabilities. Godot has 2 built-in [MovieWriter]s: - AVI container with MJPEG for video and uncompressed audio ([code].avi[/code] file extension). Lossy compression, medium file sizes, fast encoding. The lossy compression quality can be adjusted by changing [member ProjectSettings.editor/movie_writer/mjpeg_quality]. The resulting file can be viewed in most video players, but it must be converted to another format for viewing on the web or by Godot with [VideoStreamPlayer]. MJPEG does not support transparency. AVI output is currently limited to a file of 4 GB in size at most. - PNG image sequence for video and WAV for audio ([code].png[/code] file extension). Lossless compression, large file sizes, slow encoding. Designed to be encoded to a video file with another tool such as [url=https://ffmpeg.org/]FFmpeg[/url] after recording. Transparency is currently not supported, even if the root viewport is set to be transparent. @@ -46,7 +46,7 @@ <param index="1" name="fps" type="int" /> <param index="2" name="base_path" type="String" /> <description> - Called once before the engine starts writing video and audio data. [param movie_size] is the width and height of the video to save. [param fps] is the number of frames per second specified in the project settings or using the [code]--fixed-fps <fps>[/code] command line argument. + Called once before the engine starts writing video and audio data. [param movie_size] is the width and height of the video to save. [param fps] is the number of frames per second specified in the project settings or using the [code]--fixed-fps <fps>[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </description> </method> <method name="_write_end" qualifiers="virtual"> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index ce2b5f2584..d8a232b3cf 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -19,7 +19,7 @@ <method name="get_aabb" qualifiers="const"> <return type="AABB" /> <description> - Returns the visibility axis-aligned bounding box in local space. See also [method VisualInstance3D.get_transformed_aabb]. + Returns the visibility axis-aligned bounding box in local space. </description> </method> <method name="get_instance_color" qualifiers="const"> diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml index 0f57ff9e55..6661fbfe0b 100644 --- a/doc/classes/MultiplayerPeer.xml +++ b/doc/classes/MultiplayerPeer.xml @@ -13,6 +13,20 @@ <link title="WebRTC Signaling Demo">https://godotengine.org/asset-library/asset/537</link> </tutorials> <methods> + <method name="close"> + <return type="void" /> + <description> + Immediately close the multiplayer peer returning to the state [constant CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [signal peer_disconnected]. + </description> + </method> + <method name="disconnect_peer"> + <return type="void" /> + <param index="0" name="peer" type="int" /> + <param index="1" name="force" type="bool" default="false" /> + <description> + Disconnects the given [param peer] from this host. If [param force] is [code]true[/code] the [signal peer_disconnected] signal will not be emitted for this peer. + </description> + </method> <method name="generate_unique_id" qualifiers="const"> <return type="int" /> <description> @@ -25,10 +39,22 @@ Returns the current state of the connection. See [enum ConnectionStatus]. </description> </method> + <method name="get_packet_channel" qualifiers="const"> + <return type="int" /> + <description> + Returns the channel over which the next available packet was received. See [method PacketPeer.get_available_packet_count]. + </description> + </method> + <method name="get_packet_mode" qualifiers="const"> + <return type="int" enum="MultiplayerPeer.TransferMode" /> + <description> + Returns the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [method PacketPeer.get_available_packet_count]. + </description> + </method> <method name="get_packet_peer" qualifiers="const"> <return type="int" /> <description> - Returns the ID of the [MultiplayerPeer] who sent the most recent packet. + Returns the ID of the [MultiplayerPeer] who sent the next available packet. See [method PacketPeer.get_available_packet_count]. </description> </method> <method name="get_unique_id" qualifiers="const"> @@ -37,6 +63,12 @@ Returns the ID of this [MultiplayerPeer]. </description> </method> + <method name="is_server_relay_supported" qualifiers="const"> + <return type="bool" /> + <description> + Returns true if the server can act as a relay in the current configuration (i.e. if the higher level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them). + </description> + </method> <method name="poll"> <return type="void" /> <description> @@ -61,7 +93,7 @@ [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. </member> <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="MultiplayerPeer.TransferMode" default="2"> - The manner in which to send packets to the [code]target_peer[/code]. See [enum TransferMode]. + The manner in which to send packets to the target peer. See [enum TransferMode], and the [method set_target_peer] method. </member> </members> <signals> diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml index 18bc18e6e7..5717135b80 100644 --- a/doc/classes/MultiplayerPeerExtension.xml +++ b/doc/classes/MultiplayerPeerExtension.xml @@ -9,6 +9,20 @@ <tutorials> </tutorials> <methods> + <method name="_close" qualifiers="virtual"> + <return type="void" /> + <description> + Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]). + </description> + </method> + <method name="_disconnect_peer" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="p_peer" type="int" /> + <param index="1" name="p_force" type="bool" /> + <description> + Called when the connected [param p_peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]). + </description> + </method> <method name="_get_available_packet_count" qualifiers="virtual const"> <return type="int" /> <description> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index 3437e0eca4..8cf7824ff7 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -5,7 +5,7 @@ </brief_description> <description> 2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe. - [b]Note:[/b] After [method set_target_location] is used it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node. + [b]Note:[/b] After setting [member target_location] it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node. </description> <tutorials> </tutorials> @@ -13,7 +13,7 @@ <method name="distance_to_target" qualifiers="const"> <return type="float" /> <description> - Returns the distance to the target location, using the agent's global position. The user must set the target location with [method set_target_location] in order for this to be accurate. + Returns the distance to the target location, using the agent's global position. The user must set [member target_location] in order for this to be accurate. </description> </method> <method name="get_final_location"> @@ -59,12 +59,6 @@ Returns the [RID] of this agent on the [NavigationServer2D]. </description> </method> - <method name="get_target_location" qualifiers="const"> - <return type="Vector2" /> - <description> - Returns the user defined [Vector2] after setting the target location. - </description> - </method> <method name="is_navigation_finished"> <return type="bool" /> <description> @@ -74,13 +68,13 @@ <method name="is_target_reachable"> <return type="bool" /> <description> - Returns true if the target location is reachable. The target location is set using [method set_target_location]. + Returns true if [member target_location] is reachable. </description> </method> <method name="is_target_reached" qualifiers="const"> <return type="bool" /> <description> - Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. + Returns true if [member target_location] is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. </description> </method> <method name="set_navigation_layer_value"> @@ -98,13 +92,6 @@ Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the [code]agent[/code] on the NavigationServer. </description> </method> - <method name="set_target_location"> - <return type="void" /> - <param index="0" name="location" type="Vector2" /> - <description> - Sets the user desired final location. This will clear the current navigation path. - </description> - </method> <method name="set_velocity"> <return type="void" /> <param index="0" name="velocity" type="Vector2" /> @@ -142,6 +129,9 @@ <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. </member> + <member name="target_location" type="Vector2" setter="set_target_location" getter="get_target_location" default="Vector2(0, 0)"> + The user-defined target location. Setting this property will clear the current navigation path. + </member> <member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="20.0"> The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive. </member> @@ -159,11 +149,11 @@ </signal> <signal name="target_reached"> <description> - Notifies when the player defined target, set with [method set_target_location], is reached. + Notifies when the player-defined [member target_location] is reached. </description> </signal> <signal name="velocity_computed"> - <param index="0" name="safe_velocity" type="Vector3" /> + <param index="0" name="safe_velocity" type="Vector2" /> <description> Notifies when the collision avoidance velocity is calculated. Emitted by [method set_velocity]. Only emitted when [member avoidance_enabled] is true. </description> diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index 3bb5b361ca..44c17647f7 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -5,7 +5,7 @@ </brief_description> <description> 3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe. - [b]Note:[/b] After [method set_target_location] is used it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node. + [b]Note:[/b] After setting [member target_location] it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node. </description> <tutorials> </tutorials> @@ -13,7 +13,7 @@ <method name="distance_to_target" qualifiers="const"> <return type="float" /> <description> - Returns the distance to the target location, using the agent's global position. The user must set the target location with [method set_target_location] in order for this to be accurate. + Returns the distance to the target location, using the agent's global position. The user must set [member target_location] in order for this to be accurate. </description> </method> <method name="get_final_location"> @@ -59,12 +59,6 @@ Returns the [RID] of this agent on the [NavigationServer3D]. </description> </method> - <method name="get_target_location" qualifiers="const"> - <return type="Vector3" /> - <description> - Returns the user defined [Vector3] after setting the target location. - </description> - </method> <method name="is_navigation_finished"> <return type="bool" /> <description> @@ -74,13 +68,13 @@ <method name="is_target_reachable"> <return type="bool" /> <description> - Returns true if the target location is reachable. The target location is set using [method set_target_location]. + Returns true if [member target_location] is reachable. </description> </method> <method name="is_target_reached" qualifiers="const"> <return type="bool" /> <description> - Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. + Returns true if [member target_location] is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. </description> </method> <method name="set_navigation_layer_value"> @@ -98,13 +92,6 @@ Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the [code]agent[/code] on the NavigationServer. </description> </method> - <method name="set_target_location"> - <return type="void" /> - <param index="0" name="location" type="Vector3" /> - <description> - Sets the user desired final location. This will clear the current navigation path. - </description> - </method> <method name="set_velocity"> <return type="void" /> <param index="0" name="velocity" type="Vector3" /> @@ -148,6 +135,9 @@ <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. </member> + <member name="target_location" type="Vector3" setter="set_target_location" getter="get_target_location" default="Vector3(0, 0, 0)"> + The user-defined target location. Setting this property will clear the current navigation path. + </member> <member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="5.0"> The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive. </member> @@ -165,7 +155,7 @@ </signal> <signal name="target_reached"> <description> - Notifies when the player defined target, set with [method set_target_location], is reached. + Notifies when the player-defined [member target_location] is reached. </description> </signal> <signal name="velocity_computed"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index bceb285584..bf52c55d67 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -39,7 +39,7 @@ <method name="_get_configuration_warnings" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> - The elements in the array returned from this method are displayed as warnings in the Scene Dock if the script that overrides it is a [code]tool[/code] script. + The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script. Returning an empty array produces no warnings. Call [method update_configuration_warnings] when the warnings need to be updated for this node. </description> @@ -529,9 +529,9 @@ <method name="move_child"> <return type="void" /> <param index="0" name="child_node" type="Node" /> - <param index="1" name="to_position" type="int" /> + <param index="1" name="to_index" type="int" /> <description> - Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. If [param to_position] is negative, the index will be counted from the end. + Moves a child node to a different index (order) among the other children. Since calls, signals, etc. are performed by tree order, changing the order of children nodes may be useful. If [param to_index] is negative, the index will be counted from the end. [b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]). </description> </method> @@ -560,7 +560,7 @@ <method name="print_tree_pretty"> <return type="void" /> <description> - Similar to [method print_tree], this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the scene inspector. It is useful for inspecting larger trees. + Similar to [method print_tree], this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees. [b]Example output:[/b] [codeblock] ┖╴TheGame diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 3df7ec931f..bc2570b183 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -296,6 +296,7 @@ <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> Scale part of the local transformation. [b]Note:[/b] Mixed negative scales in 3D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, the scale values will either be all positive or all negative. + [b]Note:[/b] Not all nodes are visually scaled by the [member scale] property. For example, [Light3D]s are not visually affected by [member scale]. </member> <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false"> If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space. diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 9db100c9f8..022b4826ea 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -4,7 +4,7 @@ Pre-parsed scene tree path. </brief_description> <description> - A pre-parsed relative or absolute path in a scene tree, for use with [method Node.get_node] and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For instance, [code]"Path2D/PathFollow2D/Sprite2D:texture:size"[/code] would refer to the [code]size[/code] property of the [code]texture[/code] resource on the node named [code]"Sprite2D"[/code] which is a child of the other named nodes in the path. + A pre-parsed relative or absolute path in a scene tree, for use with [method Node.get_node] and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For example, [code]"Path2D/PathFollow2D/Sprite2D:texture:size"[/code] would refer to the [code]size[/code] property of the [code]texture[/code] resource on the node named [code]"Sprite2D"[/code] which is a child of the other named nodes in the path. You will usually just pass a string to [method Node.get_node] and it will be automatically converted, but you may occasionally want to parse a path ahead of time with [NodePath] or the literal syntax [code]^"path"[/code]. Exporting a [NodePath] variable will give you a node selection widget in the properties panel of the editor, which can often be useful. A [NodePath] is composed of a list of slash-separated node names (like a filesystem path) and an optional colon-separated list of "subnames" which can be resources or properties. Some examples of NodePaths include the following: diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 15b3d4958c..0c74690924 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -4,7 +4,8 @@ Operating System functions. </brief_description> <description> - Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc. + Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc. + [b]Note:[/b] In Godot 4, [OS] functions related to window management were moved to the [DisplayServer] singleton. </description> <tutorials> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> @@ -445,6 +446,15 @@ [b]Note:[/b] This method is not supported on the web platform. It returns an empty string. </description> </method> + <method name="get_video_adapter_driver_info" qualifiers="const"> + <return type="PackedStringArray" /> + <description> + Returns the video adapter driver name and version for the user's currently active graphics card. + The first element holds the driver name, such as [code]nvidia[/code], [code]amdgpu[/code], etc. + The second element holds the driver version. For e.g. the [code]nvidia[/code] driver on a Linux/BSD platform, the version is in the format [code]510.85.02[/code]. For Windows, the driver's format is [code]31.0.15.1659[/code]. + [b]Note:[/b] This method is only supported on the platforms Linux/BSD and Windows when not running in headless mode. It returns an empty array on other platforms. + </description> + </method> <method name="has_environment" qualifiers="const"> <return type="bool" /> <param index="0" name="variable" type="String" /> @@ -616,11 +626,11 @@ </member> </members> <constants> - <constant name="VIDEO_DRIVER_VULKAN" value="0" enum="VideoDriver"> - The Vulkan rendering backend. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available. + <constant name="RENDERING_DRIVER_VULKAN" value="0" enum="RenderingDriver"> + The Vulkan rendering driver. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available. </constant> - <constant name="VIDEO_DRIVER_OPENGL_3" value="1" enum="VideoDriver"> - The OpenGL 3 rendering backend. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. + <constant name="RENDERING_DRIVER_OPENGL3" value="1" enum="RenderingDriver"> + The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. </constant> <constant name="DAY_SUNDAY" value="0" enum="Weekday"> Sunday. diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 7ad1908bb5..34cf259f63 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -364,9 +364,9 @@ </method> <method name="get_indexed" qualifiers="const"> <return type="Variant" /> - <param index="0" name="property" type="NodePath" /> + <param index="0" name="property_path" type="NodePath" /> <description> - Gets the object's property indexed by the given [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Examples: [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code]. + 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. Examples: [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. </description> </method> @@ -384,7 +384,7 @@ <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. + [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> <method name="get_meta_list" qualifiers="const"> @@ -430,7 +430,7 @@ <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. </description> </method> <method name="has_method" qualifiers="const"> @@ -502,7 +502,7 @@ <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]. - [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. </description> </method> <method name="set"> @@ -532,10 +532,10 @@ </method> <method name="set_indexed"> <return type="void" /> - <param index="0" name="property" type="NodePath" /> + <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 [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Example: + 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. Example: [codeblocks] [gdscript] var node = Node2D.new() @@ -566,7 +566,7 @@ <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. + [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> <method name="set_script"> diff --git a/doc/classes/OccluderInstance3D.xml b/doc/classes/OccluderInstance3D.xml index 0bebc7ea43..bc16fba500 100644 --- a/doc/classes/OccluderInstance3D.xml +++ b/doc/classes/OccluderInstance3D.xml @@ -42,7 +42,7 @@ </member> <member name="occluder" type="Occluder3D" setter="set_occluder" getter="get_occluder"> The occluder resource for this [OccluderInstance3D]. You can generate an occluder resource by selecting an [OccluderInstance3D] node then using the [b]Bake Occluders[/b] button at the top of the editor. - You can also draw your own 2D occluder polygon by adding a new [PolygonOccluder3D] resource to the [member occluder] property in the inspector. + You can also draw your own 2D occluder polygon by adding a new [PolygonOccluder3D] resource to the [member occluder] property in the Inspector. Alternatively, you can select a primitive occluder to use: [QuadOccluder3D], [BoxOccluder3D] or [SphereOccluder3D]. </member> </members> diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml index ce63dbdbc1..193ae8deeb 100644 --- a/doc/classes/OmniLight3D.xml +++ b/doc/classes/OmniLight3D.xml @@ -15,6 +15,7 @@ </member> <member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0"> The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius. + [b]Note:[/b] [member omni_range] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). </member> <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1"> See [enum ShadowMode]. diff --git a/doc/classes/ParticleProcessMaterial.xml b/doc/classes/ParticleProcessMaterial.xml index a41207e9b3..d4050e3bd1 100644 --- a/doc/classes/ParticleProcessMaterial.xml +++ b/doc/classes/ParticleProcessMaterial.xml @@ -217,7 +217,7 @@ Maximum linear acceleration applied to each particle in the direction of motion. </member> <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum equivalent of [member linear_accel_min]. + Minimum equivalent of [member linear_accel_max]. </member> <member name="orbit_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's orbital velocity will vary along this [CurveTexture]. @@ -259,6 +259,10 @@ <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0"> Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. </member> + <member name="sub_emitter_amount_at_collision" type="int" setter="set_sub_emitter_amount_at_collision" getter="get_sub_emitter_amount_at_collision"> + Sub particle amount on collision. + Maximum amount set in the sub particles emitter. + </member> <member name="sub_emitter_amount_at_end" type="int" setter="set_sub_emitter_amount_at_end" getter="get_sub_emitter_amount_at_end"> </member> <member name="sub_emitter_frequency" type="float" setter="set_sub_emitter_frequency" getter="get_sub_emitter_frequency"> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index e51e3753fc..fbe8afa8d1 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -119,6 +119,12 @@ Returns [code]true[/code] if this plane and [param to_plane] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this plane is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="is_point_over" qualifiers="const"> <return type="bool" /> <param index="0" name="point" type="Vector3" /> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 12f8055180..a3fc326351 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -92,6 +92,7 @@ [b]Note:[/b] This returns a copy of the [PackedVector2Array] rather than a reference. </member> <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[]"> + The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in. </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> </member> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 23287f4de1..c99760996f 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -533,6 +533,8 @@ <param index="0" name="id" type="int" /> <description> Emitted when an item of some [param id] is pressed or its accelerator is activated. + + [b]Note:[/b] If [param id] is negative (either explicitly or due to overflow), this will return the correponding index instead. </description> </signal> <signal name="index_pressed"> diff --git a/doc/classes/PortableCompressedTexture2D.xml b/doc/classes/PortableCompressedTexture2D.xml index c7e2f2fbdc..a0492f2c07 100644 --- a/doc/classes/PortableCompressedTexture2D.xml +++ b/doc/classes/PortableCompressedTexture2D.xml @@ -22,7 +22,7 @@ <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. - If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WEBP compression quality. + If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. </description> </method> <method name="get_compression_mode" qualifiers="const"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 214f087d78..91d9bdd4a2 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -251,7 +251,7 @@ Changes to this setting will only be applied upon restarting the application. </member> <member name="application/run/disable_stdout" type="bool" setter="" getter="" default="false"> - If [code]true[/code], disables printing to standard output. This is equivalent to starting the editor or project with the [code]--quiet[/code] command line argument. See also [member application/run/disable_stderr]. + If [code]true[/code], disables printing to standard output. This is equivalent to starting the editor or project with the [code]--quiet[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. See also [member application/run/disable_stderr]. Changes to this setting will only be applied upon restarting the application. </member> <member name="application/run/flush_stdout_on_print" type="bool" setter="" getter="" default="false"> @@ -297,7 +297,7 @@ <member name="audio/driver/driver" type="String" setter="" getter=""> Specifies the audio driver to use. This setting is platform-dependent as each platform supports different audio drivers. If left empty, the default audio driver will be used. The [code]Dummy[/code] audio driver disables all audio playback and recording, which is useful for non-game applications as it reduces CPU usage. It also prevents the engine from appearing as an application playing audio in the OS' audio mixer. - [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--audio-driver[/code] command line argument. + [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--audio-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </member> <member name="audio/driver/enable_input" type="bool" setter="" getter="" default="false"> If [code]true[/code], microphone input will be allowed. This requires appropriate permissions to be set when exporting to Android or iOS. @@ -413,6 +413,9 @@ <member name="debug/gdscript/warnings/standalone_ternary" type="int" setter="" getter="" default="1"> When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a ternary expression that has no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement. </member> + <member name="debug/gdscript/warnings/static_called_on_instance" type="int" setter="" getter="" default="1"> + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a static method from an instance of a class instead of from the class directly. + </member> <member name="debug/gdscript/warnings/treat_warnings_as_errors" type="bool" setter="" getter="" default="false"> If [code]true[/code], all warnings will be reported as if they are errors. </member> @@ -477,7 +480,7 @@ Print GPU profile information to standard output every second. This includes how long each frame takes the GPU to render on average, broken down into different steps of the render pipeline, such as CanvasItems, shadows, glow, etc. </member> <member name="debug/settings/stdout/verbose_stdout" type="bool" setter="" getter="" default="false"> - Print more information to standard output when running. It displays information such as memory leaks, which scenes and resources are being loaded, etc. This can also be enabled using the [code]--verbose[/code] or [code]-v[/code] command line argument, even on an exported project. See also [method OS.is_stdout_verbose] and [method @GlobalScope.print_verbose]. + Print more information to standard output when running. It displays information such as memory leaks, which scenes and resources are being loaded, etc. This can also be enabled using the [code]--verbose[/code] or [code]-v[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url], even on an exported project. See also [method OS.is_stdout_verbose] and [method @GlobalScope.print_verbose]. </member> <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color(1, 0.2, 0.1, 0.8)"> Color of the contact points between collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. @@ -562,11 +565,21 @@ The default screen orientation to use on mobile devices. See [enum DisplayServer.ScreenOrientation] for possible values. [b]Note:[/b] When set to a portrait orientation, this project setting does not flip the project resolution's width and height automatically. Instead, you have to set [member display/window/size/viewport_width] and [member display/window/size/viewport_height] accordingly. </member> + <member name="display/window/ios/allow_high_refresh_rate" type="bool" setter="" getter="" default="true"> + If [code]true[/code], iOS devices that support high refresh rate/"ProMotion" will be allowed to render at up to 120 frames per second. + </member> <member name="display/window/ios/hide_home_indicator" type="bool" setter="" getter="" default="true"> If [code]true[/code], the home indicator is hidden automatically. This only affects iOS devices without a physical home button. </member> + <member name="display/window/ios/hide_status_bar" type="bool" setter="" getter="" default="true"> + If [code]true[/code], the status bar is hidden while the app is running. + </member> + <member name="display/window/ios/suppress_ui_gesture" type="bool" setter="" getter="" default="true"> + If [code]true[/code], it will require two swipes to access iOS UI that uses gestures. + [b]Note:[/b] This setting has no effect on the home indicator if [code]hide_home_indicator[/code] is [code]true[/code]. + </member> <member name="display/window/per_pixel_transparency/allowed" type="bool" setter="" getter="" default="false"> - If [code]true[/code], allows per-pixel transparency for the window background. This affects performance, so leave it on [code]false[/code] unless you need it. + If [code]true[/code], allows per-pixel transparency for the window background. This affects performance, so leave it on [code]false[/code] unless you need it. See also [member display/window/size/transparent] and [member rendering/transparent_background]. </member> <member name="display/window/size/always_on_top" type="bool" setter="" getter="" default="false"> Forces the main window to be always on top. @@ -591,8 +604,8 @@ [b]Note:[/b] This setting is ignored on iOS. </member> <member name="display/window/size/transparent" type="bool" setter="" getter="" default="false"> - Main window background can be transparent. - [b]Note:[/b] To use transparent splash screen, set [member application/boot_splash/bg_color] to [code]Color(0, 0, 0, 0)[/code]. + If [code]true[/code], enables a window manager hint that the main window background [i]can[/i] be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling [member rendering/transparent_background]. + [b]Note:[/b] To use a transparent splash screen, set [member application/boot_splash/bg_color] to [code]Color(0, 0, 0, 0)[/code]. [b]Note:[/b] This setting has no effect if [member display/window/per_pixel_transparency/allowed] is set to [code]false[/code]. </member> <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="648"> @@ -620,7 +633,7 @@ </member> <member name="editor/movie_writer/fps" type="int" setter="" getter="" default="60"> The number of frames per second to record in the video when writing a movie. Simulation speed will adjust to always match the specified framerate, which means the engine will appear to run slower at higher [member editor/movie_writer/fps] values. Certain FPS values will require you to adjust [member editor/movie_writer/mix_rate] to prevent audio from desynchronizing over time. - This can be specified manually on the command line using the [code]--fixed-fps <fps>[/code] command line argument. + This can be specified manually on the command line using the [code]--fixed-fps <fps>[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </member> <member name="editor/movie_writer/mix_rate" type="int" setter="" getter="" default="48000"> The audio mix rate to use in the recorded audio when writing a movie (in Hz). This can be different from [member audio/driver/mix_rate], but this value must be divisible by [member editor/movie_writer/fps] to prevent audio from desynchronizing over time. @@ -684,7 +697,8 @@ Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. </member> <member name="gui/common/swap_cancel_ok" type="bool" setter="" getter=""> - If [code]true[/code], swaps Cancel and OK buttons in dialogs on Windows and UWP to follow interface conventions. + If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time. + [b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show]. </member> <member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024"> Maximum undo/redo history size for [TextEdit] fields. @@ -820,6 +834,13 @@ </member> <member name="input/ui_swap_input_direction" type="Dictionary" setter="" getter=""> </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. + If no selection is currently active with the last caret in text fields, selects the word currently under the caret. + The action can be performed sequentially for all occurrences of the selection of the last caret and for all existing carets. + The viewport is adjusted to the latest newly added caret. + [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. + </member> <member name="input/ui_text_backspace" type="Dictionary" setter="" getter=""> Default [InputEventAction] to delete the character before the text cursor. [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. @@ -838,6 +859,18 @@ <member name="input/ui_text_backspace_word.macos" type="Dictionary" setter="" getter=""> macOS specific override for the shortcut to delete a word. </member> + <member name="input/ui_text_caret_add_above" type="Dictionary" setter="" getter=""> + Default [InputEventAction] to add an additional caret above every caret of a text + </member> + <member name="input/ui_text_caret_add_above.macos" type="Dictionary" setter="" getter=""> + macOS specific override for the shortcut to add a caret above every caret + </member> + <member name="input/ui_text_caret_add_below" type="Dictionary" setter="" getter=""> + Default [InputEventAction] to add an additional caret below every caret of a text + </member> + <member name="input/ui_text_caret_add_below.macos" type="Dictionary" setter="" getter=""> + macOS specific override for the shortcut to add a caret below every caret + </member> <member name="input/ui_text_caret_document_end" type="Dictionary" setter="" getter=""> Default [InputEventAction] to move the text cursor the the end of the text. [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. @@ -954,6 +987,10 @@ Default [InputEventAction] to insert a new line after the current one. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_text_remove_secondary_carets" type="Dictionary" setter="" getter=""> + If multiple carets are currently active, clear additional carets and keep just one caret. + [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. + </member> <member name="input/ui_text_scroll_down" type="Dictionary" setter="" getter=""> Default [InputEventAction] to scroll down one line of text. [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. @@ -974,7 +1011,7 @@ </member> <member name="input/ui_text_select_word_under_caret" type="Dictionary" setter="" getter=""> If no selection is currently active, selects the word currently under the caret in text fields. If a selection is currently active, deselects the current selection. - [b]Note:[/b] Currently, this is only implemented in [TextEdit], not [LineEdit]. + [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> <member name="input/ui_text_submit" type="Dictionary" setter="" getter=""> Default [InputEventAction] to submit a text field. @@ -1000,7 +1037,7 @@ </member> <member name="input_devices/pen_tablet/driver" type="String" setter="" getter=""> Specifies the tablet driver to use. If left empty, the default driver will be used. - [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--tablet-driver[/code] command line argument. + [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--tablet-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </member> <member name="input_devices/pen_tablet/driver.windows" type="String" setter="" getter=""> Override for [member input_devices/pen_tablet/driver] on Windows. @@ -1065,8 +1102,8 @@ <member name="internationalization/rendering/text_driver" type="String" setter="" getter="" default=""""> Specifies the [TextServer] to use. If left empty, the default will be used. "ICU / HarfBuzz / Graphite" is the most advanced text driver, supporting right-to-left typesetting and complex scripts (for languages like Arabic, Hebrew, etc). The "Fallback" text driver does not support right-to-left typesetting and complex scripts. - [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--text-driver[/code] command line argument. - [b]Note:[/b] There is an additional [code]Dummy[/code] text driver available, which disables all text rendering and font-related functionality. This driver is not listed in the project settings, but it can be enabled when running the editor or project using the [code]--text-driver Dummy[/code] command line argument. + [b]Note:[/b] The driver in use can be overridden at runtime via the [code]--text-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. + [b]Note:[/b] There is an additional [code]Dummy[/code] text driver available, which disables all text rendering and font-related functionality. This driver is not listed in the project settings, but it can be enabled when running the editor or project using the [code]--text-driver Dummy[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </member> <member name="layer_names/2d_navigation/layer_1" type="String" setter="" getter="" default=""""> Optional name for the 2D navigation layer 1. If left empty, the layer will display as "Layer 1". @@ -1801,7 +1838,9 @@ Another way to combat specular aliasing is to enable [member rendering/anti_aliasing/screen_space_roughness_limiter/enabled]. </member> <member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false"> - If [code]true[/code], uses a fast post-processing dithering filter on the default screen [Viewport] to make banding significantly less visible. In some cases, the dithering pattern may be slightly noticable. Note that this will make losslessly compressed (PNG etc.) screenshots larger. + If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. + In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + [b]Note:[/b] This property is only read when the project starts. To set debanding at run-time, set [member Viewport.use_debanding] on the root [Viewport] instead. </member> <member name="rendering/anti_aliasing/quality/use_taa" type="bool" setter="" getter="" default="false"> Enables Temporal Anti-Aliasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. Enabling TAA can make the image blurrier, which is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]). @@ -2100,8 +2139,6 @@ <member name="rendering/renderer/rendering_method.web" type="String" setter="" getter="" default=""gl_compatibility""> Override for [member rendering/renderer/rendering_method] on web. </member> - <member name="rendering/rendering_device/descriptor_pools/max_descriptors_per_pool" type="int" setter="" getter="" default="64"> - </member> <member name="rendering/rendering_device/driver" type="String" setter="" getter="" default=""vulkan""> Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can not be edited directly, instead, set the driver using the platform-specific overrides. </member> @@ -2126,6 +2163,8 @@ </member> <member name="rendering/rendering_device/staging_buffer/texture_upload_region_size_px" type="int" setter="" getter="" default="64"> </member> + <member name="rendering/rendering_device/vulkan/max_descriptors_per_pool" type="int" setter="" getter="" default="64"> + </member> <member name="rendering/scaling_3d/fsr_sharpness" type="float" setter="" getter="" default="0.2"> Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference. </member> @@ -2202,6 +2241,9 @@ 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/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> <member name="rendering/vrs/mode" type="int" setter="" getter="" default="0"> Set the default Variable Rate Shading (VRS) mode for the main viewport. See [member Viewport.vrs_mode] to change this at runtime, and [enum Viewport.VRSMode] for possible values. </member> diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml index 5690ea5e95..602833bca5 100644 --- a/doc/classes/Projection.xml +++ b/doc/classes/Projection.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Projection" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + 3D projection (4x4 matrix). </brief_description> <description> + A 4x4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four [Vector4] columns. + For purely linear transformations (translation, rotation, and scale), it is recommended to use [Transform3D], as it is more performant and has a lower memory footprint. + Used internally as [Camera3D]'s projection matrix. </description> <tutorials> </tutorials> @@ -10,18 +14,21 @@ <constructor name="Projection"> <return type="Projection" /> <description> + Constructs a default-initialized [Projection] set to [constant IDENTITY]. </description> </constructor> <constructor name="Projection"> <return type="Projection" /> <param index="0" name="from" type="Projection" /> <description> + Constructs a [Projection] as a copy of the given [Projection]. </description> </constructor> <constructor name="Projection"> <return type="Projection" /> <param index="0" name="from" type="Transform3D" /> <description> + Constructs a Projection as a copy of the given [Transform3D]. </description> </constructor> <constructor name="Projection"> @@ -40,12 +47,14 @@ <return type="Projection" /> <param index="0" name="flip_y" type="bool" /> <description> + Creates a new [Projection] that projects positions from a depth range of [code]-1[/code] to [code]1[/code] to one that ranges from [code]0[/code] to [code]1[/code], and flips the projected positions vertically, according to [param flip_y]. </description> </method> <method name="create_fit_aabb" qualifiers="static"> <return type="Projection" /> <param index="0" name="aabb" type="AABB" /> <description> + Creates a new [Projection] that scales a given projection to fit around a given [AABB] in projection space. </description> </method> <method name="create_for_hmd" qualifiers="static"> @@ -59,6 +68,8 @@ <param index="6" name="z_near" type="float" /> <param index="7" name="z_far" type="float" /> <description> + Creates a new [Projection] for projecting positions onto a head-mounted display with the given X:Y aspect ratio, distance between eyes, display width, distance to lens, oversampling factor, and depth clipping planes. + [param eye] creates the projection for the left eye when set to 1, or the right eye when set to 2. </description> </method> <method name="create_frustum" qualifiers="static"> @@ -70,6 +81,7 @@ <param index="4" name="z_near" type="float" /> <param index="5" name="z_far" type="float" /> <description> + Creates a new [Projection] that projects positions in a frustum with the given clipping planes. </description> </method> <method name="create_frustum_aspect" qualifiers="static"> @@ -81,12 +93,15 @@ <param index="4" name="z_far" type="float" /> <param index="5" name="flip_fov" type="bool" default="false" /> <description> + Creates a new [Projection] that projects positions in a frustum with the given size, X:Y aspect ratio, offset, and clipping planes. + [param flip_fov] determines whether the projection's field of view is flipped over its diagonal. </description> </method> <method name="create_light_atlas_rect" qualifiers="static"> <return type="Projection" /> <param index="0" name="rect" type="Rect2" /> <description> + Creates a new [Projection] that projects positions into the given [Rect2]. </description> </method> <method name="create_orthogonal" qualifiers="static"> @@ -98,6 +113,7 @@ <param index="4" name="z_near" type="float" /> <param index="5" name="z_far" type="float" /> <description> + Creates a new [Projection] that projects positions using an orthogonal projection with the given clipping planes. </description> </method> <method name="create_orthogonal_aspect" qualifiers="static"> @@ -108,6 +124,8 @@ <param index="3" name="z_far" type="float" /> <param index="4" name="flip_fov" type="bool" default="false" /> <description> + Creates a new [Projection] that projects positions using an orthogonal projection with the given size, X:Y aspect ratio, and clipping planes. + [param flip_fov] determines whether the projection's field of view is flipped over its diagonal. </description> </method> <method name="create_perspective" qualifiers="static"> @@ -118,6 +136,8 @@ <param index="3" name="z_far" type="float" /> <param index="4" name="flip_fov" type="bool" default="false" /> <description> + Creates a new [Projection] that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping planes. + [param flip_fov] determines whether the projection's field of view is flipped over its diagonal. </description> </method> <method name="create_perspective_hmd" qualifiers="static"> @@ -131,31 +151,40 @@ <param index="6" name="intraocular_dist" type="float" /> <param index="7" name=" convergence_dist" type="float" /> <description> + Creates a new [Projection] that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on. + [param eye] creates the projection for the left eye when set to 1, or the right eye when set to 2. + [param flip_fov] determines whether the projection's field of view is flipped over its diagonal. </description> </method> <method name="determinant" qualifiers="const"> <return type="float" /> <description> + Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area. + The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications. </description> </method> <method name="flipped_y" qualifiers="const"> <return type="Projection" /> <description> + Returns a copy of this [Projection] with the signs of the values of the Y column flipped. </description> </method> <method name="get_aspect" qualifiers="const"> <return type="float" /> <description> + Returns the X:Y aspect ratio of this [Projection]'s viewport. </description> </method> <method name="get_far_plane_half_extents" qualifiers="const"> <return type="Vector2" /> <description> + Returns the dimensions of the far clipping plane of the projection, divided by two. </description> </method> <method name="get_fov" qualifiers="const"> <return type="float" /> <description> + Returns the horizontal field of view of the projection (in degrees). </description> </method> <method name="get_fovy" qualifiers="static"> @@ -163,89 +192,114 @@ <param index="0" name="fovx" type="float" /> <param index="1" name="aspect" type="float" /> <description> + Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio. </description> </method> <method name="get_lod_multiplier" qualifiers="const"> <return type="float" /> <description> + Returns the factor by which the visible level of detail is scaled by this [Projection]. </description> </method> <method name="get_pixels_per_meter" qualifiers="const"> <return type="int" /> <param index="0" name="for_pixel_width" type="int" /> <description> + Returns the number of pixels with the given pixel width displayed per meter, after this [Projection] is applied. </description> </method> <method name="get_projection_plane" qualifiers="const"> <return type="Plane" /> <param index="0" name="plane" type="int" /> <description> + Returns the clipping plane of this [Projection] whose index is given by [param plane]. + [param plane] should be equal to one of [constant PLANE_NEAR], [constant PLANE_FAR], [constant PLANE_LEFT], [constant PLANE_TOP], [constant PLANE_RIGHT], or [constant PLANE_BOTTOM]. </description> </method> <method name="get_viewport_half_extents" qualifiers="const"> <return type="Vector2" /> <description> + Returns the dimensions of the viewport plane that this [Projection] projects positions onto, divided by two. </description> </method> <method name="get_z_far" qualifiers="const"> <return type="float" /> <description> + Returns the distance for this [Projection] beyond which positions are clipped. </description> </method> <method name="get_z_near" qualifiers="const"> <return type="float" /> <description> + Returns the distance for this [Projection] before which positions are clipped. </description> </method> <method name="inverse" qualifiers="const"> <return type="Projection" /> <description> + Returns a [Projection] that performs the inverse of this [Projection]'s projective transformation. </description> </method> <method name="is_orthogonal" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if this [Projection] performs an orthogonal projection. </description> </method> <method name="jitter_offseted" qualifiers="const"> <return type="Projection" /> <param index="0" name="offset" type="Vector2" /> <description> + Returns a [Projection] with the X and Y values from the given [Vector2] added to the first and second values of the final column respectively. </description> </method> <method name="perspective_znear_adjusted" qualifiers="const"> <return type="Projection" /> <param index="0" name="new_znear" type="float" /> <description> + Returns a [Projection] with the near clipping distance adjusted to be [param new_znear]. + [b]Note:[/b] The original [Projection] must be a perspective projection. </description> </method> </methods> <members> <member name="w" type="Vector4" setter="" getter="" default="Vector4(0, 0, 0, 1)"> + The projection matrix's W vector (column 3). Equivalent to array index [code]3[/code]. </member> <member name="x" type="Vector4" setter="" getter="" default="Vector4(1, 0, 0, 0)"> + The projection matrix's X vector (column 0). Equivalent to array index [code]0[/code]. </member> <member name="y" type="Vector4" setter="" getter="" default="Vector4(0, 1, 0, 0)"> + The projection matrix's Y vector (column 1). Equivalent to array index [code]1[/code]. </member> <member name="z" type="Vector4" setter="" getter="" default="Vector4(0, 0, 1, 0)"> + The projection matrix's Z vector (column 2). Equivalent to array index [code]2[/code]. </member> </members> <constants> <constant name="PLANE_NEAR" value="0"> + The index value of the projection's near clipping plane. </constant> <constant name="PLANE_FAR" value="1"> + The index value of the projection's far clipping plane. </constant> <constant name="PLANE_LEFT" value="2"> + The index value of the projection's left clipping plane. </constant> <constant name="PLANE_TOP" value="3"> + The index value of the projection's top clipping plane. </constant> <constant name="PLANE_RIGHT" value="4"> + The index value of the projection's right clipping plane. </constant> <constant name="PLANE_BOTTOM" value="5"> + The index value of the projection bottom clipping plane. </constant> <constant name="IDENTITY" value="Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"> + A [Projection] with no transformation defined. When applied to other data structures, no transformation is performed. </constant> <constant name="ZERO" value="Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"> + A [Projection] with all values initialized to 0. When applied to other data structures, they will be zeroed. </constant> </constants> <operators> @@ -253,30 +307,38 @@ <return type="bool" /> <param index="0" name="right" type="Projection" /> <description> + Returns [code]true[/code] if the projections are not equal. + [b]Note:[/b] Due to floating-point precision errors, this may return [code]true[/code], even if the projections are virtually equal. An [code]is_equal_approx[/code] method may be added in a future version of Godot. </description> </operator> <operator name="operator *"> <return type="Projection" /> <param index="0" name="right" type="Projection" /> <description> + Returns a [Projection] that applies the combined transformations of this [Projection] and [param right]. </description> </operator> <operator name="operator *"> <return type="Vector4" /> <param index="0" name="right" type="Vector4" /> <description> + Projects (multiplies) the given [Vector4] by this [Projection] matrix. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Projection" /> <description> + Returns [code]true[/code] if the projections are equal. + [b]Note:[/b] Due to floating-point precision errors, this may return [code]false[/code], even if the projections are virtually equal. An [code]is_equal_approx[/code] method may be added in a future version of Godot. </description> </operator> <operator name="operator []"> <return type="Vector4" /> <param index="0" name="index" type="int" /> <description> + Returns the column of the [Projection] with the given index. + Indices are in the following order: x, y, z, w. </description> </operator> </operators> diff --git a/doc/classes/PropertyTweener.xml b/doc/classes/PropertyTweener.xml index 75d9c919aa..78ead65cdd 100644 --- a/doc/classes/PropertyTweener.xml +++ b/doc/classes/PropertyTweener.xml @@ -27,7 +27,7 @@ Sets a custom initial value to the [PropertyTweener]. Example: [codeblock] var tween = get_tree().create_tween() - tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100) #this will move the node from position (100, 100) to (200, 100) + tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will move the node from position (100, 100) to (200, 100) [/codeblock] </description> </method> diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index f21ebf57e2..99dffeff9d 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -115,6 +115,12 @@ Returns [code]true[/code] if this quaternion and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this quaternion is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="is_normalized" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/RDPipelineRasterizationState.xml b/doc/classes/RDPipelineRasterizationState.xml index 39a64c730a..48599b6262 100644 --- a/doc/classes/RDPipelineRasterizationState.xml +++ b/doc/classes/RDPipelineRasterizationState.xml @@ -13,7 +13,7 @@ </member> <member name="depth_bias_constant_factor" type="float" setter="set_depth_bias_constant_factor" getter="get_depth_bias_constant_factor" default="0.0"> </member> - <member name="depth_bias_enable" type="bool" setter="set_depth_bias_enable" getter="get_depth_bias_enable" default="false"> + <member name="depth_bias_enabled" type="bool" setter="set_depth_bias_enabled" getter="get_depth_bias_enabled" default="false"> </member> <member name="depth_bias_slope_factor" type="float" setter="set_depth_bias_slope_factor" getter="get_depth_bias_slope_factor" default="0.0"> </member> diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml index b8a290381f..a6254788ce 100644 --- a/doc/classes/RandomNumberGenerator.xml +++ b/doc/classes/RandomNumberGenerator.xml @@ -10,10 +10,9 @@ [codeblock] var rng = RandomNumberGenerator.new() func _ready(): - rng.randomize() var my_random_number = rng.randf_range(-10.0, 10.0) [/codeblock] - [b]Note:[/b] The default values of [member seed] and [member state] properties are pseudo-random, and changes when calling [method randomize]. The [code]0[/code] value documented here is a placeholder, and not the actual default seed. + [b]Note:[/b] The default values of [member seed] and [member state] properties are pseudo-random, and change when calling [method randomize]. The [code]0[/code] value documented here is a placeholder, and not the actual default seed. </description> <tutorials> <link title="Random number generation">$DOCS_URL/tutorials/math/random_number_generation.html</link> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index ac012e9604..28fe42afae 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -165,6 +165,12 @@ Returns [code]true[/code] if this [Rect2] and [param rect] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this [Rect2] is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="merge" qualifiers="const"> <return type="Rect2" /> <param index="0" name="b" type="Rect2" /> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index eb85a4adb4..51c2498ea7 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -1581,6 +1581,10 @@ </constant> <constant name="LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z" value="34" enum="Limit"> </constant> + <constant name="LIMIT_MAX_VIEWPORT_DIMENSIONS_X" value="35" enum="Limit"> + </constant> + <constant name="LIMIT_MAX_VIEWPORT_DIMENSIONS_Y" value="36" enum="Limit"> + </constant> <constant name="MEMORY_TEXTURES" value="0" enum="MemoryType"> </constant> <constant name="MEMORY_BUFFERS" value="1" enum="MemoryType"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 6aa9237385..35fe7bdbd2 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -13,6 +13,7 @@ Similarly, in 2D, a canvas is needed to draw all canvas items. In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using [method instance_set_base]. The instance must also be attached to the scenario using [method instance_set_scenario] in order to be visible. In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. + [b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] disables all rendering and window management functions. Most functions from [RenderingServer] will return dummy values in this case. </description> <tutorials> <link title="Optimization using Servers">$DOCS_URL/tutorials/performance/using_servers.html</link> @@ -4576,9 +4577,11 @@ </constant> <constant name="CANVAS_GROUP_MODE_DISABLED" value="0" enum="CanvasGroupMode"> </constant> - <constant name="CANVAS_GROUP_MODE_OPAQUE" value="1" enum="CanvasGroupMode"> + <constant name="CANVAS_GROUP_MODE_CLIP_ONLY" value="1" enum="CanvasGroupMode"> </constant> - <constant name="CANVAS_GROUP_MODE_TRANSPARENT" value="2" enum="CanvasGroupMode"> + <constant name="CANVAS_GROUP_MODE_CLIP_AND_DRAW" value="2" enum="CanvasGroupMode"> + </constant> + <constant name="CANVAS_GROUP_MODE_TRANSPARENT" value="3" enum="CanvasGroupMode"> </constant> <constant name="CANVAS_LIGHT_MODE_POINT" value="0" enum="CanvasLightMode"> </constant> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 3adf10da2d..b2b8a37e39 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -4,7 +4,8 @@ Base class for all resources. </brief_description> <description> - Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instantiated from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource. + Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. Once loaded from disk, further attempts to load a resource by [member resource_path] returns the same reference. [PackedScene], one of the most common [Object]s in a Godot project, is also a resource, uniquely capable of storing and instantiating the [Node]s it contains as many times as desired. + In GDScript, resources can loaded from disk by their [member resource_path] using [method @GDScript.load] or [method @GDScript.preload]. [b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. </description> <tutorials> @@ -15,77 +16,94 @@ <method name="_get_rid" qualifiers="virtual"> <return type="RID" /> <description> + Override this method to return a custom [RID] when [method get_rid] is called. </description> </method> <method name="duplicate" qualifiers="const"> <return type="Resource" /> <param index="0" name="subresources" type="bool" default="false" /> <description> - Duplicates the resource, returning a new resource with the exported members copied. [b]Note:[/b] To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values. - By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [param subresources] argument which will copy the subresources. - [b]Note:[/b] If [param subresources] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. - [b]Note:[/b] When duplicating a resource, only [code]export[/code]ed properties are copied. Other properties will be set to their default value in the new resource. + Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original. + If [param subresources] is [code]false[/code], a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overriden by the [constant PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE] flag. + [b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters. </description> </method> <method name="emit_changed"> <return type="void" /> <description> - Emits the [signal changed] signal. - If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties). - The method is equivalent to: + Emits the [signal changed] signal. This method is called automatically for built-in resources. + [b]Note:[/b] For custom resources, it's recommended to call this method whenever a meaningful change occurs, such as a modified property. This ensures that custom [Object]s depending on the resource are properly updated. [codeblock] - emit_signal("changed") + var damage: + set(new_value): + if damage != new_value: + damage = new_value + emit_changed() [/codeblock] - [b]Note:[/b] This method is called automatically for built-in resources. </description> </method> <method name="get_local_scene" qualifiers="const"> <return type="Node" /> <description> - If [member resource_local_to_scene] is enabled and the resource was loaded from a [PackedScene] instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns [code]null[/code]. + If [member resource_local_to_scene] is set to [code]true[/code] and the resource has been loaded from a [PackedScene] instantiation, returns the root [Node] of the scene where this resource is used. Otherwise, returns [code]null[/code]. </description> </method> <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> - Returns the RID of the resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. + Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialised server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID]. </description> </method> <method name="setup_local_to_scene"> <return type="void" /> <description> - This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by connecting [signal setup_local_to_scene_requested] from script. - For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport. + Emits the [signal setup_local_to_scene_requested] signal. If [member resource_local_to_scene] is set to [code]true[/code], this method is called from [method PackedScene.instantiate] by the newly duplicated resource within the scene instance. + For most resources, this method performs no logic of its own. Custom behavior can be defined by connecting [signal setup_local_to_scene_requested] from a script, [b]not[/b] by overriding this method. + [b]Example:[/b] Assign a random value to [code]health[/code] for every duplicated Resource from an instantiated scene, excluding the original. + [codeblock] + extends Resource + + var health = 0 + + func _init(): + setup_local_to_scene_requested.connect(randomize_health) + + func randomize_health(): + health = randi_range(10, 40) + [/codeblock] </description> </method> <method name="take_over_path"> <return type="void" /> <param index="0" name="path" type="String" /> <description> - Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting [member resource_path], as the latter would error out if another resource was already cached for the given path. + Sets the [member resource_path] to [param path], potentially overriding an existing cache entry for this path. Further attempts to load an overridden resource by path will instead return this resource. </description> </method> </methods> <members> <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" default="false"> - If [code]true[/code], the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene. + If [code]true[/code], the resource is duplicated for each instance of all scenes using it. At run-time, the resource can be modified in one scene without affecting other instances (see [method PackedScene.instantiate]). + [b]Note:[/b] Changing this property at run-time has no effect on already created duplicate resources. </member> <member name="resource_name" type="String" setter="set_name" getter="get_name" default=""""> - The name of the resource. This is an optional identifier. If [member resource_name] is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the [member resource_name] will be displayed as the tab name in the script editor. + An optional name for this resource. When defined, its value is displayed to represent the resource in the Inspector dock. For built-in scripts, the name is displayed as part of the tab name in the script editor. </member> <member name="resource_path" type="String" setter="set_path" getter="get_path" default=""""> - The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index. + The unique path to this resource. If it has been saved to disk, the value will be its filepath. If the resource is exclusively contained within a scene, the value will be the [PackedScene]'s filepath, followed by an unique identifier. + [b]Note:[/b] Setting this property manually may fail if a resource with the same path has already been previously loaded. If necessary, use [method take_over_path]. </member> </members> <signals> <signal name="changed"> <description> - Emitted whenever the resource changes. - [b]Note:[/b] This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. + Emitted when the resource changes, usually when one of its properties is modified. See also [method emit_changed]. + [b]Note:[/b] This signal is not emitted automatically for properties of custom resources. If necessary, a setter needs to be created to emit the signal. </description> </signal> <signal name="setup_local_to_scene_requested"> <description> + Emitted when [method setup_local_to_scene] is called, usually by a newly duplicated resource with [member resource_local_to_scene] set to [code]true[/code]. Custom behavior can be defined by connecting this signal. </description> </signal> </signals> diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index 9b8c8d4d9d..2b6376f2cd 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -71,6 +71,15 @@ The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. </description> </method> + <method name="_recognize_path" qualifiers="virtual const"> + <return type="bool" /> + <param index="0" name="path" type="String" /> + <param index="1" name="type" type="StringName" /> + <description> + Tells whether or not this loader should load a resource from its resource path for a given type. + If it is not implemented, the default behavior returns whether the path's extension is within the ones provided by [method _get_recognized_extensions], and if the type is within the ones provided by [method _get_resource_type]. + </description> + </method> <method name="_rename_dependencies" qualifiers="virtual const"> <return type="int" /> <param index="0" name="path" type="String" /> diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml index 05bfcf3446..1f2af6d157 100644 --- a/doc/classes/ResourceFormatSaver.xml +++ b/doc/classes/ResourceFormatSaver.xml @@ -24,6 +24,15 @@ Returns whether the given resource object can be saved by this saver. </description> </method> + <method name="_recognize_path" qualifiers="virtual const"> + <return type="bool" /> + <param index="0" name="resource" type="Resource" /> + <param index="1" name="path" type="String" /> + <description> + Returns [code]true[/code] if this saver handles a given save path and [code]false[/code] otherwise. + If this method is not implemented, the default behavior returns whether the path's extension is within the ones provided by [method _get_recognized_extensions]. + </description> + </method> <method name="_save" qualifiers="virtual"> <return type="int" /> <param index="0" name="resource" type="Resource" /> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index f4cbf4c442..cb2481f705 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -23,9 +23,11 @@ <param index="2" name="height" type="int" default="0" /> <param index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" /> <param index="4" name="inline_align" type="int" enum="InlineAlignment" default="5" /> + <param index="5" name="region" type="Rect2" default="Rect2(0, 0, 0, 0)" /> <description> - Adds an image's opening and closing tags to the tag stack, optionally providing a [param width] and [param height] to resize the image and a [param color] to tint the image. + Adds an image's opening and closing tags to the tag stack, optionally providing a [param width] and [param height] to resize the image, a [param color] to tint the image and a [param region] to only use parts of the image. If [param width] or [param height] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. + If [param width] and [param height] are not set, but [param region] is, the region's rect will be used. </description> </method> <method name="add_text"> @@ -477,9 +479,6 @@ <member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined" default="true"> If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code]. </member> - <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color" default="false"> - If [code]true[/code], the label uses the custom font color. - </member> <member name="progress_bar_delay" type="int" setter="set_progress_bar_delay" getter="get_progress_bar_delay" default="1000"> The delay after which the loading progress bar is displayed, in milliseconds. Set to [code]-1[/code] to disable progress bar entirely. [b]Note:[/b] Progress bar is displayed only if [member threaded] is enabled. @@ -627,8 +626,8 @@ <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The default tint of text outline. </theme_item> - <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> - The color of selected text, used when [member selection_enabled] is [code]true[/code]. + <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + The color of selected text, used when [member selection_enabled] is [code]true[/code]. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored. </theme_item> <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> The color of the font's shadow. @@ -666,6 +665,12 @@ <theme_item name="table_v_separation" data_type="constant" type="int" default="3"> The vertical separation of elements in a table. </theme_item> + <theme_item name="text_highlight_h_padding" data_type="constant" type="int" default="3"> + The horizontal padding around a highlighting and background color box. + </theme_item> + <theme_item name="text_highlight_v_padding" data_type="constant" type="int" default="3"> + The vertical padding around a highlighting and background color box. + </theme_item> <theme_item name="bold_font" data_type="font" type="Font"> The font used for bold text. </theme_item> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 40ec8ed429..b4b14c01c6 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -4,7 +4,7 @@ A class stored as a resource. </brief_description> <description> - A class stored as a resource. A script extends the functionality of all objects that instance it. + A class stored as a resource. A script extends the functionality of all objects that instantiate it. This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error. The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 34ca228795..7be0ba64d6 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -66,6 +66,12 @@ Draws a solid shape onto a [CanvasItem] with the [RenderingServer] API filled with the specified [param color]. The exact drawing method is specific for each shape and cannot be configured. </description> </method> + <method name="get_rect" qualifiers="const"> + <return type="Rect2" /> + <description> + Returns a [Rect2] representing the shapes boundary. + </description> + </method> </methods> <members> <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> diff --git a/doc/classes/SkeletonProfile.xml b/doc/classes/SkeletonProfile.xml index 55d21f3224..57bdd52d9e 100644 --- a/doc/classes/SkeletonProfile.xml +++ b/doc/classes/SkeletonProfile.xml @@ -7,6 +7,7 @@ This resource is used in [EditorScenePostImport]. Some parameters are referring to bones in [Skeleton3D], [Skin], [Animation], and some other nodes are rewritten based on the parameters of [SkeletonProfile]. </description> <tutorials> + <link title="Retargeting 3D Skeletons">$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html</link> </tutorials> <methods> <method name="find_bone" qualifiers="const"> diff --git a/doc/classes/SkeletonProfileHumanoid.xml b/doc/classes/SkeletonProfileHumanoid.xml index 11f0521718..0dbd66d8d6 100644 --- a/doc/classes/SkeletonProfileHumanoid.xml +++ b/doc/classes/SkeletonProfileHumanoid.xml @@ -6,6 +6,7 @@ A [SkeletonProfile] as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. </description> <tutorials> + <link title="Retargeting 3D Skeletons">$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html</link> </tutorials> <members> <member name="bone_size" type="int" setter="set_bone_size" getter="get_bone_size" overrides="SkeletonProfile" default="56" /> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 8df039794a..93799b58f0 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -56,6 +56,9 @@ <member name="prefix" type="String" setter="set_prefix" getter="get_prefix" default=""""> Adds the specified [code]prefix[/code] string before the numerical value of the [SpinBox]. </member> + <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="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/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index 62cb55daec..28e2ef0d95 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -14,6 +14,7 @@ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" overrides="Light3D" default="0.03" /> <member name="spot_angle" type="float" setter="set_param" getter="get_param" default="45.0"> The spotlight's angle in degrees. + [b]Note:[/b] [member spot_angle] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). </member> <member name="spot_angle_attenuation" type="float" setter="set_param" getter="get_param" default="1.0"> The spotlight's angular attenuation curve. @@ -23,6 +24,7 @@ </member> <member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0"> The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [member spot_attenuation] in use. No matter the [member spot_attenuation] in use, the light will never reach anything outside this range. + [b]Note:[/b] [member spot_range] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). </member> </members> </class> diff --git a/doc/classes/StandardMaterial3D.xml b/doc/classes/StandardMaterial3D.xml index bd6e5cdfa2..0f6a3168eb 100644 --- a/doc/classes/StandardMaterial3D.xml +++ b/doc/classes/StandardMaterial3D.xml @@ -4,7 +4,7 @@ Physically based rendering (PBR) material that can be applied to 3D objects. </brief_description> <description> - StandardMaterial3D's properties are inherited from [BaseMaterial3D]. + [StandardMaterial3D]'s properties are inherited from [BaseMaterial3D]. [StandardMaterial3D] uses separate textures for ambient occlusion, roughness and metallic maps. To use a single ORM map for all 3 textures, use an [ORMMaterial3D] instead. </description> <tutorials> <link title="Standard Material 3D and ORM Material 3D">$DOCS_URL/tutorials/3d/standard_material_3d.html</link> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 316bb923b7..320b9fd737 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -364,7 +364,7 @@ <return type="bool" /> <param index="0" name="with_prefix" type="bool" default="false" /> <description> - Returns [code]true[/code] if this string contains a valid hexadecimal number. If [param with_prefix] is [code]true[/code], then a validity of the hexadecimal number is determined by [code]0x[/code] prefix, for instance: [code]0xDEADC0DE[/code]. + Returns [code]true[/code] if this string contains a valid hexadecimal number. If [param with_prefix] is [code]true[/code], then a validity of the hexadecimal number is determined by the [code]0x[/code] prefix, for example: [code]0xDEADC0DE[/code]. </description> </method> <method name="is_valid_html_color" qualifiers="const"> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index ccec691107..d56cc9a31b 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -133,6 +133,7 @@ <description> Generates normals from vertices so you do not have to do it manually. If [param flip] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents]. [b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES]. + [b]Note:[/b] [method generate_normals] takes smooth groups into account. If you don't specify any smooth group for each vertex, [method generate_normals] will smooth normals for you. </description> </method> <method name="generate_tangents"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 2f9b971fc8..d4f5233438 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -63,6 +63,13 @@ Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid. </description> </method> + <method name="add_caret_at_carets"> + <return type="void" /> + <param index="0" name="below" type="bool" /> + <description> + Adds an additional caret above or below every caret. If [param below] is true the new caret will be added below and above otherwise. + </description> + </method> <method name="add_gutter"> <return type="void" /> <param index="0" name="at" type="int" default="-1" /> @@ -70,6 +77,12 @@ Register a new gutter to this [TextEdit]. Use [param at] to have a specific gutter order. A value of [code]-1[/code] appends the gutter to the right. </description> </method> + <method name="add_selection_for_next_occurrence"> + <return type="void" /> + <description> + Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret. + </description> + </method> <method name="adjust_carets_after_edit"> <return type="void" /> <param index="0" name="caret" type="int" /> @@ -240,6 +253,12 @@ Returns the width of the gutter at the given index. </description> </method> + <method name="get_h_scroll_bar" qualifiers="const"> + <return type="HScrollBar" /> + <description> + Returns the [HScrollBar] used by [TextEdit]. + </description> + </method> <method name="get_indent_level" qualifiers="const"> <return type="int" /> <param index="0" name="line" type="int" /> @@ -509,6 +528,12 @@ Returns the number of lines that may be drawn. </description> </method> + <method name="get_v_scroll_bar" qualifiers="const"> + <return type="VScrollBar" /> + <description> + Returns the [VScrollBar] of the [TextEdit]. + </description> + </method> <method name="get_version" qualifiers="const"> <return type="int" /> <description> @@ -1085,9 +1110,6 @@ The width, in pixels, of the minimap. </member> <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" overrides="Control" enum="Control.CursorShape" default="1" /> - <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color" default="false"> - If [code]true[/code], custom [code]font_selected_color[/code] will be used for selected text. - </member> <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default=""""> Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]). </member> @@ -1351,8 +1373,8 @@ <theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Sets the font [Color] when [member editable] is disabled. </theme_item> - <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. + <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + Sets the [Color] of the selected text. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored. </theme_item> <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> [Color] of the border around text that matches the search query. diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index 471c1a9040..d1dfdecbd2 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -144,6 +144,7 @@ </methods> <members> <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> + Sets text alignment within the line as if the line was horizontal. </member> <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 2512c563c5..0b822a4fe9 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -413,7 +413,7 @@ <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + Returns array containing glyph packing data. </description> </method> <method name="font_get_transform" qualifiers="const"> @@ -824,7 +824,7 @@ <param index="2" name="texture_index" type="int" /> <param index="3" name="offset" type="PackedInt32Array" /> <description> - Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + Sets array containing glyph packing data. </description> </method> <method name="font_set_transform"> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index 14e89a1b74..3dd8c339b2 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -33,7 +33,7 @@ </method> <method name="_draw_rect_region" qualifiers="virtual const"> <return type="void" /> - <param index="0" name="tp_canvas_item" type="RID" /> + <param index="0" name="to_canvas_item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="src_rect" type="Rect2" /> <param index="3" name="modulate" type="Color" /> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 348184a16a..01246f0c2e 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -365,7 +365,7 @@ Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings. </member> <member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0"> - Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings. + Show or hide the TileMap's navigation meshes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings. </member> <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> The assigned [TileSet]. diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 905b3d77af..23d20a5a75 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -123,6 +123,12 @@ Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this transform is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="looking_at" qualifiers="const"> <return type="Transform2D" /> <param index="0" name="target" type="Vector2" default="Vector2(0, 0)" /> diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 18b4f9e6f9..b3145ea022 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -82,6 +82,12 @@ Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this transform is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="looking_at" qualifiers="const"> <return type="Transform3D" /> <param index="0" name="target" type="Vector3" /> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index c109dc57f7..a8ffef427f 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -425,6 +425,15 @@ Sets the given column's button [Texture2D] at index [param button_idx] to [param button]. </description> </method> + <method name="set_button_color"> + <return type="void" /> + <param index="0" name="column" type="int" /> + <param index="1" name="button_idx" type="int" /> + <param index="2" name="color" type="Color" /> + <description> + Sets the given column's button color at index [param button_idx] to [param color]. + </description> + </method> <method name="set_button_disabled"> <return type="void" /> <param index="0" name="column" type="int" /> diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index b30349e538..488154106f 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -33,6 +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. </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 e1852340c0..5590f82336 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -206,6 +206,12 @@ Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this vector is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="is_normalized" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 1ef84050cd..1a2cdfe10e 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -174,10 +174,16 @@ Returns [code]true[/code] if this vector and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this vector is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="is_normalized" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise. + Returns [code]true[/code] if the vector is [method normalized], [code]false[/code] otherwise. </description> </method> <method name="is_zero_approx" qualifiers="const"> @@ -238,18 +244,22 @@ <method name="normalized" qualifiers="const"> <return type="Vector3" /> <description> - Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. + Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. </description> </method> <method name="octahedron_decode" qualifiers="static"> <return type="Vector3" /> <param index="0" name="uv" type="Vector2" /> <description> + Returns the [Vector3] from an octahedral-compressed form created using [method octahedron_encode] (stored as a [Vector2]). </description> </method> <method name="octahedron_encode" qualifiers="const"> <return type="Vector2" /> <description> + Returns the octahedral-encoded (oct32) form of this [Vector3] as a [Vector2]. Since a [Vector2] occupies 1/3 less memory compared to [Vector3], this form of compression can be used to pass greater amounts of [method normalized] [Vector3]s without increasing storage or memory requirements. See also [method octahedron_decode]. + [b]Note:[/b] [method octahedron_encode] can only be used for [method normalized] vectors. [method octahedron_encode] does [i]not[/i] check whether this [Vector3] is normalized, and will return a value that does not decompress to the original value if the [Vector3] is not normalized. + [b]Note:[/b] Octahedral compression is [i]lossy[/i], although visual differences are rarely perceptible in real world scenarios. </description> </method> <method name="outer" qualifiers="const"> diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index fdc93f82ec..662d0bce3a 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -135,6 +135,12 @@ Returns [code]true[/code] if this vector and [param with] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> + <method name="is_finite" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this vector is finite, by calling [method @GlobalScope.is_finite] on each component. + </description> + </method> <method name="is_normalized" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml index 3eea93ce1f..e9ac5b9475 100644 --- a/doc/classes/Vector4i.xml +++ b/doc/classes/Vector4i.xml @@ -133,12 +133,20 @@ <return type="Vector4i" /> <param index="0" name="right" type="Vector4i" /> <description> + Gets the remainder of each component of the [Vector4i] with the components of the given [Vector4i]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. + [codeblock] + print(Vector4i(10, -20, 30, -40) % Vector4i(7, 8, 9, 10)) # Prints "(3, -4, 3, 0)" + [/codeblock] </description> </operator> <operator name="operator %"> <return type="Vector4i" /> <param index="0" name="right" type="int" /> <description> + Gets the remainder of each component of the [Vector4i] with the the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. + [codeblock] + print(Vector4i(10, -20, 30, -40) % 7) # Prints "(3, -6, 2, -5)" + [/codeblock] </description> </operator> <operator name="operator *"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 998e782975..5706d098e8 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -71,6 +71,12 @@ <description> </description> </method> + <method name="get_screen_transform" qualifiers="const"> + <return type="Transform2D" /> + <description> + Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window. + </description> + </method> <method name="get_texture" qualifiers="const"> <return type="ViewportTexture" /> <description> @@ -300,6 +306,8 @@ If [code]true[/code], the viewport should render its background as transparent. </member> <member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false"> + If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding]. + In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. </member> <member name="use_occlusion_culling" type="bool" setter="set_use_occlusion_culling" getter="is_using_occlusion_culling" default="false"> If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D for this viewport. For the root viewport, [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] must be set to [code]true[/code] instead. diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index 87de664aad..6bd64a50bb 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -6,6 +6,7 @@ <description> Displays the content of a [Viewport] node as a dynamic [Texture2D]. This can be used to mix controls, 2D, and 3D elements in the same scene. To create a ViewportTexture in code, use the [method Viewport.get_texture] method on the target viewport. + [b]Note:[/b] When local to scene, this texture uses [method Resource.setup_local_to_scene] to set the proxy texture and flags in the local viewport. </description> <tutorials> <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link> diff --git a/doc/classes/VisibleOnScreenEnabler2D.xml b/doc/classes/VisibleOnScreenEnabler2D.xml index 50d0c00017..8590e9cc9f 100644 --- a/doc/classes/VisibleOnScreenEnabler2D.xml +++ b/doc/classes/VisibleOnScreenEnabler2D.xml @@ -1,23 +1,30 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisibleOnScreenEnabler2D" inherits="VisibleOnScreenNotifier2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Automatically disables another node if not visible on screen. </brief_description> <description> + VisibleOnScreenEnabler2D detects when it is visible on screen (just like [VisibleOnScreenNotifier2D]) and automatically enables or disables the target node. The target node is disabled when [VisibleOnScreenEnabler2D] is not visible on screen (including when [member CanvasItem.visible] is [code]false[/code]), and enabled when the enabler is visible. The disabling is achieved by changing [member Node.process_mode]. </description> <tutorials> </tutorials> <members> <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler2D.EnableMode" default="0"> + Determines how the node is enabled. Corresponds to [enum Node.ProcessMode]. Disabled node uses [constant Node.PROCESS_MODE_DISABLED]. </member> <member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath("..")"> + The path to the target node, relative to the [VisibleOnScreenEnabler2D]. The target node is cached; it's only assigned when setting this property (if the [VisibleOnScreenEnabler2D] is inside scene tree) and every time the [VisibleOnScreenEnabler2D] enters the scene tree. If the path is invalid, nothing will happen. </member> </members> <constants> <constant name="ENABLE_MODE_INHERIT" value="0" enum="EnableMode"> + Corresponds to [constant Node.PROCESS_MODE_INHERIT]. </constant> <constant name="ENABLE_MODE_ALWAYS" value="1" enum="EnableMode"> + Corresponds to [constant Node.PROCESS_MODE_ALWAYS]. </constant> <constant name="ENABLE_MODE_WHEN_PAUSED" value="2" enum="EnableMode"> + Corresponds to [constant Node.PROCESS_MODE_WHEN_PAUSED. </constant> </constants> </class> diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index 9574686506..94e8c25660 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -17,7 +17,7 @@ <method name="get_aabb" qualifiers="const"> <return type="AABB" /> <description> - Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. See also [method get_transformed_aabb]. + Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. </description> </method> <method name="get_base" qualifiers="const"> @@ -39,13 +39,6 @@ Returns whether or not the specified layer of the [member layers] is enabled, given a [code]layer_number[/code] between 1 and 20. </description> </method> - <method name="get_transformed_aabb" qualifiers="const"> - <return type="AABB" /> - <description> - Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance3D]. - Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Node3D]'s [Transform3D]. See also [method get_aabb]. - </description> - </method> <method name="set_base"> <return type="void" /> <param index="0" name="base" type="RID" /> diff --git a/doc/classes/VisualShaderNodeFloatParameter.xml b/doc/classes/VisualShaderNodeFloatParameter.xml index c0fd88294a..3b5bf57b4d 100644 --- a/doc/classes/VisualShaderNodeFloatParameter.xml +++ b/doc/classes/VisualShaderNodeFloatParameter.xml @@ -16,7 +16,7 @@ Enables usage of the [member default_value]. </member> <member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeFloatParameter.Hint" default="0"> - A hint applied to the uniform, which controls the values it can take when set through the inspector. + A hint applied to the uniform, which controls the values it can take when set through the Inspector. </member> <member name="max" type="float" setter="set_max" getter="get_max" default="1.0"> Minimum value for range hints. Used if [member hint] is set to [constant HINT_RANGE] or [constant HINT_RANGE_STEP]. diff --git a/doc/classes/VisualShaderNodeParameter.xml b/doc/classes/VisualShaderNodeParameter.xml index c66022f77d..55b10ac810 100644 --- a/doc/classes/VisualShaderNodeParameter.xml +++ b/doc/classes/VisualShaderNodeParameter.xml @@ -4,7 +4,7 @@ A base type for the parameters within the visual shader graph. </brief_description> <description> - A parameter represents a variable in the shader which is set externally, i.e. from the [ShaderMaterial]. Parameters are exposed as properties in the [ShaderMaterial] and can be assigned from the inspector or from a script. + A parameter represents a variable in the shader which is set externally, i.e. from the [ShaderMaterial]. Parameters are exposed as properties in the [ShaderMaterial] and can be assigned from the Inspector or from a script. </description> <tutorials> </tutorials> diff --git a/doc/classes/VoxelGIData.xml b/doc/classes/VoxelGIData.xml index 92b2e66e5a..bd9df18394 100644 --- a/doc/classes/VoxelGIData.xml +++ b/doc/classes/VoxelGIData.xml @@ -5,7 +5,7 @@ </brief_description> <description> [VoxelGIData] contains baked voxel global illumination for use in a [VoxelGI] node. [VoxelGIData] also offers several properties to adjust the final appearance of the global illumination. These properties can be adjusted at run-time without having to bake the [VoxelGI] node again. - [b]Note:[/b] To prevent text-based scene files ([code].tscn[/code]) from growing too much and becoming slow to load and save, always save [VoxelGIData] to an external binary resource file ([code].res[/code]) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the [VoxelGIData] resource, choosing [b]Edit[/b], clicking the floppy disk icon at the top of the inspector then choosing [b]Save As...[/b]. + [b]Note:[/b] To prevent text-based scene files ([code].tscn[/code]) from growing too much and becoming slow to load and save, always save [VoxelGIData] to an external binary resource file ([code].res[/code]) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the [VoxelGIData] resource, choosing [b]Edit[/b], clicking the floppy disk icon at the top of the Inspector then choosing [b]Save As...[/b]. </description> <tutorials> <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index c278f7031f..8707ef003a 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -491,7 +491,7 @@ Minimized window mode, i.e. [Window] is not visible and available on window manager's window list. Normally happens when the minimize button is pressed. </constant> <constant name="MODE_MAXIMIZED" value="2" enum="Mode"> - Maximized window mode, i.e. [Window] will occupy whole screen area except task bar and still display its borders. Normally happens when the minimize button is pressed. + Maximized window mode, i.e. [Window] will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed. </constant> <constant name="MODE_FULLSCREEN" value="3" enum="Mode"> Full screen window mode. Note that this is not [i]exclusive[/i] full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. diff --git a/doc/classes/XROrigin3D.xml b/doc/classes/XROrigin3D.xml index 7acee097e7..506d0fce41 100644 --- a/doc/classes/XROrigin3D.xml +++ b/doc/classes/XROrigin3D.xml @@ -13,6 +13,9 @@ <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <members> + <member name="current" type="bool" setter="set_current" getter="is_current" default="false"> + Is this XROrigin3D node the current origin used by the [XRServer]? + </member> <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0"> Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. [b]Note:[/b] This method is a passthrough to the [XRServer] itself. diff --git a/doc/classes/XRPose.xml b/doc/classes/XRPose.xml index 0e58fab9b3..31a484ea40 100644 --- a/doc/classes/XRPose.xml +++ b/doc/classes/XRPose.xml @@ -30,7 +30,7 @@ <member name="name" type="StringName" setter="set_name" getter="get_name" default="&"""> The name of this pose. Pose names are often driven by an action map setup by the user. Godot does suggest a number of pose names that it expects [XRInterface]s to implement: - [code]root[/code] defines a root location, often used for tracked objects that do not have further nodes. - - [code]aim[/code] defines the tip of a controller with the orientation pointing outwards, for instance: add your raycasts to this. + - [code]aim[/code] defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this. - [code]grip[/code] defines the location where the user grips the controller - [code]skeleton[/code] defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime. </member> @@ -46,7 +46,7 @@ No tracking information is available for this pose. </constant> <constant name="XR_TRACKING_CONFIDENCE_LOW" value="1" enum="TrackingConfidence"> - Tracking information may be inaccurate or estimated. For instance with inside out tracking this would indicate a controller may be (partially) obscured. + Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured. </constant> <constant name="XR_TRACKING_CONFIDENCE_HIGH" value="2" enum="TrackingConfidence"> Tracking information is deemed accurate and up to date. diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index 48b00323d3..d940ea41ac 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -30,18 +30,18 @@ <param index="1" name="keep_height" type="bool" /> <description> This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. - For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. + For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. - You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. + You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. </description> </method> <method name="find_interface" qualifiers="const"> <return type="XRInterface" /> <param index="0" name="name" type="String" /> <description> - Finds an interface by its [param name]. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. + Finds an interface by its [param name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. </description> </method> <method name="get_hmd_transform"> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 9d685b9cd0..e3938fb5d5 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -114,12 +114,17 @@ <return type="Vector4" /> <param index="0" name="right" type="Vector4" /> <description> + Multiplies each component of the [Vector4] by the given [float]. </description> </operator> <operator name="operator *"> <return type="Vector4" /> <param index="0" name="right" type="Vector4i" /> <description> + Multiplies each component of the [Vector4i] by the given [float]. Returns a [Vector4]. + [codeblock] + print(0.9 * Vector4i(10, 15, 20, -10)) # Prints "(9, 13.5, 18, -9)" + [/codeblock] </description> </operator> <operator name="operator *"> @@ -140,12 +145,20 @@ <return type="float" /> <param index="0" name="right" type="float" /> <description> + Raises a [float] to a power of a [float]. + [codeblock] + print(39.0625**0.25) # 2.5 + [/codeblock] </description> </operator> <operator name="operator **"> <return type="float" /> <param index="0" name="right" type="int" /> <description> + Raises a [float] to a power of an [int]. The result is a [float]. + [codeblock] + print(0.9**3) # 0.729 + [/codeblock] </description> </operator> <operator name="operator +"> @@ -194,7 +207,7 @@ <return type="bool" /> <param index="0" name="right" type="float" /> <description> - Returns [code]true[/code] the left float is less than the right one. + Returns [code]true[/code] if the left float is less than the right one. </description> </operator> <operator name="operator <"> @@ -208,7 +221,7 @@ <return type="bool" /> <param index="0" name="right" type="float" /> <description> - Returns [code]true[/code] the left integer is less than or equal to the right one. + Returns [code]true[/code] if the left float is less than or equal to the right one. </description> </operator> <operator name="operator <="> @@ -237,7 +250,7 @@ <return type="bool" /> <param index="0" name="right" type="float" /> <description> - Returns [code]true[/code] the left float is greater than the right one. + Returns [code]true[/code] if the left float is greater than the right one. </description> </operator> <operator name="operator >"> @@ -251,7 +264,7 @@ <return type="bool" /> <param index="0" name="right" type="float" /> <description> - Returns [code]true[/code] the left float is greater than or equal to the right one. + Returns [code]true[/code] if the left float is greater than or equal to the right one. </description> </operator> <operator name="operator >="> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 78e2e7d18f..689cb7fe8e 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -72,14 +72,14 @@ <return type="bool" /> <param index="0" name="right" type="float" /> <description> - Returns [code]true[/code] if operands are different from each other. + Returns [code]true[/code] if this [int] is not equivalent to the given [float]. </description> </operator> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="int" /> <description> - Returns [code]true[/code] if operands are different from each other. + Returns [code]true[/code] if the integers are not equal. </description> </operator> <operator name="operator %"> @@ -161,12 +161,14 @@ <return type="Vector4" /> <param index="0" name="right" type="Vector4" /> <description> + Multiplies each component of the [Vector4] by the given [int]. </description> </operator> <operator name="operator *"> <return type="Vector4i" /> <param index="0" name="right" type="Vector4i" /> <description> + Multiplies each component of the [Vector4i] by the given [int]. </description> </operator> <operator name="operator *"> @@ -187,12 +189,20 @@ <return type="float" /> <param index="0" name="right" type="float" /> <description> + Raises an [int] to a power of a [float]. The result is a [float]. + [codeblock] + print(8**0.25) # 1.68179283050743 + [/codeblock] </description> </operator> <operator name="operator **"> <return type="int" /> <param index="0" name="right" type="int" /> <description> + Raises an [int] to a power of a [int]. + [codeblock] + print(5**5) # 3125 + [/codeblock] </description> </operator> <operator name="operator +"> @@ -262,7 +272,7 @@ <return type="bool" /> <param index="0" name="right" type="int" /> <description> - Returns [code]true[/code] the left integer is less than the right one. + Returns [code]true[/code] if the left integer is less than the right one. </description> </operator> <operator name="operator <<"> @@ -287,7 +297,7 @@ <return type="bool" /> <param index="0" name="right" type="int" /> <description> - Returns [code]true[/code] the left integer is less than or equal to the right one. + Returns [code]true[/code] if the left integer is less than or equal to the right one. </description> </operator> <operator name="operator =="> @@ -315,7 +325,7 @@ <return type="bool" /> <param index="0" name="right" type="int" /> <description> - Returns [code]true[/code] the left integer is greater than the right one. + Returns [code]true[/code] if the left integer is greater than the right one. </description> </operator> <operator name="operator >="> @@ -329,7 +339,7 @@ <return type="bool" /> <param index="0" name="right" type="int" /> <description> - Returns [code]true[/code] the left integer is greater than or equal to the right one. + Returns [code]true[/code] if the left integer is greater than or equal to the right one. </description> </operator> <operator name="operator >>"> |