diff options
Diffstat (limited to 'doc/classes/@GDScript.xml')
-rw-r--r-- | doc/classes/@GDScript.xml | 80 |
1 files changed, 67 insertions, 13 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index 7b4b3e43ba..63b9ef13fd 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@GDScript" category="Core" version="3.1"> +<class name="@GDScript" category="Core" version="3.2"> <brief_description> Built-in GDScript functions. </brief_description> @@ -8,8 +8,6 @@ </description> <tutorials> </tutorials> - <demos> - </demos> <methods> <method name="Color8"> <return type="Color"> @@ -94,7 +92,7 @@ <argument index="0" name="condition" type="bool"> </argument> <description> - Assert that the [code]condition[/code] is true. If the [code]condition[/code] is false a fatal error is generated and the program is halted. Useful for debugging to make sure a value is always true. + Assert that the [code]condition[/code] is [code]true[/code] . If the [code]condition[/code] is [code]false[/code] a fatal error is generated and the program is halted. Useful for debugging to make sure a value is always [code]true[/code]. [codeblock] # Speed should always be between 0 and 20 speed = -10 @@ -127,7 +125,7 @@ <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. [codeblock] - a = atan(0, -1) # a is 3.141593 + a = atan2(0, -1) # a is 3.141593 [/codeblock] </description> </method> @@ -136,8 +134,11 @@ </return> <argument index="0" name="bytes" type="PoolByteArray"> </argument> + <argument index="1" name="allow_objects" type="bool" default="false"> + </argument> <description> - Decodes a byte array back to a value. + Decodes a byte array back to a value. When [code]allow_objects[/code] is [code]true[/code] 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). </description> </method> <method name="cartesian2polar"> @@ -258,16 +259,12 @@ </description> </method> <method name="decimals"> - <return type="float"> + <return type="int"> </return> <argument index="0" name="step" type="float"> </argument> <description> - Returns the position of the first non-zero digit, after the decimal point. - [codeblock] - # n is 2 - n = decimals(0.035) - [/codeblock] + Deprecated alias for "[method step_decimals]". </description> </method> <method name="dectime"> @@ -497,6 +494,17 @@ [/codeblock] </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="a" type="float"> + </argument> + <argument index="1" name="b" type="float"> + </argument> + <description> + Returns True/False whether [code]a[/code] and [code]b[/code] are approximately equal to each other. + </description> + </method> <method name="is_inf"> <return type="bool"> </return> @@ -524,6 +532,15 @@ Returns whether [code]s[/code] is a NaN (Not-A-Number) value. </description> </method> + <method name="is_zero_approx"> + <return type="bool"> + </return> + <argument index="0" name="s" type="float"> + </argument> + <description> + Returns True/False whether [code]s[/code] is zero or almost zero. + </description> + </method> <method name="len"> <return type="int"> </return> @@ -972,6 +989,24 @@ [/codeblock] </description> </method> + <method name="smoothstep"> + <return type="float"> + </return> + <argument index="0" name="from" type="float"> + </argument> + <argument index="1" name="to" type="float"> + </argument> + <argument index="2" name="weight" type="float"> + </argument> + <description> + Returns a number smoothly interpolated between the [code]from[/code] and [code]to[/code], based on the [code]weight[/code]. Similar to [method lerp], but interpolates faster at the beginning and slower at the end. + [codeblock] + smoothstep(0, 2, 0.5) # returns 0.15 + smoothstep(0, 2, 1.0) # returns 0.5 + smoothstep(0, 2, 2.0) # returns 1.0 + [/codeblock] + </description> + </method> <method name="sqrt"> <return type="float"> </return> @@ -984,6 +1019,23 @@ [/codeblock] </description> </method> + <method name="step_decimals"> + <return type="int"> + </return> + <argument index="0" name="step" type="float"> + </argument> + <description> + Returns the position of the first non-zero digit, after the decimal point. + [codeblock] + # n is 0 + n = step_decimals(5) + # n is 4 + n = step_decimals(1.0005) + # n is 9 + n = step_decimals(0.000000005) + [/codeblock] + </description> + </method> <method name="stepify"> <return type="float"> </return> @@ -1112,8 +1164,10 @@ </return> <argument index="0" name="var" type="Variant"> </argument> + <argument index="1" name="full_objects" type="bool" default="false"> + </argument> <description> - Encodes a variable value to a byte array. + Encodes a variable value to a byte array. When [code]full_objects[/code] is [code]true[/code] encoding objects is allowed (and can potentially include code). </description> </method> <method name="var2str"> |