Returns the absolute value of a [Variant] parameter [code]x[/code] (i.e. non-negative value). Variant types [int], [float] (real), [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported.
[codeblock]
@ -40,7 +40,7 @@
</method>
<methodname="absf">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the absolute value of float parameter [code]x[/code] (i.e. positive value).
[codeblock]
@ -51,7 +51,7 @@
</method>
<methodname="absi">
<returntype="int"/>
<argumentindex="0"name="x"type="int"/>
<paramindex="0"name="x"type="int"/>
<description>
Returns the absolute value of int parameter [code]x[/code] (i.e. positive value).
[codeblock]
@ -62,7 +62,7 @@
</method>
<methodname="acos">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the arc cosine of [code]x[/code] in radians. Use to get the angle of cosine [code]x[/code]. [code]x[/code] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method acos] will return [constant @GDScript.NAN].
[codeblock]
@ -73,7 +73,7 @@
</method>
<methodname="asin">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the arc sine of [code]x[/code] in radians. Use to get the angle of sine [code]x[/code]. [code]x[/code] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method asin] will return [constant @GDScript.NAN].
[codeblock]
@ -84,7 +84,7 @@
</method>
<methodname="atan">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the arc tangent of [code]x[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry.
The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[/code] and [code]x[/code].
@ -96,8 +96,8 @@
</method>
<methodname="atan2">
<returntype="float"/>
<argumentindex="0"name="y"type="float"/>
<argumentindex="1"name="x"type="float"/>
<paramindex="0"name="y"type="float"/>
<paramindex="1"name="x"type="float"/>
<description>
Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
Important note: The Y coordinate comes first, by convention.
@ -108,18 +108,18 @@
</method>
<methodname="bezier_interpolate">
<returntype="float"/>
<argumentindex="0"name="start"type="float"/>
<argumentindex="1"name="control_1"type="float"/>
<argumentindex="2"name="control_2"type="float"/>
<argumentindex="3"name="end"type="float"/>
<argumentindex="4"name="t"type="float"/>
<paramindex="0"name="start"type="float"/>
<paramindex="1"name="control_1"type="float"/>
<paramindex="2"name="control_2"type="float"/>
<paramindex="3"name="end"type="float"/>
<paramindex="4"name="t"type="float"/>
<description>
Returns the point at the given [code]t[/code] on a one-dimnesional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [code]control_1[/code], [code]control_2[/code], and [code]end[/code] points.
Decodes a byte array back to a [Variant] value. Decoding objects is allowed.
[b]Warning:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).
@ -135,7 +135,7 @@
</method>
<methodname="ceil">
<returntype="Variant"/>
<argumentindex="0"name="x"type="Variant"/>
<paramindex="0"name="x"type="Variant"/>
<description>
Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code]. Supported types: [int], [float], [Vector2], [Vector3], [Vector4].
[codeblock]
@ -148,7 +148,7 @@
</method>
<methodname="ceilf">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code].
A type-safe version of [method ceil], specialzied in floats.
@ -156,7 +156,7 @@
</method>
<methodname="ceili">
<returntype="int"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code].
A type-safe version of [method ceil] that returns integer.
@ -164,9 +164,9 @@
</method>
<methodname="clamp">
<returntype="Variant"/>
<argumentindex="0"name="value"type="Variant"/>
<argumentindex="1"name="min"type="Variant"/>
<argumentindex="2"name="max"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<paramindex="1"name="min"type="Variant"/>
<paramindex="2"name="max"type="Variant"/>
<description>
Clamps the [Variant] [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code]. Variant types [int], [float] (real), [Vector2], [Vector2i], [Vector3] and [Vector3i] are supported.
[codeblock]
@ -192,9 +192,9 @@
</method>
<methodname="clampf">
<returntype="float"/>
<argumentindex="0"name="value"type="float"/>
<argumentindex="1"name="min"type="float"/>
<argumentindex="2"name="max"type="float"/>
<paramindex="0"name="value"type="float"/>
<paramindex="1"name="min"type="float"/>
<paramindex="2"name="max"type="float"/>
<description>
Clamps the float [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
[codeblock]
@ -210,9 +210,9 @@
</method>
<methodname="clampi">
<returntype="int"/>
<argumentindex="0"name="value"type="int"/>
<argumentindex="1"name="min"type="int"/>
<argumentindex="2"name="max"type="int"/>
<paramindex="0"name="value"type="int"/>
<paramindex="1"name="min"type="int"/>
<paramindex="2"name="max"type="int"/>
<description>
Clamps the integer [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
[codeblock]
@ -228,7 +228,7 @@
</method>
<methodname="cos">
<returntype="float"/>
<argumentindex="0"name="angle_rad"type="float"/>
<paramindex="0"name="angle_rad"type="float"/>
<description>
Returns the cosine of angle [code]angle_rad[/code] in radians.
[codeblock]
@ -240,7 +240,7 @@
</method>
<methodname="cosh">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the hyperbolic cosine of [code]x[/code] in radians.
[codeblock]
@ -251,25 +251,25 @@
</method>
<methodname="cubic_interpolate">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="pre"type="float"/>
<argumentindex="3"name="post"type="float"/>
<argumentindex="4"name="weight"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="pre"type="float"/>
<paramindex="3"name="post"type="float"/>
<paramindex="4"name="weight"type="float"/>
<description>
Cubic interpolates between two values by the factor defined in [code]weight[/code] with pre and post values.
</description>
</method>
<methodname="db2linear">
<returntype="float"/>
<argumentindex="0"name="db"type="float"/>
<paramindex="0"name="db"type="float"/>
<description>
Converts from decibels to linear energy (audio).
</description>
</method>
<methodname="deg2rad">
<returntype="float"/>
<argumentindex="0"name="deg"type="float"/>
<paramindex="0"name="deg"type="float"/>
<description>
Converts an angle expressed in degrees to radians.
[codeblock]
@ -280,8 +280,8 @@
</method>
<methodname="ease">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<argumentindex="1"name="curve"type="float"/>
<paramindex="0"name="x"type="float"/>
<paramindex="1"name="curve"type="float"/>
<description>
Returns an "eased" value of [code]x[/code] based on an easing function defined with [code]curve[/code]. This easing function is based on an exponent. The [code]curve[/code] can be any floating-point number, with specific values leading to the following behaviors:
[codeblock]
@ -299,14 +299,14 @@
</method>
<methodname="error_string">
<returntype="String"/>
<argumentindex="0"name="error"type="int"/>
<paramindex="0"name="error"type="int"/>
<description>
Returns a human-readable name for the given error code.
</description>
</method>
<methodname="exp">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
The natural exponential function. It raises the mathematical constant [b]e[/b] to the power of [code]x[/code] and returns it.
[b]e[/b] has an approximate value of 2.71828, and can be obtained with [code]exp(1)[/code].
@ -318,7 +318,7 @@
</method>
<methodname="floor">
<returntype="Variant"/>
<argumentindex="0"name="x"type="Variant"/>
<paramindex="0"name="x"type="Variant"/>
<description>
Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code]. Supported types: [int], [float], [Vector2], [Vector3], [Vector4].
[codeblock]
@ -333,7 +333,7 @@
</method>
<methodname="floorf">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code].
A type-safe version of [method floor], specialzied in floats.
@ -341,7 +341,7 @@
</method>
<methodname="floori">
<returntype="int"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code].
Equivalent of doing [code]int(x)[/code].
@ -349,8 +349,8 @@
</method>
<methodname="fmod">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<argumentindex="1"name="y"type="float"/>
<paramindex="0"name="x"type="float"/>
<paramindex="1"name="y"type="float"/>
<description>
Returns the floating-point remainder of [code]x/y[/code], keeping the sign of [code]x[/code].
[codeblock]
@ -362,8 +362,8 @@
</method>
<methodname="fposmod">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<argumentindex="1"name="y"type="float"/>
<paramindex="0"name="x"type="float"/>
<paramindex="1"name="y"type="float"/>
<description>
Returns the floating-point modulus of [code]x/y[/code] that wraps equally in positive and negative.
[codeblock]
@ -385,7 +385,7 @@
</method>
<methodname="hash">
<returntype="int"/>
<argumentindex="0"name="variable"type="Variant"/>
<paramindex="0"name="variable"type="Variant"/>
<description>
Returns the integer hash of the variable passed.
[codeblock]
@ -395,7 +395,7 @@
</method>
<methodname="instance_from_id">
<returntype="Object"/>
<argumentindex="0"name="instance_id"type="int"/>
<paramindex="0"name="instance_id"type="int"/>
<description>
Returns the Object that corresponds to [code]instance_id[/code]. All Objects have a unique instance ID.
[codeblock]
@ -409,9 +409,9 @@
</method>
<methodname="inverse_lerp">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="weight"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="weight"type="float"/>
<description>
Returns an interpolation or extrapolation factor considering the range specified in [code]from[/code] and [code]to[/code], and the interpolated value specified in [code]weight[/code]. The returned value will be between [code]0.0[/code] and [code]1.0[/code] if [code]weight[/code] is between [code]from[/code] and [code]to[/code] (inclusive). If [code]weight[/code] is located outside this range, then an extrapolation factor will be returned (return value lower than [code]0.0[/code] or greater than [code]1.0[/code]). Use [method clamp] on the result of [method inverse_lerp] if this is not desired.
[codeblock]
@ -427,8 +427,8 @@
</method>
<methodname="is_equal_approx">
<returntype="bool"/>
<argumentindex="0"name="a"type="float"/>
<argumentindex="1"name="b"type="float"/>
<paramindex="0"name="a"type="float"/>
<paramindex="1"name="b"type="float"/>
<description>
Returns [code]true[/code] if [code]a[/code] and [code]b[/code] are approximately equal to each other.
Here, approximately equal means that [code]a[/code] and [code]b[/code] are within a small internal epsilon of each other, which scales with the magnitude of the numbers.
@ -437,35 +437,35 @@
</method>
<methodname="is_inf">
<returntype="bool"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns whether [code]x[/code] is an infinity value (either positive infinity or negative infinity).
</description>
</method>
<methodname="is_instance_id_valid">
<returntype="bool"/>
<argumentindex="0"name="id"type="int"/>
<paramindex="0"name="id"type="int"/>
<description>
Returns [code]true[/code] if the Object that corresponds to [code]instance_id[/code] is a valid object (e.g. has not been deleted from memory). All Objects have a unique instance ID.
</description>
</method>
<methodname="is_instance_valid">
<returntype="bool"/>
<argumentindex="0"name="instance"type="Variant"/>
<paramindex="0"name="instance"type="Variant"/>
<description>
Returns whether [code]instance[/code] is a valid object (e.g. has not been deleted from memory).
</description>
</method>
<methodname="is_nan">
<returntype="bool"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns whether [code]x[/code] is a NaN ("Not a Number" or invalid) value.
</description>
</method>
<methodname="is_zero_approx">
<returntype="bool"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns [code]true[/code] if [code]x[/code] is zero or almost zero.
This method is faster than using [method is_equal_approx] with one value as zero.
@ -473,9 +473,9 @@
</method>
<methodname="lerp">
<returntype="Variant"/>
<argumentindex="0"name="from"type="Variant"/>
<argumentindex="1"name="to"type="Variant"/>
<argumentindex="2"name="weight"type="Variant"/>
<paramindex="0"name="from"type="Variant"/>
<paramindex="1"name="to"type="Variant"/>
<paramindex="2"name="weight"type="Variant"/>
<description>
Linearly interpolates between two values by the factor defined in [code]weight[/code]. To perform interpolation, [code]weight[/code] 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 [code]from[/code] and [code]to[/code] must have matching types. Supported types: [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis].
@ -488,9 +488,9 @@
</method>
<methodname="lerp_angle">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="weight"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="weight"type="float"/>
<description>
Linearly interpolates between two angles (in radians) by a normalized value.
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].
@ -508,9 +508,9 @@
</method>
<methodname="lerpf">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="weight"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="weight"type="float"/>
<description>
Linearly interpolates between two values by the factor defined in [code]weight[/code]. To perform interpolation, [code]weight[/code] 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].
[codeblock]
@ -521,7 +521,7 @@
</method>
<methodname="linear2db">
<returntype="float"/>
<argumentindex="0"name="lin"type="float"/>
<paramindex="0"name="lin"type="float"/>
<description>
Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example:
[codeblock]
@ -534,7 +534,7 @@
</method>
<methodname="log">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Natural logarithm. 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.
@ -555,8 +555,8 @@
</method>
<methodname="maxf">
<returntype="float"/>
<argumentindex="0"name="a"type="float"/>
<argumentindex="1"name="b"type="float"/>
<paramindex="0"name="a"type="float"/>
<paramindex="1"name="b"type="float"/>
<description>
Returns the maximum of two float values.
[codeblock]
@ -567,8 +567,8 @@
</method>
<methodname="maxi">
<returntype="int"/>
<argumentindex="0"name="a"type="int"/>
<argumentindex="1"name="b"type="int"/>
<paramindex="0"name="a"type="int"/>
<paramindex="1"name="b"type="int"/>
<description>
Returns the maximum of two int values.
[codeblock]
@ -588,8 +588,8 @@
</method>
<methodname="minf">
<returntype="float"/>
<argumentindex="0"name="a"type="float"/>
<argumentindex="1"name="b"type="float"/>
<paramindex="0"name="a"type="float"/>
<paramindex="1"name="b"type="float"/>
<description>
Returns the minimum of two float values.
[codeblock]
@ -600,8 +600,8 @@
</method>
<methodname="mini">
<returntype="int"/>
<argumentindex="0"name="a"type="int"/>
<argumentindex="1"name="b"type="int"/>
<paramindex="0"name="a"type="int"/>
<paramindex="1"name="b"type="int"/>
<description>
Returns the minimum of two int values.
[codeblock]
@ -612,9 +612,9 @@
</method>
<methodname="move_toward">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="delta"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="delta"type="float"/>
<description>
Moves [code]from[/code] toward [code]to[/code] by the [code]delta[/code] value.
Use a negative [code]delta[/code] value to move away.
@ -627,7 +627,7 @@
</method>
<methodname="nearest_po2">
<returntype="int"/>
<argumentindex="0"name="value"type="int"/>
<paramindex="0"name="value"type="int"/>
<description>
Returns the nearest equal or larger power of 2 for integer [code]value[/code].
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].
@ -644,8 +644,8 @@
</method>
<methodname="pingpong">
<returntype="float"/>
<argumentindex="0"name="value"type="float"/>
<argumentindex="1"name="length"type="float"/>
<paramindex="0"name="value"type="float"/>
<paramindex="1"name="length"type="float"/>
<description>
Returns the [code]value[/code] wrapped between [code]0[/code] and the [code]length[/code]. If the limit is reached, the next value the function returned is decreased to the [code]0[/code] side or increased to the [code]length[/code] side (like a triangle wave). If [code]length[/code] is less than zero, it becomes positive.
[codeblock]
@ -664,8 +664,8 @@
</method>
<methodname="posmod">
<returntype="int"/>
<argumentindex="0"name="x"type="int"/>
<argumentindex="1"name="y"type="int"/>
<paramindex="0"name="x"type="int"/>
<paramindex="1"name="y"type="int"/>
<description>
Returns the integer modulus of [code]x/y[/code] that wraps equally in positive and negative.
[codeblock]
@ -686,8 +686,8 @@
</method>
<methodname="pow">
<returntype="float"/>
<argumentindex="0"name="base"type="float"/>
<argumentindex="1"name="exp"type="float"/>
<paramindex="0"name="base"type="float"/>
<paramindex="1"name="exp"type="float"/>
<description>
Returns the result of [code]base[/code] raised to the power of [code]exp[/code].
[codeblock]
@ -774,7 +774,7 @@
</method>
<methodname="rad2deg">
<returntype="float"/>
<argumentindex="0"name="rad"type="float"/>
<paramindex="0"name="rad"type="float"/>
<description>
Converts an angle expressed in radians to degrees.
[codeblock]
@ -784,7 +784,7 @@
</method>
<methodname="rand_from_seed">
<returntype="PackedInt64Array"/>
<argumentindex="0"name="seed"type="int"/>
<paramindex="0"name="seed"type="int"/>
<description>
Random from seed: pass a [code]seed[/code], 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.
</description>
@ -800,8 +800,8 @@
</method>
<methodname="randf_range">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<description>
Returns a random floating point value on the interval between [code]from[/code] and [code]to[/code] (inclusive).
[codeblock]
@ -811,8 +811,8 @@
</method>
<methodname="randfn">
<returntype="float"/>
<argumentindex="0"name="mean"type="float"/>
<argumentindex="1"name="deviation"type="float"/>
<paramindex="0"name="mean"type="float"/>
<paramindex="1"name="deviation"type="float"/>
<description>
Returns a normally-distributed pseudo-random floating point value using Box-Muller transform with the specified [code]mean[/code] and a standard [code]deviation[/code]. This is also called Gaussian distribution.
</description>
@ -831,8 +831,8 @@
</method>
<methodname="randi_range">
<returntype="int"/>
<argumentindex="0"name="from"type="int"/>
<argumentindex="1"name="to"type="int"/>
<paramindex="0"name="from"type="int"/>
<paramindex="1"name="to"type="int"/>
<description>
Returns a random signed 32-bit integer between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code], they are swapped.
[codeblock]
@ -849,11 +849,11 @@
</method>
<methodname="range_lerp">
<returntype="float"/>
<argumentindex="0"name="value"type="float"/>
<argumentindex="1"name="istart"type="float"/>
<argumentindex="2"name="istop"type="float"/>
<argumentindex="3"name="ostart"type="float"/>
<argumentindex="4"name="ostop"type="float"/>
<paramindex="0"name="value"type="float"/>
<paramindex="1"name="istart"type="float"/>
<paramindex="2"name="istop"type="float"/>
<paramindex="3"name="ostart"type="float"/>
<paramindex="4"name="ostop"type="float"/>
<description>
Maps a [code]value[/code] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. See also [method lerp] and [method inverse_lerp]. If [code]value[/code] 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 range_lerp] if this is not desired.
[codeblock]
@ -870,14 +870,14 @@
</method>
<methodname="rid_from_int64">
<returntype="RID"/>
<argumentindex="0"name="base"type="int"/>
<paramindex="0"name="base"type="int"/>
<description>
Create a RID from an int64. This is used mainly from native extensions to build servers.
</description>
</method>
<methodname="round">
<returntype="Variant"/>
<argumentindex="0"name="x"type="Variant"/>
<paramindex="0"name="x"type="Variant"/>
<description>
Rounds [code]x[/code] to the nearest whole number, with halfway cases rounded away from zero. Supported types: [int], [float], [Vector2], [Vector3], [Vector4].
[codeblock]
@ -891,7 +891,7 @@
</method>
<methodname="roundf">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] to the nearest whole number, with halfway cases rounded away from zero.
A type-safe version of [method round], specialzied in floats.
@ -899,14 +899,14 @@
</method>
<methodname="roundi">
<returntype="int"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Rounds [code]x[/code] to the nearest whole number, with halfway cases rounded away from zero.
A type-safe version of [method round] that returns integer.
</description>
</method>
<methodname="seed">
<argumentindex="0"name="base"type="int"/>
<paramindex="0"name="base"type="int"/>
<description>
Sets seed for the random number generator.
[codeblock]
@ -917,7 +917,7 @@
</method>
<methodname="sign">
<returntype="Variant"/>
<argumentindex="0"name="x"type="Variant"/>
<paramindex="0"name="x"type="Variant"/>
<description>
Returns the sign of [code]x[/code] as same type of [Variant] as [code]x[/code] 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.
[codeblock]
@ -931,7 +931,7 @@
</method>
<methodname="signf">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the sign of [code]x[/code] as a float: -1.0 or 1.0. Returns 0.0 if [code]x[/code] is 0.
[codeblock]
@ -943,7 +943,7 @@
</method>
<methodname="signi">
<returntype="int"/>
<argumentindex="0"name="x"type="int"/>
<paramindex="0"name="x"type="int"/>
<description>
Returns the sign of [code]x[/code] as an integer: -1 or 1. Returns 0 if [code]x[/code] is 0.
[codeblock]
@ -955,7 +955,7 @@
</method>
<methodname="sin">
<returntype="float"/>
<argumentindex="0"name="angle_rad"type="float"/>
<paramindex="0"name="angle_rad"type="float"/>
<description>
Returns the sine of angle [code]angle_rad[/code] in radians.
[codeblock]
@ -966,7 +966,7 @@
</method>
<methodname="sinh">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the hyperbolic sine of [code]x[/code].
[codeblock]
@ -977,9 +977,9 @@
</method>
<methodname="smoothstep">
<returntype="float"/>
<argumentindex="0"name="from"type="float"/>
<argumentindex="1"name="to"type="float"/>
<argumentindex="2"name="x"type="float"/>
<paramindex="0"name="from"type="float"/>
<paramindex="1"name="to"type="float"/>
<paramindex="2"name="x"type="float"/>
<description>
Returns the result of smoothly interpolating the value of [code]x[/code] between [code]0[/code] and [code]1[/code], based on the where [code]x[/code] lies with respect to the edges [code]from[/code] and [code]to[/code].
The return value is [code]0[/code] if [code]x <= from[/code], and [code]1[/code] if [code]x >= to[/code]. If [code]x[/code] lies between [code]from[/code] and [code]to[/code], the returned value follows an S-shaped curve that maps [code]x[/code] between [code]0[/code] and [code]1[/code].
@ -996,8 +996,8 @@
</method>
<methodname="snapped">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<argumentindex="1"name="step"type="float"/>
<paramindex="0"name="x"type="float"/>
<paramindex="1"name="step"type="float"/>
<description>
Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals.
[codeblock]
@ -1009,7 +1009,7 @@
</method>
<methodname="sqrt">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the square root of [code]x[/code], where [code]x[/code] is a non-negative number.
[codeblock]
@ -1020,7 +1020,7 @@
</method>
<methodname="step_decimals">
<returntype="int"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<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]
@ -1041,7 +1041,7 @@
</method>
<methodname="str2var">
<returntype="Variant"/>
<argumentindex="0"name="string"type="String"/>
<paramindex="0"name="string"type="String"/>
<description>
Converts a formatted string that was returned by [method var2str] to the original value.
[codeblock]
@ -1053,7 +1053,7 @@
</method>
<methodname="tan">
<returntype="float"/>
<argumentindex="0"name="angle_rad"type="float"/>
<paramindex="0"name="angle_rad"type="float"/>
<description>
Returns the tangent of angle [code]angle_rad[/code] in radians.
[codeblock]
@ -1063,7 +1063,7 @@
</method>
<methodname="tanh">
<returntype="float"/>
<argumentindex="0"name="x"type="float"/>
<paramindex="0"name="x"type="float"/>
<description>
Returns the hyperbolic tangent of [code]x[/code].
[codeblock]
@ -1074,7 +1074,7 @@
</method>
<methodname="typeof">
<returntype="int"/>
<argumentindex="0"name="variable"type="Variant"/>
<paramindex="0"name="variable"type="Variant"/>
<description>
Returns the internal type of the given Variant object, using the [enum Variant.Type] values.
[codeblock]
@ -1090,7 +1090,7 @@
</method>
<methodname="var2bytes">
<returntype="PackedByteArray"/>
<argumentindex="0"name="variable"type="Variant"/>
<paramindex="0"name="variable"type="Variant"/>
<description>
Encodes a [Variant] value to a byte array, without encoding objects. Deserialization can be done with [method bytes2var].
[b]Note:[/b] If you need object serialization, see [method var2bytes_with_objects].
@ -1098,14 +1098,14 @@
</method>
<methodname="var2bytes_with_objects">
<returntype="PackedByteArray"/>
<argumentindex="0"name="variable"type="Variant"/>
<paramindex="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 bytes2var_with_objects].
</description>
</method>
<methodname="var2str">
<returntype="String"/>
<argumentindex="0"name="variable"type="Variant"/>
<paramindex="0"name="variable"type="Variant"/>
<description>
Converts a Variant [code]variable[/code] to a formatted string that can later be parsed using [method str2var].
[codeblock]
@ -1123,7 +1123,7 @@
</method>
<methodname="weakref">
<returntype="Variant"/>
<argumentindex="0"name="obj"type="Variant"/>
<paramindex="0"name="obj"type="Variant"/>
<description>
Returns a weak reference to an object, or [code]null[/code] if the argument 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.
@ -1131,9 +1131,9 @@
</method>
<methodname="wrap">
<returntype="Variant"/>
<argumentindex="0"name="value"type="Variant"/>
<argumentindex="1"name="min"type="Variant"/>
<argumentindex="2"name="max"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<paramindex="1"name="min"type="Variant"/>
<paramindex="2"name="max"type="Variant"/>
<description>
Wraps the [Variant] [code]value[/code] between [code]min[/code] and [code]max[/code].
Usable for creating loop-alike behavior or infinite surfaces.
@ -1152,9 +1152,9 @@
</method>
<methodname="wrapf">
<returntype="float"/>
<argumentindex="0"name="value"type="float"/>
<argumentindex="1"name="min"type="float"/>
<argumentindex="2"name="max"type="float"/>
<paramindex="0"name="value"type="float"/>
<paramindex="1"name="min"type="float"/>
<paramindex="2"name="max"type="float"/>
<description>
Wraps float [code]value[/code] between [code]min[/code] and [code]max[/code].
Usable for creating loop-alike behavior or infinite surfaces.
@ -1176,9 +1176,9 @@
</method>
<methodname="wrapi">
<returntype="int"/>
<argumentindex="0"name="value"type="int"/>
<argumentindex="1"name="min"type="int"/>
<argumentindex="2"name="max"type="int"/>
<paramindex="0"name="value"type="int"/>
<paramindex="1"name="min"type="int"/>
<paramindex="2"name="max"type="int"/>
<description>
Wraps integer [code]value[/code] between [code]min[/code] and [code]max[/code].
Usable for creating loop-alike behavior or infinite surfaces.
Constructs an [AABB] as a copy of the given [AABB].
</description>
</constructor>
<constructorname="AABB">
<returntype="AABB"/>
<argumentindex="0"name="position"type="Vector3"/>
<argumentindex="1"name="size"type="Vector3"/>
<paramindex="0"name="position"type="Vector3"/>
<paramindex="1"name="size"type="Vector3"/>
<description>
Constructs an [AABB] from a position and size.
</description>
@ -46,14 +46,14 @@
</method>
<methodname="encloses"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="with"type="AABB"/>
<paramindex="0"name="with"type="AABB"/>
<description>
Returns [code]true[/code] if this [AABB] completely encloses another one.
</description>
</method>
<methodname="expand"qualifiers="const">
<returntype="AABB"/>
<argumentindex="0"name="to_point"type="Vector3"/>
<paramindex="0"name="to_point"type="Vector3"/>
<description>
Returns a copy of this [AABB] expanded to include a given point.
[b]Example:[/b]
@ -81,7 +81,7 @@
</method>
<methodname="get_endpoint"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Gets the position of the 8 endpoints of the [AABB] in space.
</description>
@ -124,7 +124,7 @@
</method>
<methodname="get_support"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="dir"type="Vector3"/>
<paramindex="0"name="dir"type="Vector3"/>
<description>
Returns the support point in a given direction. This is useful for collision detection algorithms.
</description>
@ -137,7 +137,7 @@
</method>
<methodname="grow"qualifiers="const">
<returntype="AABB"/>
<argumentindex="0"name="by"type="float"/>
<paramindex="0"name="by"type="float"/>
<description>
Returns a copy of the [AABB] grown a given amount of units towards all the sides.
</description>
@ -156,7 +156,7 @@
</method>
<methodname="has_point"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="point"type="Vector3"/>
<paramindex="0"name="point"type="Vector3"/>
<description>
Returns [code]true[/code] if the [AABB] contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
[b]Note:[/b] This method is not reliable for [AABB] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent [AABB] to check for contained points.
@ -164,50 +164,50 @@
</method>
<methodname="intersection"qualifiers="const">
<returntype="AABB"/>
<argumentindex="0"name="with"type="AABB"/>
<paramindex="0"name="with"type="AABB"/>
<description>
Returns the intersection between two [AABB]. An empty AABB (size [code](0, 0, 0)[/code]) is returned on failure.
</description>
</method>
<methodname="intersects"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="with"type="AABB"/>
<paramindex="0"name="with"type="AABB"/>
<description>
Returns [code]true[/code] if the [AABB] overlaps with another.
</description>
</method>
<methodname="intersects_plane"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="plane"type="Plane"/>
<paramindex="0"name="plane"type="Plane"/>
<description>
Returns [code]true[/code] if the [AABB] is on both sides of a plane.
Returns [code]true[/code] if the [AABB] intersects the line segment between [code]from[/code] and [code]to[/code].
</description>
</method>
<methodname="is_equal_approx"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="aabb"type="AABB"/>
<paramindex="0"name="aabb"type="AABB"/>
<description>
Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<methodname="merge"qualifiers="const">
<returntype="AABB"/>
<argumentindex="0"name="with"type="AABB"/>
<paramindex="0"name="with"type="AABB"/>
<description>
Returns a larger [AABB] that contains both this [AABB] and [code]with[/code].
</description>
@ -228,7 +228,7 @@
<operators>
<operatorname="operator !=">
<returntype="bool"/>
<argumentindex="0"name="right"type="AABB"/>
<paramindex="0"name="right"type="AABB"/>
<description>
Returns [code]true[/code] if the vectors are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
Start the AES context in the given [code]mode[/code]. A [code]key[/code] of either 16 or 32 bytes must always be provided, while an [code]iv[/code] (initialization vector) of exactly 16 bytes, is only needed when [code]mode[/code] is either [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT].
Run the desired operation for this AES context. Will return a [PackedByteArray] containing the result of encrypting (or decrypting) the given [code]src[/code]. See [method start] for mode of operation.
[b]Note:[/b] The size of [code]src[/code] must be a multiple of 16. Apply some padding if needed.
Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 0.0 or greater.
The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [code]weight_scale[/code]s to form a path.
Returns whether there is a connection/segment between the given points. If [code]bidirectional[/code] is [code]false[/code], returns whether movement from [code]id[/code] to [code]to_id[/code] is possible through this segment.
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
Deletes the segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is prevented, and a unidirectional segment possibly remains.
Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool.
[b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result.
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
[codeblocks]
@ -136,8 +136,8 @@
</method>
<methodname="get_id_path">
<returntype="PackedInt64Array"/>
<argumentindex="0"name="from_id"type="int"/>
<argumentindex="1"name="to_id"type="int"/>
<paramindex="0"name="from_id"type="int"/>
<paramindex="1"name="to_id"type="int"/>
<description>
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
[codeblocks]
@ -180,7 +180,7 @@
</method>
<methodname="get_point_connections">
<returntype="PackedInt64Array"/>
<argumentindex="0"name="id"type="int"/>
<paramindex="0"name="id"type="int"/>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
[codeblocks]
@ -225,8 +225,8 @@
</method>
<methodname="get_point_path">
<returntype="PackedVector2Array"/>
<argumentindex="0"name="from_id"type="int"/>
<argumentindex="1"name="to_id"type="int"/>
<paramindex="0"name="from_id"type="int"/>
<paramindex="1"name="to_id"type="int"/>
<description>
Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector2Array] and will print an error message.
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
</description>
</method>
<methodname="remove_point">
<returntype="void"/>
<argumentindex="0"name="id"type="int"/>
<paramindex="0"name="id"type="int"/>
<description>
Removes the point associated with the given [code]id[/code] from the points pool.
</description>
</method>
<methodname="reserve_space">
<returntype="void"/>
<argumentindex="0"name="num_nodes"type="int"/>
<paramindex="0"name="num_nodes"type="int"/>
<description>
Reserves space internally for [code]num_nodes[/code] 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.
Sets the [code]weight_scale[/code] for the point with the given [code]id[/code]. The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point.
Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 0.0 or greater.
The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [code]weight_scale[/code]s to form a path.
Returns whether the two given points are directly connected by a segment. If [code]bidirectional[/code] is [code]false[/code], returns whether movement from [code]id[/code] to [code]to_id[/code] is possible through this segment.
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
Deletes the segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is prevented, and a unidirectional segment possibly remains.
Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool.
[b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result.
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
[codeblocks]
@ -165,8 +165,8 @@
</method>
<methodname="get_id_path">
<returntype="PackedInt64Array"/>
<argumentindex="0"name="from_id"type="int"/>
<argumentindex="1"name="to_id"type="int"/>
<paramindex="0"name="from_id"type="int"/>
<paramindex="1"name="to_id"type="int"/>
<description>
Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
[codeblocks]
@ -208,7 +208,7 @@
</method>
<methodname="get_point_connections">
<returntype="PackedInt64Array"/>
<argumentindex="0"name="id"type="int"/>
<paramindex="0"name="id"type="int"/>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
[codeblocks]
@ -252,8 +252,8 @@
</method>
<methodname="get_point_path">
<returntype="PackedVector3Array"/>
<argumentindex="0"name="from_id"type="int"/>
<argumentindex="1"name="to_id"type="int"/>
<paramindex="0"name="from_id"type="int"/>
<paramindex="1"name="to_id"type="int"/>
<description>
Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message.
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
</description>
</method>
<methodname="remove_point">
<returntype="void"/>
<argumentindex="0"name="id"type="int"/>
<paramindex="0"name="id"type="int"/>
<description>
Removes the point associated with the given [code]id[/code] from the points pool.
</description>
</method>
<methodname="reserve_space">
<returntype="void"/>
<argumentindex="0"name="num_nodes"type="int"/>
<paramindex="0"name="num_nodes"type="int"/>
<description>
Reserves space internally for [code]num_nodes[/code] 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.
Sets the [code]weight_scale[/code] for the point with the given [code]id[/code]. The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point.
Adds a button with label [code]text[/code] and a custom [code]action[/code] to the dialog and returns the created button. [code]action[/code] will be passed to the [signal custom_action] signal when pressed.
If [code]true[/code], [code]right[/code] will place the button to the right of any sibling buttons.
@ -22,7 +22,7 @@
</method>
<methodname="add_cancel_button">
<returntype="Button"/>
<argumentindex="0"name="name"type="String"/>
<paramindex="0"name="name"type="String"/>
<description>
Adds a button with label [code]name[/code] and a cancel action to the dialog and returns the created button.
You can use [method remove_button] method to remove a button created with this method from the dialog.
Registers a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
</description>
</method>
<methodname="remove_button">
<returntype="void"/>
<argumentindex="0"name="button"type="Control"/>
<paramindex="0"name="button"type="Control"/>
<description>
Removes the [code]button[/code] from the dialog. Does NOT free the [code]button[/code]. The [code]button[/code] must be a [Button] added with [method add_button] or [method add_cancel_button] method. After removal, pressing the [code]button[/code] will no longer emit this dialog's [signal custom_action] or [signal cancelled] signals.
Plays the animation named [code]anim[/code]. If no [code]anim[/code] is provided, the current animation is played. If [code]backwards[/code] is [code]true[/code], the animation will be played in reverse.
Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be [code]1.0 / fps + delay[/code].
For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be:
Assigns a [Texture2D] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1.
You can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation.
Inserts a key with value [code]animation[/code] at the given [code]time[/code] (in seconds). The [code]track_idx[/code] must be the index of an Animation Track.
Inserts an Audio Track key at the given [code]time[/code] in seconds. The [code]track_idx[/code] must be the index of an Audio Track.
[code]stream[/code] is the [AudioStream] resource to play. [code]start_offset[/code] is the number of seconds cut off at the beginning of the audio stream, while [code]end_offset[/code] is at the ending.
@ -105,71 +105,71 @@
</method>
<methodname="audio_track_set_key_end_offset">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="key_idx"type="int"/>
<argumentindex="2"name="offset"type="float"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="key_idx"type="int"/>
<paramindex="2"name="offset"type="float"/>
<description>
Sets the end offset of the key identified by [code]key_idx[/code] to value [code]offset[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
</description>
</method>
<methodname="audio_track_set_key_start_offset">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="key_idx"type="int"/>
<argumentindex="2"name="offset"type="float"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="key_idx"type="int"/>
<paramindex="2"name="offset"type="float"/>
<description>
Sets the start offset of the key identified by [code]key_idx[/code] to value [code]offset[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
</description>
</method>
<methodname="audio_track_set_key_stream">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="key_idx"type="int"/>
<argumentindex="2"name="stream"type="Resource"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="key_idx"type="int"/>
<paramindex="2"name="stream"type="Resource"/>
<description>
Sets the stream of the key identified by [code]key_idx[/code] to value [code]stream[/code]. The [code]track_idx[/code] must be the index of an Audio Track.
Returns the handle mode of the key identified by [code]index[/code]. See [enum HandleMode] for possible values. The [code]track_idx[/code] must be the index of a Bezier Track.
Inserts a Bezier Track key at the given [code]time[/code] in seconds. The [code]track_idx[/code] must be the index of a Bezier Track.
[code]in_handle[/code] is the left-side weight of the added Bezier curve point, [code]out_handle[/code] is the right-side one, while [code]value[/code] is the actual value at this point.
Changes the handle mode of the keyframe at the given [code]index[/code]. See [enum HandleMode] for possible values. The [code]track_idx[/code] must be the index of a Bezier Track.
Sets the in handle of the key identified by [code]key_idx[/code] to value [code]in_handle[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
Sets the out handle of the key identified by [code]key_idx[/code] to value [code]out_handle[/code]. The [code]track_idx[/code] must be the index of a Bezier Track.
</description>
</method>
<methodname="bezier_track_set_key_value">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="key_idx"type="int"/>
<argumentindex="2"name="value"type="float"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="key_idx"type="int"/>
<paramindex="2"name="value"type="float"/>
<description>
Sets the value of the key identified by [code]key_idx[/code] to the given value. The [code]track_idx[/code] must be the index of a Bezier Track.
Sets the transition curve (easing) for a specific key (see the built-in math function [method @GlobalScope.ease]).
</description>
</method>
<methodname="track_set_key_value">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="key"type="int"/>
<argumentindex="2"name="value"type="Variant"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="key"type="int"/>
<paramindex="2"name="value"type="Variant"/>
<description>
Sets the value of an existing key.
</description>
</method>
<methodname="track_set_path">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="path"type="NodePath"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="path"type="NodePath"/>
<description>
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code].
For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
@ -528,40 +528,40 @@
</method>
<methodname="track_swap">
<returntype="void"/>
<argumentindex="0"name="track_idx"type="int"/>
<argumentindex="1"name="with_idx"type="int"/>
<paramindex="0"name="track_idx"type="int"/>
<paramindex="1"name="with_idx"type="int"/>
<description>
Swaps the track [code]idx[/code]'s index position with the track [code]with_idx[/code].
Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
</description>
@ -51,9 +51,9 @@
</method>
<methodname="_process"qualifiers="virtual const">
<returntype="float"/>
<argumentindex="0"name="time"type="float"/>
<argumentindex="1"name="seek"type="bool"/>
<argumentindex="2"name="seek_root"type="bool"/>
<paramindex="0"name="time"type="float"/>
<paramindex="1"name="seek"type="bool"/>
<paramindex="2"name="seek_root"type="bool"/>
<description>
User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute.
Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
@ -62,47 +62,47 @@
</method>
<methodname="add_input">
<returntype="void"/>
<argumentindex="0"name="name"type="String"/>
<paramindex="0"name="name"type="String"/>
<description>
Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree].
Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened.
Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).
Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition.
</description>
@ -115,44 +115,44 @@
</method>
<methodname="get_input_name">
<returntype="String"/>
<argumentindex="0"name="input"type="int"/>
<paramindex="0"name="input"type="int"/>
<description>
Gets the name of an input by index.
</description>
</method>
<methodname="get_parameter"qualifiers="const">
<returntype="Variant"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
</description>
</method>
<methodname="is_path_filtered"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="path"type="NodePath"/>
<paramindex="0"name="path"type="NodePath"/>
<description>
Returns whether the given path is filtered.
</description>
</method>
<methodname="remove_input">
<returntype="void"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Removes an input, call this only when inactive.
</description>
</method>
<methodname="set_filter_path">
<returntype="void"/>
<argumentindex="0"name="path"type="NodePath"/>
<argumentindex="1"name="enable"type="bool"/>
<paramindex="0"name="path"type="NodePath"/>
<paramindex="1"name="enable"type="bool"/>
<description>
Adds or removes a path for the filter.
</description>
</method>
<methodname="set_parameter">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<argumentindex="1"name="value"type="Variant"/>
<paramindex="0"name="name"type="StringName"/>
<paramindex="1"name="value"type="Variant"/>
<description>
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
Adds a new point that represents a [code]node[/code] on the virtual axis at a given position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array.
Adds a new point that represents a [code]node[/code] at the position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array.
Creates a new triangle using three points [code]x[/code], [code]y[/code], and [code]z[/code]. Triangles can overlap. You can insert the triangle at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array.
Adds [code]library[/code] to the animation player, under the key [code]name[/code].
</description>
</method>
<methodname="advance">
<returntype="void"/>
<argumentindex="0"name="delta"type="float"/>
<paramindex="0"name="delta"type="float"/>
<description>
Shifts position in the animation timeline and immediately updates the animation. [code]delta[/code] is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled.
Plays the animation with key [code]name[/code]. Custom blend times and speed can be set. If [code]custom_speed[/code] is negative and [code]from_end[/code] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]).
The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [code]name[/code], or with no [code]name[/code] parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [method stop] for both pause and stop). If the animation was already playing, it will keep playing.
Plays the animation with key [code]name[/code] in reverse.
This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
@ -160,7 +160,7 @@
</method>
<methodname="queue">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Queues an animation for playback once the current one is done.
[b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
@ -168,23 +168,23 @@
</method>
<methodname="remove_animation_library">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes the [AnimationLibrary] assosiated with the key [code]name[/code].
Seeks the animation to the [code]seconds[/code] point in time (in seconds). If [code]update[/code] is [code]true[/code], the animation updates too, otherwise it updates at process time. Events between the current frame and [code]seconds[/code] are skipped.
[b]Note:[/b] Seeking to the end of the animation doesn't emit [signal animation_finished]. If you want to skip animation and emit the signal, use [method advance].
Stops or pauses the currently playing animation. If [code]reset[/code] is [code]true[/code], the animation position is reset to [code]0[/code] and the playback speed is reset to [code]1.0[/code].
If [code]reset[/code] is [code]false[/code], the [member current_animation_position] will be kept and calling [method play] or [method play_backwards] without arguments or with the same animation name as [member assigned_animation] will resume the animation.
Returns [code]true[/code] if the given [Area2D] intersects or overlaps this [Area2D], [code]false[/code] otherwise.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
@ -37,7 +37,7 @@
</method>
<methodname="overlaps_body"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="body"type="Node"/>
<paramindex="0"name="body"type="Node"/>
<description>
Returns [code]true[/code] if the given physics body intersects or overlaps this [Area2D], [code]false[/code] otherwise.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
@ -96,24 +96,24 @@
</members>
<signals>
<signalname="area_entered">
<argumentindex="0"name="area"type="Area2D"/>
<paramindex="0"name="area"type="Area2D"/>
<description>
Emitted when another Area2D enters this Area2D. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area2D.
</description>
</signal>
<signalname="area_exited">
<argumentindex="0"name="area"type="Area2D"/>
<paramindex="0"name="area"type="Area2D"/>
<description>
Emitted when another Area2D exits this Area2D. Requires [member monitoring] to be set to [code]true[/code].
Emitted when one of another Area2D's [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_rid[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D].
@ -136,24 +136,24 @@
</description>
</signal>
<signalname="body_entered">
<argumentindex="0"name="body"type="Node2D"/>
<paramindex="0"name="body"type="Node2D"/>
<description>
Emitted when a [PhysicsBody2D] or [TileMap] enters this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
</description>
</signal>
<signalname="body_exited">
<argumentindex="0"name="body"type="Node2D"/>
<paramindex="0"name="body"type="Node2D"/>
<description>
Emitted when a [PhysicsBody2D] or [TileMap] exits this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
Returns [code]true[/code] if the given [Area3D] intersects or overlaps this [Area3D], [code]false[/code] otherwise.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
@ -35,7 +35,7 @@
</method>
<methodname="overlaps_body"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="body"type="Node"/>
<paramindex="0"name="body"type="Node"/>
<description>
Returns [code]true[/code] if the given physics body intersects or overlaps this [Area3D], [code]false[/code] otherwise.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
@ -115,24 +115,24 @@
</members>
<signals>
<signalname="area_entered">
<argumentindex="0"name="area"type="Area3D"/>
<paramindex="0"name="area"type="Area3D"/>
<description>
Emitted when another Area3D enters this Area3D. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area3D.
</description>
</signal>
<signalname="area_exited">
<argumentindex="0"name="area"type="Area3D"/>
<paramindex="0"name="area"type="Area3D"/>
<description>
Emitted when another Area3D exits this Area3D. Requires [member monitoring] to be set to [code]true[/code].
Emitted when one of another Area3D's [Shape3D]s exits one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_rid[/code] the [RID] of the other Area3D's [CollisionObject3D] used by the [PhysicsServer3D].
@ -155,24 +155,24 @@
</description>
</signal>
<signalname="body_entered">
<argumentindex="0"name="body"type="Node3D"/>
<paramindex="0"name="body"type="Node3D"/>
<description>
Emitted when a [PhysicsBody3D] or [GridMap] enters this Area3D. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
</description>
</signal>
<signalname="body_exited">
<argumentindex="0"name="body"type="Node3D"/>
<paramindex="0"name="body"type="Node3D"/>
<description>
Emitted when a [PhysicsBody3D] or [GridMap] exits this Area3D. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
Emitted when one of a [PhysicsBody3D] or [GridMap]'s [Shape3D]s enters one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body_rid[/code] the [RID] of the [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D].
Emitted when one of a [PhysicsBody3D] or [GridMap]'s [Shape3D]s enters one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body_rid[/code] the [RID] of the [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D].
Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]all[/i] elements in the array. If the [Callable] returns [code]false[/code] for one array element or more, this method returns [code]false[/code].
The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
@ -148,7 +148,7 @@
</method>
<methodname="any"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="method"type="Callable"/>
<paramindex="0"name="method"type="Callable"/>
<description>
Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]one or more[/i] elements in the array. If the [Callable] returns [code]false[/code] for all elements in the array, this method returns [code]false[/code].
The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
@ -171,14 +171,14 @@
</method>
<methodname="append">
<returntype="void"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Appends an element at the end of the array (alias of [method push_back]).
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return [code]true[/code] if the first argument is less than the second, and return [code]false[/code] otherwise.
[b]Note:[/b] Calling [method bsearch_custom] on an unsorted array results in unexpected behavior.
@ -223,14 +223,14 @@
</method>
<methodname="count"qualifiers="const">
<returntype="int"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Returns the number of times an element is in the array.
If [code]deep[/code] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array.
@ -238,7 +238,7 @@
</method>
<methodname="erase">
<returntype="void"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] instead.
[b]Note:[/b] This method acts in-place and doesn't return a value.
@ -247,7 +247,7 @@
</method>
<methodname="fill">
<returntype="void"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements:
[codeblocks]
@ -266,7 +266,7 @@
</method>
<methodname="filter"qualifiers="const">
<returntype="Array"/>
<argumentindex="0"name="method"type="Callable"/>
<paramindex="0"name="method"type="Callable"/>
<description>
Calls the provided [Callable] on each element in the array and returns a new array with the elements for which the method returned [code]true[/code].
The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
<methodname="find_last"qualifiers="const">
<returntype="int"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Searches the array in reverse order for a value and returns its index or [code]-1[/code] if not found.
</description>
@ -305,7 +305,7 @@
</method>
<methodname="has"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Returns [code]true[/code] if the array contains the given value.
[codeblocks]
@ -352,8 +352,8 @@
</method>
<methodname="insert">
<returntype="int"/>
<argumentindex="0"name="position"type="int"/>
<argumentindex="1"name="value"type="Variant"/>
<paramindex="0"name="position"type="int"/>
<paramindex="1"name="value"type="Variant"/>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]pos == size()[/code]).
[b]Note:[/b] This method acts in-place and doesn't return a value.
@ -368,7 +368,7 @@
</method>
<methodname="map"qualifiers="const">
<returntype="Array"/>
<argumentindex="0"name="method"type="Callable"/>
<paramindex="0"name="method"type="Callable"/>
<description>
Calls the provided [Callable] for each element in the array and returns a new array filled with values returned by the method.
The callable's method should take one [Variant] parameter (the current array element) and can return any [Variant].
@ -397,7 +397,7 @@
</method>
<methodname="pop_at">
<returntype="Variant"/>
<argumentindex="0"name="position"type="int"/>
<paramindex="0"name="position"type="int"/>
<description>
Removes and returns the element of the array at index [code]position[/code]. If negative, [code]position[/code] is considered relative to the end of the array. Leaves the array untouched and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
[b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be.
@ -418,14 +418,14 @@
</method>
<methodname="push_back">
<returntype="void"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Appends an element at the end of the array. See also [method push_front].
</description>
</method>
<methodname="push_front">
<returntype="void"/>
<argumentindex="0"name="value"type="Variant"/>
<paramindex="0"name="value"type="Variant"/>
<description>
Adds an element at the beginning of the array. See also [method push_back].
[b]Note:[/b] On large arrays, this method is much slower than [method push_back] as it will reindex all the array's elements every time it's called. The larger the array, the slower [method push_front] will be.
Calls the provided [Callable] for each element in array and accumulates the result in [code]accum[/code].
The callable's method takes two arguments: the current value of [code]accum[/code] and the current array element. If [code]accum[/code] is [code]null[/code] (default value), the iteration will start from the second element, with the first one used as initial value of [code]accum[/code].
@ -451,7 +451,7 @@
</method>
<methodname="remove_at">
<returntype="void"/>
<argumentindex="0"name="position"type="int"/>
<paramindex="0"name="position"type="int"/>
<description>
Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use [method erase] instead.
[b]Note:[/b] This method acts in-place and doesn't return a value.
@ -460,7 +460,7 @@
</method>
<methodname="resize">
<returntype="int"/>
<argumentindex="0"name="size"type="int"/>
<paramindex="0"name="size"type="int"/>
<description>
Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are [code]null[/code].
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
Returns the slice of the [Array], from [code]begin[/code] (inclusive) to [code]end[/code] (exclusive), as a new [Array].
The absolute value of [code]begin[/code] and [code]end[/code] will be clamped to the array size, so the default value for [code]end[/code] makes it slice to the size of the array by default (i.e. [code]arr.slice(1)[/code] is a shorthand for [code]arr.slice(1, arr.size())[/code]).
@ -530,7 +530,7 @@
</method>
<methodname="sort_custom">
<returntype="void"/>
<argumentindex="0"name="func"type="Callable"/>
<paramindex="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.
@ -560,56 +560,56 @@
<operators>
<operatorname="operator !=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Compares the left operand [Array] against the [code]right[/code] [Array]. Returns [code]true[/code] if the sizes or contents of the arrays are [i]not[/i] equal, [code]false[/code] otherwise.
</description>
</operator>
<operatorname="operator +">
<returntype="Array"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Concatenates two [Array]s together, with the [code]right[/code] [Array] being added to the end of the [Array] specified in the left operand. For example, [code][1, 2] + [3, 4][/code] results in [code][1, 2, 3, 4][/code].
</description>
</operator>
<operatorname="operator <">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]false[/code] if the left operand [Array] has less elements, otherwise it returns [code]true[/code].
</description>
</operator>
<operatorname="operator <=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the left operand [Array] has less or the same number of elements, otherwise it returns [code]false[/code].
</description>
</operator>
<operatorname="operator ==">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Compares the left operand [Array] against the [code]right[/code] [Array]. Returns [code]true[/code] if the sizes and contents of the arrays are equal, [code]false[/code] otherwise.
</description>
</operator>
<operatorname="operator >">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [code]right[/code] [Array] has more elements, otherwise it returns [code]false[/code].
</description>
</operator>
<operatorname="operator >=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Array"/>
<paramindex="0"name="right"type="Array"/>
<description>
Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [code]right[/code] [Array] has more or the same number of elements, otherwise it returns [code]false[/code].
</description>
</operator>
<operatorname="operator []">
<returntype="void"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Returns a reference to the element of type [Variant] at the specified location. Arrays start at index 0. [code]index[/code] can be a zero or positive value to start from the beginning, or a negative value to start from the end. Out-of-bounds array access causes a run-time error, which will result in an error being printed and the project execution pausing if run from the editor.
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
Returns [code]true[/code] if at least [code]frames[/code] audio frames are available to read in the internal ring buffer.
</description>
@ -26,7 +26,7 @@
</method>
<methodname="get_buffer">
<returntype="PackedVector2Array"/>
<argumentindex="0"name="frames"type="int"/>
<paramindex="0"name="frames"type="int"/>
<description>
Gets the next [code]frames[/code] audio samples from the internal ring buffer.
Returns a [PackedVector2Array] containing exactly [code]frames[/code] audio samples if available, or an empty [PackedVector2Array] if insufficient data was available.
Returns [code]true[/code] if a buffer of the size [code]amount[/code] can be pushed to the audio sample data buffer without overflowing it, [code]false[/code] otherwise.
Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDExtension, but [method push_buffer] may be [i]less[/i] efficient in GDScript.
</description>
</method>
<methodname="push_frame">
<returntype="bool"/>
<argumentindex="0"name="frame"type="Vector2"/>
<paramindex="0"name="frame"type="Vector2"/>
<description>
Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDExtension, but [method push_frame] may be [i]more[/i] efficient in GDScript.
Set the probability weight of the stream at the specified index. The higher this value, the more likely that the randomizer will choose this stream during random playback modes.
Called when the button is toggled (only if [member toggle_mode] is active).
</description>
@ -36,7 +36,7 @@
</method>
<methodname="set_pressed_no_signal">
<returntype="void"/>
<argumentindex="0"name="pressed"type="bool"/>
<paramindex="0"name="pressed"type="bool"/>
<description>
Changes the [member button_pressed] state of the button, without emitting [signal toggled]. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if [member toggle_mode] is [code]true[/code].
[b]Note:[/b] This method doesn't unpress other buttons in [member button_group].
Emitted when the button was just toggled between pressed and normal states (only if [member toggle_mode] is active). The new state is contained in the [code]button_pressed[/code] argument.
If [code]true[/code], enables the specified [enum Feature]. Many features that are available in [BaseMaterial3D]s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to [code]true[/code].
If [code]true[/code], enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to [code]true[/code]. See [enum Flags] enumerator for options.
Constructs a [Basis] as a copy of the given [Basis].
</description>
</constructor>
<constructorname="Basis">
<returntype="Basis"/>
<argumentindex="0"name="axis"type="Vector3"/>
<argumentindex="1"name="angle"type="float"/>
<paramindex="0"name="axis"type="Vector3"/>
<paramindex="1"name="angle"type="float"/>
<description>
Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]angle[/code] (in radians). The axis must be a normalized vector.
</description>
</constructor>
<constructorname="Basis">
<returntype="Basis"/>
<argumentindex="0"name="from"type="Quaternion"/>
<paramindex="0"name="from"type="Quaternion"/>
<description>
Constructs a pure rotation basis matrix from the given quaternion.
</description>
</constructor>
<constructorname="Basis">
<returntype="Basis"/>
<argumentindex="0"name="x_axis"type="Vector3"/>
<argumentindex="1"name="y_axis"type="Vector3"/>
<argumentindex="2"name="z_axis"type="Vector3"/>
<paramindex="0"name="x_axis"type="Vector3"/>
<paramindex="1"name="y_axis"type="Vector3"/>
<paramindex="2"name="z_axis"type="Vector3"/>
<description>
Constructs a basis matrix from 3 axis vectors (matrix columns).
Constructs a pure scale basis matrix with no rotation or shearing. The scale values are set as the diagonal of the matrix, and the other parts of the matrix are zero.
Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
Consider using the [method get_rotation_quaternion] method instead, which returns a [Quaternion] quaternion instead of Euler angles.
@ -113,15 +113,15 @@
</method>
<methodname="is_equal_approx"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="b"type="Basis"/>
<paramindex="0"name="b"type="Basis"/>
<description>
Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
Creates a Basis with a rotation such that the forward axis (-Z) points towards the [code]target[/code] position.
The up axis (+Y) points as close to the [code]up[/code] vector as possible while staying perpendicular to the forward axis. The resulting Basis is orthonormalized. The [code]target[/code] and [code]up[/code] vectors cannot be zero, and cannot be parallel to each other.
@ -135,44 +135,44 @@
</method>
<methodname="rotated"qualifiers="const">
<returntype="Basis"/>
<argumentindex="0"name="axis"type="Vector3"/>
<argumentindex="1"name="angle"type="float"/>
<paramindex="0"name="axis"type="Vector3"/>
<paramindex="1"name="angle"type="float"/>
<description>
Introduce an additional rotation around the given axis by [code]angle[/code] (in radians). The axis must be a normalized vector.
</description>
</method>
<methodname="scaled"qualifiers="const">
<returntype="Basis"/>
<argumentindex="0"name="scale"type="Vector3"/>
<paramindex="0"name="scale"type="Vector3"/>
<description>
Introduce an additional scaling specified by the given 3D scaling factor.
</description>
</method>
<methodname="slerp"qualifiers="const">
<returntype="Basis"/>
<argumentindex="0"name="to"type="Basis"/>
<argumentindex="1"name="weight"type="float"/>
<paramindex="0"name="to"type="Basis"/>
<paramindex="1"name="weight"type="float"/>
<description>
Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix.
</description>
</method>
<methodname="tdotx"qualifiers="const">
<returntype="float"/>
<argumentindex="0"name="with"type="Vector3"/>
<paramindex="0"name="with"type="Vector3"/>
<description>
Transposed dot product with the X axis of the matrix.
</description>
</method>
<methodname="tdoty"qualifiers="const">
<returntype="float"/>
<argumentindex="0"name="with"type="Vector3"/>
<paramindex="0"name="with"type="Vector3"/>
<description>
Transposed dot product with the Y axis of the matrix.
</description>
</method>
<methodname="tdotz"qualifiers="const">
<returntype="float"/>
<argumentindex="0"name="with"type="Vector3"/>
<paramindex="0"name="with"type="Vector3"/>
<description>
Transposed dot product with the Z axis of the matrix.
</description>
@ -225,7 +225,7 @@
<operators>
<operatorname="operator !=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Basis"/>
<paramindex="0"name="right"type="Basis"/>
<description>
Returns [code]true[/code] if the [Basis] matrices are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
@ -233,35 +233,35 @@
</operator>
<operatorname="operator *">
<returntype="Basis"/>
<argumentindex="0"name="right"type="Basis"/>
<paramindex="0"name="right"type="Basis"/>
<description>
Composes these two basis matrices by multiplying them together. This has the effect of transforming the second basis (the child) by the first basis (the parent).
</description>
</operator>
<operatorname="operator *">
<returntype="Vector3"/>
<argumentindex="0"name="right"type="Vector3"/>
<paramindex="0"name="right"type="Vector3"/>
<description>
Transforms (multiplies) the [Vector3] by the given [Basis] matrix.
</description>
</operator>
<operatorname="operator *">
<returntype="Basis"/>
<argumentindex="0"name="right"type="float"/>
<paramindex="0"name="right"type="float"/>
<description>
This operator multiplies all components of the [Basis], which scales it uniformly.
</description>
</operator>
<operatorname="operator *">
<returntype="Basis"/>
<argumentindex="0"name="right"type="int"/>
<paramindex="0"name="right"type="int"/>
<description>
This operator multiplies all components of the [Basis], which scales it uniformly.
</description>
</operator>
<operatorname="operator ==">
<returntype="bool"/>
<argumentindex="0"name="right"type="Basis"/>
<paramindex="0"name="right"type="Basis"/>
<description>
Returns [code]true[/code] if the [Basis] matrices are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
@ -269,7 +269,7 @@
</operator>
<operatorname="operator []">
<returntype="Vector3"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Access basis components using their index. [code]b[0][/code] is equivalent to [code]b.x[/code], [code]b[1][/code] is equivalent to [code]b.y[/code], and [code]b[2][/code] is equivalent to [code]b.z[/code].
Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to [code]false[/code] if the alpha value of the image at that position is equal to [code]threshold[/code] or less, and [code]true[/code] in other case.
</description>
</method>
<methodname="get_bit"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="position"type="Vector2"/>
<paramindex="0"name="position"type="Vector2"/>
<description>
Returns bitmap's value at the specified position.
</description>
@ -51,16 +51,16 @@
</method>
<methodname="grow_mask">
<returntype="void"/>
<argumentindex="0"name="pixels"type="int"/>
<argumentindex="1"name="rect"type="Rect2"/>
<paramindex="0"name="pixels"type="int"/>
<paramindex="1"name="rect"type="Rect2"/>
<description>
Applies morphological dilation or erosion to the bitmap. If [code]pixels[/code] is positive, dilation is applied to the bitmap. If [code]pixels[/code] is negative, erosion is applied to the bitmap. [code]rect[/code] defines the area where the morphological operation is applied. Pixels located outside the [code]rect[/code] are unaffected by [method grow_mask].
Creates an [Array] of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a [PackedVector2Array] of its vertices.
To get polygons covering the whole bitmap, pass:
@ -72,23 +72,23 @@
</method>
<methodname="resize">
<returntype="void"/>
<argumentindex="0"name="new_size"type="Vector2"/>
<paramindex="0"name="new_size"type="Vector2"/>
<description>
Resizes the image to [code]new_size[/code].
</description>
</method>
<methodname="set_bit">
<returntype="void"/>
<argumentindex="0"name="position"type="Vector2"/>
<argumentindex="1"name="bit"type="bool"/>
<paramindex="0"name="position"type="Vector2"/>
<paramindex="1"name="bit"type="bool"/>
<description>
Sets the bitmap's element at the specified position, to the specified value.
</description>
</method>
<methodname="set_bit_rect">
<returntype="void"/>
<argumentindex="0"name="rect"type="Rect2"/>
<argumentindex="1"name="bit"type="bool"/>
<paramindex="0"name="rect"type="Rect2"/>
<paramindex="1"name="bit"type="bool"/>
<description>
Sets a rectangular portion of the bitmap to the specified value.
When set to [code]true[/code], the [code]Bone2D[/code] node will attempt to automatically calculate the bone angle and length using the first child [code]Bone2D[/code] node, if one exists. If none exist, the [code]Bone2D[/code] cannot automatically calculate these values and will print a warning.
</description>
</method>
<methodname="set_bone_angle">
<returntype="void"/>
<argumentindex="0"name="angle"type="float"/>
<paramindex="0"name="angle"type="float"/>
<description>
Sets the bone angle for the [code]Bone2D[/code] node. This is typically set to the rotation from the [code]Bone2D[/code] node to a child [code]Bone2D[/code] node.
[b]Note:[/b] This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
A function that is called automatically when the [Skeleton3D] the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose.
Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. The external [Skeleton3D] node is only used when [code]use_external_skeleton[/code] is set to [code]true[/code].
Sets whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to [code]true[/code], the BoneAttachment3D node can change the pose of the bone.
Sets whether the BoneAttachment3D node will use an extenral [Skeleton3D] node rather than attenpting to use its parent node as the [Skeleton3D]. When set to [code]true[/code], the BoneAttachment3D node will use the external [Skeleton3D] node set in [code]set_external_skeleton[/code].
Adds a [Control] node to the box as a spacer. If [code]begin[/code] is [code]true[/code], it will insert the [Control] node in front of all other children.
Creates a new [Callable] for the method called [code]method[/code] in the specified [code]object[/code].
</description>
@ -134,14 +134,14 @@
</method>
<methodname="rpc_id"qualifiers="vararg const">
<returntype="void"/>
<argumentindex="0"name="peer_id"type="int"/>
<paramindex="0"name="peer_id"type="int"/>
<description>
Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling it on unsupported functions will result in an error.
</description>
</method>
<methodname="unbind"qualifiers="const">
<returntype="Callable"/>
<argumentindex="0"name="argcount"type="int"/>
<paramindex="0"name="argcount"type="int"/>
<description>
Returns a copy of this [Callable] with the arguments unbound. Calling the returned [Callable] will call the method without the extra arguments that are supplied in the [Callable] on which you are calling this method.
</description>
@ -150,14 +150,14 @@
<operators>
<operatorname="operator !=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Callable"/>
<paramindex="0"name="right"type="Callable"/>
<description>
Returns [code]true[/code] if both [Callable]s invoke different targets.
</description>
</operator>
<operatorname="operator ==">
<returntype="bool"/>
<argumentindex="0"name="right"type="Callable"/>
<paramindex="0"name="right"type="Callable"/>
<description>
Returns [code]true[/code] if both [Callable]s invoke the same custom target.
Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin].
Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right].
Sets the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin].
Sets the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right].
If this is the current camera, remove it from being current. If [code]enable_next[/code] is [code]true[/code], request to make the next camera current, if any.
Returns [code]true[/code] if the given position is behind the camera (the blue part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods.
[b]Note:[/b] A position which returns [code]false[/code] may still be outside the camera's field of view.
Returns [code]true[/code] if the given position is inside the camera's frustum (the green part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods.
Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc.
Returns the 3D point in world space that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [code]z_depth[/code] distance into the scene away from the camera.
Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
</description>
</method>
<methodname="set_cull_mask_value">
<returntype="void"/>
<argumentindex="0"name="layer_number"type="int"/>
<argumentindex="1"name="value"type="bool"/>
<paramindex="0"name="layer_number"type="int"/>
<paramindex="1"name="value"type="bool"/>
<description>
Based on [code]value[/code], enables or disables the specified layer in the [member cull_mask], given a [code]layer_number[/code] between 1 and 20.
</description>
</method>
<methodname="set_frustum">
<returntype="void"/>
<argumentindex="0"name="size"type="float"/>
<argumentindex="1"name="offset"type="Vector2"/>
<argumentindex="2"name="z_near"type="float"/>
<argumentindex="3"name="z_far"type="float"/>
<paramindex="0"name="size"type="float"/>
<paramindex="1"name="offset"type="Vector2"/>
<paramindex="2"name="z_near"type="float"/>
<paramindex="3"name="z_far"type="float"/>
<description>
Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [code]size[/code], an [code]offset[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units. See also [member frustum_offset].
</description>
</method>
<methodname="set_orthogonal">
<returntype="void"/>
<argumentindex="0"name="size"type="float"/>
<argumentindex="1"name="z_near"type="float"/>
<argumentindex="2"name="z_far"type="float"/>
<paramindex="0"name="size"type="float"/>
<paramindex="1"name="z_near"type="float"/>
<paramindex="2"name="z_far"type="float"/>
<description>
Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [code]size[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.)
</description>
</method>
<methodname="set_perspective">
<returntype="void"/>
<argumentindex="0"name="fov"type="float"/>
<argumentindex="1"name="z_near"type="float"/>
<argumentindex="2"name="z_far"type="float"/>
<paramindex="0"name="fov"type="float"/>
<paramindex="1"name="z_near"type="float"/>
<paramindex="2"name="z_far"type="float"/>
<description>
Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [code]fov[/code] (field of view) angle in degrees, and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units.
Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world space.
[b]Note:[/b] When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera:
Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.
Draws a unfilled arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve. See also [method draw_circle].
Draws a colored polygon of any amount of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon.
Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_multiline] and [method draw_polyline].
Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering.
If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius.
Draws multiple disconnected lines with a uniform [code]color[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead.
Draws multiple disconnected lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead.
Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
Breaks [code]text[/code] to the lines and draws text outline using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
Draws a solid polygon of any amount of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors].
Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon].
Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon].
Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also [method draw_line], [method draw_polyline], [method draw_polygon], and [method draw_rect].
Draws a rectangle. If [code]filled[/code] is [code]true[/code], the rectangle will be filled with the [code]color[/code] specified. If [code]filled[/code] is [code]false[/code], the rectangle will be drawn as a stroke with the [code]color[/code] and [code]width[/code] specified.
[b]Note:[/b] [code]width[/code] is only effective if [code]filled[/code] is [code]false[/code].
Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
Draws [code]text[/code] outline using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
Draws a textured rectangle at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
Draws a textured rectangle region at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
Returns the floor's collision angle at the last collision point according to [code]up_direction[/code], which is [code]Vector2.UP[/code] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code].
</description>
@ -60,7 +60,7 @@
</method>
<methodname="get_slide_collision">
<returntype="KinematicCollision2D"/>
<argumentindex="0"name="slide_idx"type="int"/>
<paramindex="0"name="slide_idx"type="int"/>
<description>
Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1).
Returns the floor's collision angle at the last collision point according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code].
</description>
@ -61,7 +61,7 @@
</method>
<methodname="get_slide_collision">
<returntype="KinematicCollision3D"/>
<argumentindex="0"name="slide_idx"type="int"/>
<paramindex="0"name="slide_idx"type="int"/>
<description>
Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1).
Returns the value of the integer constant [code]name[/code] of [code]class[/code] or its ancestry. Always returns 0 when the constant could not be found.
Returns an array with all the methods of [code]class[/code] or its ancestry if [code]no_inheritance[/code] is [code]false[/code]. Every element of the array is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code].
[b]Note:[/b] In exported release builds the debug info is not available, so the returned dictionaries will contain only method names.
Returns the [code]signal[/code] data of [code]class[/code] or its ancestry. The returned value is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code].
Returns an array with all the signals of [code]class[/code] or its ancestry if [code]no_inheritance[/code] is [code]false[/code]. Every element of the array is a [Dictionary] as described in [method class_get_signal].
Returns whether [code]class[/code] (or its ancestry if [code]no_inheritance[/code] is [code]false[/code]) has a method called [code]method[/code] or not.
If [code]line[/code] [code]column[/code] is in a string or comment, returns the end position of the region. If not or no end could be found, both [Vector2] values will be [code]-1[/code].
If [code]line[/code] [code]column[/code] is in a string or comment, returns the start position of the region. If not or no start could be found, both [Vector2] values will be [code]-1[/code].
Returns delimiter index if [code]line[/code] [code]column[/code] is in a comment. If [code]column[/code] is not provided, will return delimiter index if the entire [code]line[/code] is a comment. Otherwise [code]-1[/code].
Returns the delimiter index if [code]line[/code] [code]column[/code] is in a string. If [code]column[/code] is not provided, will return the delimiter index if the entire [code]line[/code] is a string. Otherwise [code]-1[/code].
Emits [signal code_completion_requested], if [code]force[/code] is true will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path or signal.
</description>
</method>
<methodname="set_code_completion_selected_index">
<returntype="void"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Sets the current selected completion option.
</description>
</method>
<methodname="set_code_hint">
<returntype="void"/>
<argumentindex="0"name="code_hint"type="String"/>
<paramindex="0"name="code_hint"type="String"/>
<description>
Sets the code hint text. Pass an empty string to clear.
Sets the symbol emitted by [signal symbol_validate] as a valid lookup.
</description>
</method>
<methodname="toggle_foldable_line">
<returntype="void"/>
<argumentindex="0"name="line"type="int"/>
<paramindex="0"name="line"type="int"/>
<description>
Toggle the folding of the code block at the given line.
</description>
@ -415,7 +415,7 @@
</method>
<methodname="unfold_line">
<returntype="void"/>
<argumentindex="0"name="line"type="int"/>
<paramindex="0"name="line"type="int"/>
<description>
Unfolds all lines that were previously folded.
</description>
@ -428,7 +428,7 @@
</method>
<methodname="update_code_completion_options">
<returntype="void"/>
<argumentindex="0"name="force"type="bool"/>
<paramindex="0"name="force"type="bool"/>
<description>
Submits all completion options added with [method add_code_completion_option]. Will try to force the autoccomplete menu to popup, if [code]force[/code] is [code]true[/code].
[b]Note:[/b] This will replace all current candidates.
@ -501,7 +501,7 @@
</members>
<signals>
<signalname="breakpoint_toggled">
<argumentindex="0"name="line"type="int"/>
<paramindex="0"name="line"type="int"/>
<description>
Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line.
</description>
@ -512,15 +512,15 @@
</description>
</signal>
<signalname="symbol_lookup">
<argumentindex="0"name="symbol"type="String"/>
<argumentindex="1"name="line"type="int"/>
<argumentindex="2"name="column"type="int"/>
<paramindex="0"name="symbol"type="String"/>
<paramindex="1"name="line"type="int"/>
<paramindex="2"name="column"type="int"/>
<description>
Emitted when the user has clicked on a valid symbol.
</description>
</signal>
<signalname="symbol_validate">
<argumentindex="0"name="symbol"type="String"/>
<paramindex="0"name="symbol"type="String"/>
<description>
Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling [method set_symbol_lookup_word_as_valid].
Accepts unhandled [InputEvent]s. [code]shape_idx[/code] is the child index of the clicked [Shape2D]. Connect to the [code]input_event[/code] signal to easily pick up these events.
[b]Note:[/b] [method _input_event] requires [member input_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set.
@ -22,21 +22,21 @@
</method>
<methodname="create_shape_owner">
<returntype="int"/>
<argumentindex="0"name="owner"type="Object"/>
<paramindex="0"name="owner"type="Object"/>
<description>
Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
Returns [code]true[/code] if collisions for the shape owner originating from this [CollisionObject2D] will not be reported to collided with [CollisionObject2D]s.
</description>
</method>
<methodname="remove_shape_owner">
<returntype="void"/>
<argumentindex="0"name="owner_id"type="int"/>
<paramindex="0"name="owner_id"type="int"/>
<description>
Removes the given shape owner.
</description>
</method>
<methodname="set_collision_layer_value">
<returntype="void"/>
<argumentindex="0"name="layer_number"type="int"/>
<argumentindex="1"name="value"type="bool"/>
<paramindex="0"name="layer_number"type="int"/>
<paramindex="1"name="value"type="bool"/>
<description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
<methodname="set_collision_mask_value">
<returntype="void"/>
<argumentindex="0"name="layer_number"type="int"/>
<argumentindex="1"name="value"type="bool"/>
<paramindex="0"name="layer_number"type="int"/>
<paramindex="1"name="value"type="bool"/>
<description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
<methodname="shape_find_owner"qualifiers="const">
<returntype="int"/>
<argumentindex="0"name="shape_index"type="int"/>
<paramindex="0"name="shape_index"type="int"/>
<description>
Returns the [code]owner_id[/code] of the given shape.
If [code]true[/code], disables the given shape owner.
</description>
</method>
<methodname="shape_owner_set_one_way_collision">
<returntype="void"/>
<argumentindex="0"name="owner_id"type="int"/>
<argumentindex="1"name="enable"type="bool"/>
<paramindex="0"name="owner_id"type="int"/>
<paramindex="1"name="enable"type="bool"/>
<description>
If [code]enable[/code] is [code]true[/code], collisions for the shape owner originating from this [CollisionObject2D] will not be reported to collided with [CollisionObject2D]s.
Emitted when an input event occurs. Requires [member input_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set. See [method _input_event] for details.
</description>
@ -235,13 +235,13 @@
</description>
</signal>
<signalname="mouse_shape_entered">
<argumentindex="0"name="shape_idx"type="int"/>
<paramindex="0"name="shape_idx"type="int"/>
<description>
Emitted when the mouse pointer enters any of this object's shapes or moves from one shape to another. [code]shape_idx[/code] is the child index of the newly entered [Shape2D]. Requires [member input_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set.
</description>
</signal>
<signalname="mouse_shape_exited">
<argumentindex="0"name="shape_idx"type="int"/>
<paramindex="0"name="shape_idx"type="int"/>
<description>
Emitted when the mouse pointer exits any of this object's shapes. [code]shape_idx[/code] is the child index of the exited [Shape2D]. Requires [member input_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set.
Receives unhandled [InputEvent]s. [code]position[/code] is the location in world space of the mouse pointer on the surface of the shape with index [code]shape_idx[/code] and [code]normal[/code] is the normal vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up these events.
[b]Note:[/b] [method _input_event] requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set.
@ -23,21 +23,21 @@
</method>
<methodname="create_shape_owner">
<returntype="int"/>
<argumentindex="0"name="owner"type="Object"/>
<paramindex="0"name="owner"type="Object"/>
<description>
Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
If [code]true[/code], the shape owner and its shapes are disabled.
</description>
</method>
<methodname="remove_shape_owner">
<returntype="void"/>
<argumentindex="0"name="owner_id"type="int"/>
<paramindex="0"name="owner_id"type="int"/>
<description>
Removes the given shape owner.
</description>
</method>
<methodname="set_collision_layer_value">
<returntype="void"/>
<argumentindex="0"name="layer_number"type="int"/>
<argumentindex="1"name="value"type="bool"/>
<paramindex="0"name="layer_number"type="int"/>
<paramindex="1"name="value"type="bool"/>
<description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
<methodname="set_collision_mask_value">
<returntype="void"/>
<argumentindex="0"name="layer_number"type="int"/>
<argumentindex="1"name="value"type="bool"/>
<paramindex="0"name="layer_number"type="int"/>
<paramindex="1"name="value"type="bool"/>
<description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
<methodname="shape_find_owner"qualifiers="const">
<returntype="int"/>
<argumentindex="0"name="shape_index"type="int"/>
<paramindex="0"name="shape_index"type="int"/>
<description>
Returns the [code]owner_id[/code] of the given shape.
Emitted when the object receives an unhandled [InputEvent]. [code]position[/code] is the location in world space of the mouse pointer on the surface of the shape with index [code]shape_idx[/code] and [code]normal[/code] is the normal vector of the surface at that point.
Constructs a [Color] from an existing color, but with a custom alpha value.
[codeblocks]
@ -40,31 +40,31 @@
</constructor>
<constructorname="Color">
<returntype="Color"/>
<argumentindex="0"name="from"type="Color"/>
<paramindex="0"name="from"type="Color"/>
<description>
Constructs a [Color] as a copy of the given [Color].
</description>
</constructor>
<constructorname="Color">
<returntype="Color"/>
<argumentindex="0"name="code"type="String"/>
<paramindex="0"name="code"type="String"/>
<description>
Constructs a [Color] either from an HTML color code or from a standardized color name. Supported color names are the same as the constants.
</description>
</constructor>
<constructorname="Color">
<returntype="Color"/>
<argumentindex="0"name="code"type="String"/>
<argumentindex="1"name="alpha"type="float"/>
<paramindex="0"name="code"type="String"/>
<paramindex="1"name="alpha"type="float"/>
<description>
Constructs a [Color] either from an HTML color code or from a standardized color name, with [code]alpha[/code] on the range of 0 to 1. Supported color names are the same as the constants.
</description>
</constructor>
<constructorname="Color">
<returntype="Color"/>
<argumentindex="0"name="r"type="float"/>
<argumentindex="1"name="g"type="float"/>
<argumentindex="2"name="b"type="float"/>
<paramindex="0"name="r"type="float"/>
<paramindex="1"name="g"type="float"/>
<paramindex="2"name="b"type="float"/>
<description>
Constructs a [Color] from RGB values, typically between 0 and 1. Alpha will be 1.
[codeblocks]
@ -79,10 +79,10 @@
</constructor>
<constructorname="Color">
<returntype="Color"/>
<argumentindex="0"name="r"type="float"/>
<argumentindex="1"name="g"type="float"/>
<argumentindex="2"name="b"type="float"/>
<argumentindex="3"name="a"type="float"/>
<paramindex="0"name="r"type="float"/>
<paramindex="1"name="g"type="float"/>
<paramindex="2"name="b"type="float"/>
<paramindex="3"name="a"type="float"/>
<description>
Constructs a [Color] from RGBA values, typically between 0 and 1.
[codeblocks]
@ -99,7 +99,7 @@
<methods>
<methodname="blend"qualifiers="const">
<returntype="Color"/>
<argumentindex="0"name="over"type="Color"/>
<paramindex="0"name="over"type="Color"/>
<description>
Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values.
Returns a new color with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component.
</description>
</method>
<methodname="darkened"qualifiers="const">
<returntype="Color"/>
<argumentindex="0"name="amount"type="float"/>
<paramindex="0"name="amount"type="float"/>
<description>
Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1).
Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. [code]h[/code] (hue), [code]s[/code] (saturation), and [code]v[/code] (value) are typically between 0 and 1.
Constructs a color from an [url=https://bottosson.github.io/posts/colorpicker/]OK HSL profile[/url]. [code]h[/code] (hue), [code]s[/code] (saturation), and [code]v[/code] (value) are typically between 0 and 1.
Returns a new color from [code]rgba[/code], an HTML hexadecimal color string. [code]rgba[/code] is not case sensitive, and may be prefixed with a '#' character.
[code]rgba[/code] must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If [code]rgba[/code] does not contain an alpha channel value, an alpha channel value of 1.0 is applied.
@ -255,7 +255,7 @@
</method>
<methodname="html_is_valid"qualifiers="static">
<returntype="bool"/>
<argumentindex="0"name="color"type="String"/>
<paramindex="0"name="color"type="String"/>
<description>
Returns [code]true[/code] if [code]color[/code] is a valid HTML hexadecimal color string. [code]color[/code] is not case sensitive, and may be prefixed with a '#' character.
For a string to be valid it must be three-digit or six-digit hexadecimal, and may contain an alpha channel value.
@ -297,15 +297,15 @@
</method>
<methodname="is_equal_approx"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="to"type="Color"/>
<paramindex="0"name="to"type="Color"/>
<description>
Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<methodname="lerp"qualifiers="const">
<returntype="Color"/>
<argumentindex="0"name="to"type="Color"/>
<argumentindex="1"name="weight"type="float"/>
<paramindex="0"name="to"type="Color"/>
<paramindex="1"name="weight"type="float"/>
<description>
Returns the linear interpolation with another color. The interpolation factor [code]weight[/code] is between 0 and 1.
[codeblocks]
@ -324,7 +324,7 @@
</method>
<methodname="lightened"qualifiers="const">
<returntype="Color"/>
<argumentindex="0"name="amount"type="float"/>
<paramindex="0"name="amount"type="float"/>
<description>
Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1).
Returns the color converted to an HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]).
Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string (and uses RGB instead of RGBA format).
@ -946,7 +946,7 @@
<operators>
<operatorname="operator !=">
<returntype="bool"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Returns [code]true[/code] if the colors are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
@ -954,63 +954,63 @@
</operator>
<operatorname="operator *">
<returntype="Color"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Multiplies each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operatorname="operator *">
<returntype="Color"/>
<argumentindex="0"name="right"type="float"/>
<paramindex="0"name="right"type="float"/>
<description>
Multiplies each component of the [Color] by the given [float].
</description>
</operator>
<operatorname="operator *">
<returntype="Color"/>
<argumentindex="0"name="right"type="int"/>
<paramindex="0"name="right"type="int"/>
<description>
Multiplies each component of the [Color] by the given [int].
</description>
</operator>
<operatorname="operator +">
<returntype="Color"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Adds each component of the [Color] with the components of the given [Color].
</description>
</operator>
<operatorname="operator -">
<returntype="Color"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Subtracts each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operatorname="operator /">
<returntype="Color"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Divides each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operatorname="operator /">
<returntype="Color"/>
<argumentindex="0"name="right"type="float"/>
<paramindex="0"name="right"type="float"/>
<description>
Divides each component of the [Color] by the given [float].
</description>
</operator>
<operatorname="operator /">
<returntype="Color"/>
<argumentindex="0"name="right"type="int"/>
<paramindex="0"name="right"type="int"/>
<description>
Divides each component of the [Color] by the given [int].
</description>
</operator>
<operatorname="operator ==">
<returntype="bool"/>
<argumentindex="0"name="right"type="Color"/>
<paramindex="0"name="right"type="Color"/>
<description>
Returns [code]true[/code] if the colors are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
@ -1018,7 +1018,7 @@
</operator>
<operatorname="operator []">
<returntype="float"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Access color components using their index. [code]c[0][/code] is equivalent to [code]c.r[/code], [code]c[1][/code] is equivalent to [code]c.g[/code], [code]c[2][/code] is equivalent to [code]c.b[/code], and [code]c[3][/code] is equivalent to [code]c.a[/code].
Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback [code]default[/code] value. If [code]default[/code] is not specified or set to [code]null[/code], an error is also raised.
</description>
</method>
<methodname="has_section"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="section"type="String"/>
<paramindex="0"name="section"type="String"/>
<description>
Returns [code]true[/code] if the specified section exists.
</description>
</method>
<methodname="has_section_key"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="section"type="String"/>
<argumentindex="1"name="key"type="String"/>
<paramindex="0"name="section"type="String"/>
<paramindex="1"name="key"type="String"/>
<description>
Returns [code]true[/code] if the specified section-key pair exists.
</description>
@ -154,7 +154,7 @@
<returntype="int"enum="Error"/>
<returns_errornumber="0"/>
<returns_errornumber="12"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Loads the config file specified as a parameter. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
Loads the encrypted config file specified as a parameter, using the provided [code]key[/code] to decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -171,8 +171,8 @@
</method>
<methodname="load_encrypted_pass">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<argumentindex="1"name="password"type="String"/>
<paramindex="0"name="path"type="String"/>
<paramindex="1"name="password"type="String"/>
<description>
Loads the encrypted config file specified as a parameter, using the provided [code]password[/code] to decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -180,7 +180,7 @@
</method>
<methodname="parse">
<returntype="int"enum="Error"/>
<argumentindex="0"name="data"type="String"/>
<paramindex="0"name="data"type="String"/>
<description>
Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -188,7 +188,7 @@
</method>
<methodname="save">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Saves the contents of the [ConfigFile] object to the file specified as a parameter. The output file uses an INI-style structure.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [code]key[/code] to encrypt it. The output file uses an INI-style structure.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -205,8 +205,8 @@
</method>
<methodname="save_encrypted_pass">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<argumentindex="1"name="password"type="String"/>
<paramindex="0"name="path"type="String"/>
<paramindex="1"name="password"type="String"/>
<description>
Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [code]password[/code] to encrypt it. The output file uses an INI-style structure.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -214,9 +214,9 @@
</method>
<methodname="set_value">
<returntype="void"/>
<argumentindex="0"name="section"type="String"/>
<argumentindex="1"name="key"type="String"/>
<argumentindex="2"name="value"type="Variant"/>
<paramindex="0"name="section"type="String"/>
<paramindex="1"name="key"type="String"/>
<paramindex="2"name="value"type="Variant"/>
<description>
Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a [code]null[/code] value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed.
Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control.
This method should only be used to test the data. Process the data in [method _drop_data].
Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control.
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag].
A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
@ -107,7 +107,7 @@
</method>
<methodname="_gui_input"qualifiers="virtual">
<returntype="void"/>
<argumentindex="0"name="event"type="InputEvent"/>
<paramindex="0"name="event"type="InputEvent"/>
<description>
Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property.
The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead.
Returns [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately.
@ -212,8 +212,8 @@
</method>
<methodname="add_theme_color_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<argumentindex="1"name="color"type="Color"/>
<paramindex="0"name="name"type="StringName"/>
<paramindex="1"name="color"type="Color"/>
<description>
Creates a local override for a theme [Color] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override].
See also [method get_theme_color].
@ -240,8 +240,8 @@
</method>
<methodname="add_theme_constant_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<argumentindex="1"name="constant"type="int"/>
<paramindex="0"name="name"type="StringName"/>
<paramindex="1"name="constant"type="int"/>
<description>
Creates a local override for a theme constant with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_constant_override].
See also [method get_theme_constant].
@ -249,8 +249,8 @@
</method>
<methodname="add_theme_font_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<argumentindex="1"name="font"type="Font"/>
<paramindex="0"name="name"type="StringName"/>
<paramindex="1"name="font"type="Font"/>
<description>
Creates a local override for a theme [Font] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_override].
See also [method get_theme_font].
@ -258,8 +258,8 @@
</method>
<methodname="add_theme_font_size_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<argumentindex="1"name="font_size"type="int"/>
<paramindex="0"name="name"type="StringName"/>
<paramindex="1"name="font_size"type="int"/>
<description>
Creates a local override for a theme font size with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_size_override].
Creates a local override for a theme icon with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_icon_override].
Creates a local override for a theme [StyleBox] with the specified [code]name[/code]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override].
See also [method get_theme_stylebox].
@ -334,8 +334,8 @@
</method>
<methodname="force_drag">
<returntype="void"/>
<argumentindex="0"name="data"type="Variant"/>
<argumentindex="1"name="preview"type="Control"/>
<paramindex="0"name="data"type="Variant"/>
<paramindex="1"name="preview"type="Control"/>
<description>
Forces drag and bypasses [method _get_drag_data] and [method set_drag_preview] by passing [code]data[/code] and [code]preview[/code]. Drag will start even if the mouse is neither over nor pressed on this control.
The methods [method _can_drop_data] and [method _drop_data] must be implemented on controls that want to receive drop data.
Returns the anchor for the specified [enum Side]. A getter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
Returns the focus neighbor for the specified [enum Side]. A getter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [code]name[/code] and [code]theme_type[/code]. If [code]theme_type[/code] is omitted the class name of the current control is used as the type, or [member theme_type_variation] if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked.
For the current control its local overrides are considered first (see [method add_theme_color_override]), then its assigned [member theme]. After the current control, each parent control and its assigned [member theme] are considered; controls without a [member theme] assigned are skipped. If no matching [Theme] is found in the tree, a custom project [Theme] (see [member ProjectSettings.gui/theme/custom]) and the default [Theme] are used.
Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a [Font] from the first matching [Theme] in the tree if that [Theme] has a font item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a font size from the first matching [Theme] in the tree if that [Theme] has a font size item with the specified [code]name[/code] and [code]theme_type[/code].
Returns an icon from the first matching [Theme] in the tree if that [Theme] has an icon item with the specified [code]name[/code] and [code]theme_type[/code].
Returns a [StyleBox] from the first matching [Theme] in the tree if that [Theme] has a stylebox item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a color item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a constant item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font size item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has an icon item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a stylebox item with the specified [code]name[/code] and [code]theme_type[/code].
Returns [code]true[/code] if there is a local override for a theme [StyleBox] with the specified [code]name[/code] in this [Control] node.
See [method add_theme_stylebox_override].
@ -683,42 +683,42 @@
</method>
<methodname="remove_theme_color_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme [Color] with the specified [code]name[/code] previously added by [method add_theme_color_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_constant_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme constant with the specified [code]name[/code] previously added by [method add_theme_constant_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_font_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme [Font] with the specified [code]name[/code] previously added by [method add_theme_font_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_font_size_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme font size with the specified [code]name[/code] previously added by [method add_theme_font_size_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_icon_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme icon with the specified [code]name[/code] previously added by [method add_theme_icon_override] or via the Inspector dock.
</description>
</method>
<methodname="remove_theme_stylebox_override">
<returntype="void"/>
<argumentindex="0"name="name"type="StringName"/>
<paramindex="0"name="name"type="StringName"/>
<description>
Removes a local override for a theme [StyleBox] with the specified [code]name[/code] previously added by [method add_theme_stylebox_override] or via the Inspector dock.
Sets the anchor for the specified [enum Side] to [code]anchor[/code]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
If [code]keep_offset[/code] is [code]true[/code], offsets aren't updated after this operation.
Works the same as [method set_anchor], but instead of [code]keep_offset[/code] argument and automatic update of offset, it allows to set the offset yourself (see [method set_offset]).
Sets the anchors to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor.
If [code]keep_offsets[/code] is [code]true[/code], control's position will also be updated.
@ -771,14 +771,14 @@
</method>
<methodname="set_begin">
<returntype="void"/>
<argumentindex="0"name="position"type="Vector2"/>
<paramindex="0"name="position"type="Vector2"/>
<description>
Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member position].
</description>
</method>
<methodname="set_drag_forwarding">
<returntype="void"/>
<argumentindex="0"name="target"type="Object"/>
<paramindex="0"name="target"type="Object"/>
<description>
Forwards the handling of this control's drag and drop to [code]target[/code] object.
Forwarding can be implemented in the target object similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences:
@ -843,7 +843,7 @@
</method>
<methodname="set_drag_preview">
<returntype="void"/>
<argumentindex="0"name="control"type="Control"/>
<paramindex="0"name="control"type="Control"/>
<description>
Shows the given control at the mouse pointer. A good time to call this method is in [method _get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended.
[codeblocks]
@ -877,23 +877,23 @@
</method>
<methodname="set_end">
<returntype="void"/>
<argumentindex="0"name="position"type="Vector2"/>
<paramindex="0"name="position"type="Vector2"/>
<description>
Sets [member offset_right] and [member offset_bottom] at the same time.
Sets the anchor for the specified [enum Side] to the [Control] at [code]neighbor[/code] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
Sets the offset for the specified [enum Side] to [code]offset[/code]. A setter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
Sets the offsets to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor.
Use parameter [code]resize_mode[/code] with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the [Control]. Constant size will be ignored if used with presets that change size, e.g. [code]PRESET_LEFT_WIDE[/code].
Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry2D.convex_hull] for details.
Compares two [PackedByteArray]s for equality without leaking timing information in order to prevent timing attacks.
See [url=https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy]this blog post[/url] for more information.
Generates a self-signed [X509Certificate] from the given [CryptoKey] and [code]issuer_name[/code]. The certificate validity will be defined by [code]not_before[/code] and [code]not_after[/code] (first valid date and last valid date). The [code]issuer_name[/code] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in).
A small example to generate an RSA key and a X509 self-signed certificate.
Generates an [url=https://en.wikipedia.org/wiki/HMAC]HMAC[/url] digest of [code]msg[/code] using [code]key[/code]. The [code]hash_type[/code] parameter is the hashing algorithm that is used for the inner and outer hashes.
Currently, only [constant HashingContext.HASH_SHA256] and [constant HashingContext.HASH_SHA1] are supported.
Adds a point to the curve. For each side, if the [code]*_mode[/code] is [constant TANGENT_LINEAR], the [code]*_tangent[/code] angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is set to [constant TANGENT_FREE].
Returns the Y value for the point that would exist at the X position [code]offset[/code] along the curve using the baked cache. Bakes the curve's points if not already baked.
</description>
</method>
<methodname="remove_point">
<returntype="void"/>
<argumentindex="0"name="index"type="int"/>
<paramindex="0"name="index"type="int"/>
<description>
Removes the point at [code]index[/code] from the curve.
Adds a point to a curve at [code]position[/code] relative to the [Curve2D]'s position, with control points [code]in[/code] and [code]out[/code].
If [code]at_position[/code] is given, the point is inserted before the point number [code]at_position[/code], moving that point (and every point after) after the inserted point. If [code]at_position[/code] is not given, or is an illegal value ([code]at_position <0[/code] or [code]at_position >= [method get_point_count][/code]), the point will be appended at the end of the point list.
Returns the closest baked point (in curve's local space) to [code]to_point[/code].
[code]to_point[/code] must be in this curve's local space.
@ -57,29 +57,29 @@
</method>
<methodname="get_point_in"qualifiers="const">
<returntype="Vector2"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<methodname="get_point_out"qualifiers="const">
<returntype="Vector2"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
Returns the position of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<methodname="interpolate"qualifiers="const">
<returntype="Vector2"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="t"type="float"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="t"type="float"/>
<description>
Returns the position between the vertex [code]idx[/code] and the vertex [code]idx + 1[/code], where [code]t[/code] controls if the point is the first vertex ([code]t = 0.0[/code]), the last vertex ([code]t = 1.0[/code]), or in between. Values of [code]t[/code] outside the range ([code]0.0 >= t <=1[/code]) give strange, but predictable results.
If [code]idx[/code] is out of bounds it is truncated to the first or last vertex, and [code]t[/code] is ignored. If the curve has no points, the function sends an error to the console, and returns [code](0, 0)[/code].
Returns a point within the curve at position [code]offset[/code], where [code]offset[/code] is measured as a pixel distance along the curve.
To do that, it finds the two cached points where the [code]offset[/code] lies between, then interpolates the values. This interpolation is cubic if [code]cubic[/code] is set to [code]true[/code], or linear if set to [code]false[/code].
@ -97,46 +97,46 @@
</method>
<methodname="interpolatef"qualifiers="const">
<returntype="Vector2"/>
<argumentindex="0"name="fofs"type="float"/>
<paramindex="0"name="fofs"type="float"/>
<description>
Returns the position at the vertex [code]fofs[/code]. It calls [method interpolate] using the integer part of [code]fofs[/code] as [code]idx[/code], and its fractional part as [code]t[/code].
</description>
</method>
<methodname="remove_point">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Deletes the point [code]idx[/code] from the curve. Sends an error to the console if [code]idx[/code] is out of bounds.
</description>
</method>
<methodname="set_point_in">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector2"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector2"/>
<description>
Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<methodname="set_point_out">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector2"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector2"/>
<description>
Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<methodname="set_point_position">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector2"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector2"/>
<description>
Sets the position for the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
Adds a point to a curve at [code]position[/code] relative to the [Curve3D]'s position, with control points [code]in[/code] and [code]out[/code].
If [code]at_position[/code] is given, the point is inserted before the point number [code]at_position[/code], moving that point (and every point after) after the inserted point. If [code]at_position[/code] is not given, or is an illegal value ([code]at_position <0[/code] or [code]at_position >= [method get_point_count][/code]), the point will be appended at the end of the point list.
Returns the closest offset to [code]to_point[/code]. This offset is meant to be used in [method interpolate_baked] or [method interpolate_baked_up_vector].
[code]to_point[/code] must be in this curve's local space.
Returns the closest baked point (in curve's local space) to [code]to_point[/code].
[code]to_point[/code] must be in this curve's local space.
@ -70,36 +70,36 @@
</method>
<methodname="get_point_in"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<methodname="get_point_out"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
Returns the position of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<methodname="get_point_tilt"qualifiers="const">
<returntype="float"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the tilt angle in radians for the point [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code]0[/code].
</description>
</method>
<methodname="interpolate"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="t"type="float"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="t"type="float"/>
<description>
Returns the position between the vertex [code]idx[/code] and the vertex [code]idx + 1[/code], where [code]t[/code] controls if the point is the first vertex ([code]t = 0.0[/code]), the last vertex ([code]t = 1.0[/code]), or in between. Values of [code]t[/code] outside the range ([code]0.0 >= t <=1[/code]) give strange, but predictable results.
If [code]idx[/code] is out of bounds it is truncated to the first or last vertex, and [code]t[/code] is ignored. If the curve has no points, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
Returns a point within the curve at position [code]offset[/code], where [code]offset[/code] is measured as a distance in 3D units along the curve.
To do that, it finds the two cached points where the [code]offset[/code] lies between, then interpolates the values. This interpolation is cubic if [code]cubic[/code] is set to [code]true[/code], or linear if set to [code]false[/code].
Returns an up vector within the curve at position [code]offset[/code], where [code]offset[/code] is measured as a distance in 3D units along the curve.
To do that, it finds the two cached up vectors where the [code]offset[/code] lies between, then interpolates the values. If [code]apply_tilt[/code] is [code]true[/code], an interpolated tilt is applied to the interpolated up vector.
@ -127,46 +127,46 @@
</method>
<methodname="interpolatef"qualifiers="const">
<returntype="Vector3"/>
<argumentindex="0"name="fofs"type="float"/>
<paramindex="0"name="fofs"type="float"/>
<description>
Returns the position at the vertex [code]fofs[/code]. It calls [method interpolate] using the integer part of [code]fofs[/code] as [code]idx[/code], and its fractional part as [code]t[/code].
</description>
</method>
<methodname="remove_point">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Deletes the point [code]idx[/code] from the curve. Sends an error to the console if [code]idx[/code] is out of bounds.
</description>
</method>
<methodname="set_point_in">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector3"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector3"/>
<description>
Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<methodname="set_point_out">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector3"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector3"/>
<description>
Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<methodname="set_point_position">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="position"type="Vector3"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="position"type="Vector3"/>
<description>
Sets the position for the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
</description>
</method>
<methodname="set_point_tilt">
<returntype="void"/>
<argumentindex="0"name="idx"type="int"/>
<argumentindex="1"name="tilt"type="float"/>
<paramindex="0"name="idx"type="int"/>
<paramindex="1"name="tilt"type="float"/>
<description>
Sets the tilt angle in radians for the point [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [PathFollow3D], this tilt is an offset over the natural tilt the [PathFollow3D] calculates.
Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
Setup the DTLS server to use the given [code]private_key[/code] and provide the given [code]certificate[/code] to clients. You can pass the optional [code]chain[/code] parameter to provide additional CA chain information along with the certificate.
Try to initiate the DTLS handshake with the given [code]udp_peer[/code] which must be already connected (see [method PacketPeerUDP.connect_to_host]).
[b]Note:[/b] You must check that the state of the return PacketPeerUDP is [constant PacketPeerDTLS.STATUS_HANDSHAKING], as it is normal that 50% of the new connections will be invalid due to cookie exchange.
Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)[/code], use [code]albedo_tex = $Decal.texture_albedo[/code].
Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)[/code], use [code]$Decal.texture_albedo = albedo_tex[/code].
Creates a copy of the dictionary, and returns it. The [code]deep[/code] parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects.
</description>
</method>
<methodname="erase">
<returntype="bool"/>
<argumentindex="0"name="key"type="Variant"/>
<paramindex="0"name="key"type="Variant"/>
<description>
Erase a dictionary key/value pair by key. Returns [code]true[/code] if the given key was present in the dictionary, [code]false[/code] otherwise.
[b]Note:[/b] Don't erase elements while iterating over the dictionary. You can iterate over the [method keys] array instead.
Returns the current value for the specified key in the [Dictionary]. If the key does not exist, the method returns the value of the optional default argument, or [code]null[/code] if it is omitted.
</description>
</method>
<methodname="has"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="key"type="Variant"/>
<paramindex="0"name="key"type="Variant"/>
<description>
Returns [code]true[/code] if the dictionary has a given key.
[b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
@ -251,7 +251,7 @@
</method>
<methodname="has_all"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="keys"type="Array"/>
<paramindex="0"name="keys"type="Array"/>
<description>
Returns [code]true[/code] if the dictionary has all the keys in the given array.
Adds elements from [code]dictionary[/code] to this [Dictionary]. By default, duplicate keys will not be copied over, unless [code]overwrite[/code] is [code]true[/code].
Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. [code]newdir[/code] or [code]../newdir[/code]), or an absolute path (e.g. [code]/tmp/newdir[/code] or [code]res://somedir/newdir[/code]).
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -67,8 +67,8 @@
</method>
<methodname="copy">
<returntype="int"enum="Error"/>
<argumentindex="0"name="from"type="String"/>
<argumentindex="1"name="to"type="String"/>
<paramindex="0"name="from"type="String"/>
<paramindex="1"name="to"type="String"/>
<description>
Copies the [code]from[/code] file to the [code]to[/code] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -82,7 +82,7 @@
</method>
<methodname="dir_exists">
<returntype="bool"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path.
If the [Directory] is not open, the path is relative to [code]res://[/code].
@ -90,7 +90,7 @@
</method>
<methodname="file_exists">
<returntype="bool"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path.
If the [Directory] is not open, the path is relative to [code]res://[/code].
@ -117,7 +117,7 @@
</method>
<methodname="get_drive">
<returntype="String"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
On Windows, returns the name of the drive (partition) passed as an argument (e.g. [code]C:[/code]).
On macOS, returns the path to the mounted volume passed as an argument.
@ -170,7 +170,7 @@
</method>
<methodname="make_dir">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see [method make_dir_recursive]).
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -178,7 +178,7 @@
</method>
<methodname="make_dir_recursive">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Creates a target directory and all necessary intermediate directories in its path, by calling [method make_dir] recursively. The argument can be relative to the current directory, or an absolute path.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -186,7 +186,7 @@
</method>
<methodname="open">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Opens an existing directory of the filesystem. The [code]path[/code] argument can be within the project tree ([code]res://folder[/code]), the user directory ([code]user://folder[/code]) or an absolute path of the user filesystem (e.g. [code]/tmp/folder[/code] or [code]C:\tmp\folder[/code]).
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
@ -194,7 +194,7 @@
</method>
<methodname="remove">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Permanently deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail.
If you don't want to delete the file/directory permanently, use [method OS.move_to_trash] instead.
@ -203,8 +203,8 @@
</method>
<methodname="rename">
<returntype="int"enum="Error"/>
<argumentindex="0"name="from"type="String"/>
<argumentindex="1"name="to"type="String"/>
<paramindex="0"name="from"type="String"/>
<paramindex="1"name="to"type="String"/>
<description>
Renames (move) the [code]from[/code] file or directory to the [code]to[/code] destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten.
Returns one of the [enum Error] code constants ([code]OK[/code] on success).
Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable.
Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code].
@ -48,15 +48,15 @@
</method>
<methodname="send_message">
<returntype="void"/>
<argumentindex="0"name="message"type="String"/>
<argumentindex="1"name="data"type="Array"/>
<paramindex="0"name="message"type="String"/>
<paramindex="1"name="data"type="Array"/>
<description>
Sends a message with given [code]message[/code] and [code]data[/code] array.
Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. [code]features[/code] is the list of features for the export, [code]is_debug[/code] is [code]true[/code] for debug builds, [code]path[/code] is the target path for the exported project. [code]flags[/code] is only used when running a runnable profile, e.g. when using native run on Android.
Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. [code]path[/code] is the path of the file, [code]type[/code] is the [Resource] represented by the file (e.g. [PackedScene]) and [code]features[/code] is the list of features for the export.
Calling [method skip] inside this callback will make the file not included in the export.
Adds a custom file to be exported. [code]path[/code] is the virtual path that can be used to load the file, [code]file[/code] is the binary data of the file. If [code]remap[/code] is [code]true[/code], file will not be exported, but instead remapped to the given [code]path[/code].
</description>
</method>
<methodname="add_ios_bundle_file">
<returntype="void"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Adds an iOS bundle file from the given [code]path[/code] to the exported project.
</description>
</method>
<methodname="add_ios_cpp_code">
<returntype="void"/>
<argumentindex="0"name="code"type="String"/>
<paramindex="0"name="code"type="String"/>
<description>
Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
</description>
</method>
<methodname="add_ios_embedded_framework">
<returntype="void"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary.
[b]Note:[/b] For static libraries (*.a) works in same way as [code]add_ios_framework[/code].
@ -70,35 +70,35 @@
</method>
<methodname="add_ios_framework">
<returntype="void"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Adds a static library (*.a) or dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project.
Returns [code]true[/code] if the class specified by [code]class_name[/code] is disabled. When disabled, the class won't appear in the Create New Node dialog.
Returns [code]true[/code] if editing for the class specified by [code]class_name[/code] 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 [code]property[/code] is disabled in the class specified by [code]class_name[/code]. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by [code]class_name[/code].
Returns [code]true[/code] if the [code]feature[/code] is disabled. When a feature is disabled, it will disappear from the editor entirely.
</description>
</method>
<methodname="load_from_file">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Loads an editor feature profile from a file. The file must follow the JSON format obtained by using the feature profile manager's [b]Export[/b] button or the [method save_to_file] method.
</description>
</method>
<methodname="save_to_file">
<returntype="int"enum="Error"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's [b]Import[/b] button or the [method load_from_file] method.
If [code]disable[/code] is [code]true[/code], disables the class specified by [code]class_name[/code]. When disabled, the class won't appear in the Create New Node dialog.
If [code]disable[/code] is [code]true[/code], disables editing for the class specified by [code]class_name[/code]. 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 [code]disable[/code] is [code]true[/code], disables editing for [code]property[/code] in the class specified by [code]class_name[/code]. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by [code]class_name[/code].
If [code]disable[/code] is [code]true[/code], disables the editor feature specified in [code]feature[/code]. When a feature is disabled, it will disappear from the editor entirely.
Adds a comma-delimited file name [code]filter[/code] option to the [EditorFileDialog] with an optional [code]description[/code], which restricts what files can be picked.
A [code]filter[/code] should be of the form [code]"filename.extension"[/code], where filename and extension can be [code]*[/code] to match any string. Filters starting with [code].[/code] (i.e. empty filenames) are not allowed.
Returns the resource type of the file, given the full path. This returns a string such as [code]"Resource"[/code] or [code]"GDScript"[/code], [i]not[/i] a file extension such as [code]".gd"[/code].
</description>
@ -25,7 +25,7 @@
</method>
<methodname="get_filesystem_path">
<returntype="EditorFileSystemDirectory"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Returns a view into the filesystem at [code]path[/code].
Reimports a set of files. Call this if these files or their [code].import[/code] files were directly edited by script or an external program.
If the file type changed or the file was newly created, use [method update_file] or [method scan].
@ -65,7 +65,7 @@
</method>
<methodname="update_file">
<returntype="void"/>
<argumentindex="0"name="path"type="String"/>
<paramindex="0"name="path"type="String"/>
<description>
Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program.
This will not import the file. To reimport, call [method reimport_files] or [method scan] methods.
Returns the base class of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
Returns the name of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
</description>
</method>
<methodname="get_file_type"qualifiers="const">
<returntype="StringName"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the resource type of the file at index [code]idx[/code]. This returns a string such as [code]"Resource"[/code] or [code]"GDScript"[/code], [i]not[/i] a file extension such as [code]".gd"[/code].
</description>
@ -91,7 +91,7 @@
</method>
<methodname="get_subdir">
<returntype="EditorFileSystemDirectory"/>
<argumentindex="0"name="idx"type="int"/>
<paramindex="0"name="idx"type="int"/>
<description>
Returns the subdirectory at index [code]idx[/code].
Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: [code]name[/code], [code]default_value[/code], [code]property_hint[/code] (optional), [code]hint_string[/code] (optional), [code]usage[/code] (optional).
This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
Imports [code]source_file[/code] into [code]save_path[/code] with the import [code]options[/code] specified. The [code]platform_variants[/code] and [code]gen_files[/code] arrays will be modified by this function.
This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method.
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>
<signalname="property_deleted">
<argumentindex="0"name="property"type="String"/>
<paramindex="0"name="property"type="String"/>
<description>
Emitted when a property is removed from the inspector.
</description>
</signal>
<signalname="property_edited">
<argumentindex="0"name="property"type="String"/>
<paramindex="0"name="property"type="String"/>
<description>
Emitted when a property is edited in the inspector.
</description>
</signal>
<signalname="property_keyed">
<argumentindex="0"name="property"type="String"/>
<argumentindex="1"name="value"type="Variant"/>
<argumentindex="2"name="advance"type="bool"/>
<paramindex="0"name="property"type="String"/>
<paramindex="1"name="value"type="Variant"/>
<paramindex="2"name="advance"type="bool"/>
<description>
Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled.
</description>
</signal>
<signalname="property_selected">
<argumentindex="0"name="property"type="String"/>
<paramindex="0"name="property"type="String"/>
<description>
Emitted when a property is selected in the inspector.
</description>
</signal>
<signalname="property_toggled">
<argumentindex="0"name="property"type="String"/>
<argumentindex="1"name="checked"type="bool"/>
<paramindex="0"name="property"type="String"/>
<paramindex="1"name="checked"type="bool"/>
<description>
Emitted when a boolean property is toggled in the inspector.
[b]Note:[/b] This signal is never emitted if the internal [code]autoclear[/code] property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself.
Called to allow adding property-specific editors to the property list for [code]object[/code]. The added editor control must extend [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
</description>
</method>
<methodname="add_custom_control">
<returntype="void"/>
<argumentindex="0"name="control"type="Control"/>
<paramindex="0"name="control"type="Control"/>
<description>
Adds a custom control, which is not necessarily a property editor.
Edits the given [Script]. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor.
Shows the given property on the given [code]object[/code] in the editor's Inspector dock. If [code]inspector_only[/code] is [code]true[/code], plugins will not attempt to edit [code]object[/code].
Selects the file, with the path provided by [code]file[/code], in the FileSystem dock.
</description>
</method>
<methodname="set_main_screen_editor">
<returntype="void"/>
<argumentindex="0"name="name"type="String"/>
<paramindex="0"name="name"type="String"/>
<description>
Sets the editor's current main screen to the one specified in [code]name[/code]. [code]name[/code] must match the text of the tab in question exactly ([code]2D[/code], [code]3D[/code], [code]Script[/code], [code]AssetLib[/code]).
</description>
</method>
<methodname="set_plugin_enabled">
<returntype="void"/>
<argumentindex="0"name="plugin"type="String"/>
<argumentindex="1"name="enabled"type="bool"/>
<paramindex="0"name="plugin"type="String"/>
<paramindex="1"name="enabled"type="bool"/>
<description>
Sets the enabled status of a plugin. The plugin name is the same as its directory name.
Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action.
Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action.
Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]). Handles can be named for reference to the user when editing.
The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle].
The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_subgizmos].
Override this method to return [code]true[/code] whenever the given handle should be highlighted in the editor.
The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
@ -73,10 +73,10 @@
</method>
<methodname="_set_handle"qualifiers="virtual">
<returntype="void"/>
<argumentindex="0"name="id"type="int"/>
<argumentindex="1"name="secondary"type="bool"/>
<argumentindex="2"name="camera"type="Camera3D"/>
<argumentindex="3"name="point"type="Vector2"/>
<paramindex="0"name="id"type="int"/>
<paramindex="1"name="secondary"type="bool"/>
<paramindex="2"name="camera"type="Camera3D"/>
<paramindex="3"name="point"type="Vector2"/>
<description>
Override this method to update the node properties when the user drags a gizmo handle (previously added with [method add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts.
The [code]secondary[/code] argument is [code]true[/code] when the edited handle is secondary (see [method add_handles] for more information).
Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system.
Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos].
Override this method to allow selecting subgizmos using mouse clicks. Given a [code]camera[/code] and a [code]point[/code] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos].
Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this method during [method _redraw].
Adds a list of handles (points) which can be used to edit the properties of the gizmo's Node3D. The [code]ids[/code] argument can be used to specify a custom identifier for each handle, if an empty [code]Array[/code] is passed, the ids will be assigned automatically from the [code]handles[/code] argument order.
The [code]secondary[/code] argument marks the added handles as secondary, meaning they will normally have less selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection.
Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during [method _redraw].
Adds a mesh to the gizmo with the specified [code]material[/code], local [code]transform[/code] and [code]skeleton[/code]. Call this method during [method _redraw].