diff options
Diffstat (limited to 'doc/classes')
84 files changed, 4157 insertions, 1264 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 2b1770f12b..ee65bbc07e 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1594,43 +1594,40 @@ <constant name="OP_MODULE" value="12" enum="Variant.Operator"> Remainder/modulo operator ([code]%[/code]). </constant> - <constant name="OP_STRING_CONCAT" value="13" enum="Variant.Operator"> - String concatenation operator ([code]+[/code]). - </constant> - <constant name="OP_SHIFT_LEFT" value="14" enum="Variant.Operator"> + <constant name="OP_SHIFT_LEFT" value="13" enum="Variant.Operator"> Left shift operator ([code]<<[/code]). </constant> - <constant name="OP_SHIFT_RIGHT" value="15" enum="Variant.Operator"> + <constant name="OP_SHIFT_RIGHT" value="14" enum="Variant.Operator"> Right shift operator ([code]>>[/code]). </constant> - <constant name="OP_BIT_AND" value="16" enum="Variant.Operator"> + <constant name="OP_BIT_AND" value="15" enum="Variant.Operator"> Bitwise AND operator ([code]&[/code]). </constant> - <constant name="OP_BIT_OR" value="17" enum="Variant.Operator"> + <constant name="OP_BIT_OR" value="16" enum="Variant.Operator"> Bitwise OR operator ([code]|[/code]). </constant> - <constant name="OP_BIT_XOR" value="18" enum="Variant.Operator"> + <constant name="OP_BIT_XOR" value="17" enum="Variant.Operator"> Bitwise XOR operator ([code]^[/code]). </constant> - <constant name="OP_BIT_NEGATE" value="19" enum="Variant.Operator"> + <constant name="OP_BIT_NEGATE" value="18" enum="Variant.Operator"> Bitwise NOT operator ([code]~[/code]). </constant> - <constant name="OP_AND" value="20" enum="Variant.Operator"> + <constant name="OP_AND" value="19" enum="Variant.Operator"> Logical AND operator ([code]and[/code] or [code]&&[/code]). </constant> - <constant name="OP_OR" value="21" enum="Variant.Operator"> + <constant name="OP_OR" value="20" enum="Variant.Operator"> Logical OR operator ([code]or[/code] or [code]||[/code]). </constant> - <constant name="OP_XOR" value="22" enum="Variant.Operator"> + <constant name="OP_XOR" value="21" enum="Variant.Operator"> Logical XOR operator (not implemented in GDScript). </constant> - <constant name="OP_NOT" value="23" enum="Variant.Operator"> + <constant name="OP_NOT" value="22" enum="Variant.Operator"> Logical NOT operator ([code]not[/code] or [code]![/code]). </constant> - <constant name="OP_IN" value="24" enum="Variant.Operator"> + <constant name="OP_IN" value="23" enum="Variant.Operator"> Logical IN operator ([code]in[/code]). </constant> - <constant name="OP_MAX" value="25" enum="Variant.Operator"> + <constant name="OP_MAX" value="24" enum="Variant.Operator"> Represents the size of the [enum Variant.Operator] enum. </constant> </constants> diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index c547563a6e..baea84df65 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -14,7 +14,23 @@ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link> </tutorials> <methods> - <method name="AABB"> + <method name="AABB" qualifiers="constructor"> + <return type="AABB"> + </return> + <description> + Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size]. + </description> + </method> + <method name="AABB" qualifiers="constructor"> + <return type="AABB"> + </return> + <argument index="0" name="from" type="AABB"> + </argument> + <description> + Constructs an [AABB] as a copy of the given [AABB]. + </description> + </method> + <method name="AABB" qualifiers="constructor"> <return type="AABB"> </return> <argument index="0" name="position" type="Vector3"> @@ -176,8 +192,18 @@ Returns [code]true[/code] if the [AABB] is on both sides of a plane. </description> </method> + <method name="intersects_ray"> + <return type="Variant"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="dir" type="Vector3"> + </argument> + <description> + </description> + </method> <method name="intersects_segment"> - <return type="bool"> + <return type="Variant"> </return> <argument index="0" name="from" type="Vector3"> </argument> @@ -205,6 +231,30 @@ Returns a larger [AABB] that contains both this [AABB] and [code]with[/code]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="AABB"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="AABB"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="AABB"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )"> diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index 39228eab79..969e9cc85b 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -63,12 +63,6 @@ <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false"> If [code]true[/code], the [member animation] is currently playing. </member> - <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0"> - Strength of the specular light effect of this [AnimatedSprite2D]. - </member> - <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )"> - The color of the specular light effect. - </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> The animation speed is multiplied by this value. </member> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 87b7443a8a..0ad5960d4a 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -38,48 +38,56 @@ GD.Print(array1 + array2); // Prints [One, 2, 3, Four] [/csharp] [/codeblocks] + Note that concatenating with [code]+=[/code] operator will create a new array. If you want to append another array to an existing array, [method append_array] is more efficient. [b]Note:[/b] Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use [method duplicate]. </description> <tutorials> </tutorials> <methods> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedColorArray"> + <description> + Constructs an empty [Array]. + </description> + </method> + <method name="Array" qualifiers="constructor"> + <return type="Array"> + </return> + <argument index="0" name="from" type="Array"> </argument> <description> - Constructs an array from a [PackedColorArray]. + Constructs an [Array] as a copy of the given [Array]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedVector3Array"> + <argument index="0" name="from" type="PackedByteArray"> </argument> <description> - Constructs an array from a [PackedVector3Array]. + Constructs an array from a [PackedByteArray]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedVector2Array"> + <argument index="0" name="from" type="PackedColorArray"> </argument> <description> - Constructs an array from a [PackedVector2Array]. + Constructs an array from a [PackedColorArray]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedStringArray"> + <argument index="0" name="from" type="PackedFloat32Array"> </argument> <description> - Constructs an array from a [PackedStringArray]. + Constructs an array from a [PackedFloat32Array]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> <argument index="0" name="from" type="PackedFloat64Array"> @@ -88,16 +96,16 @@ Constructs an array from a [PackedFloat64Array]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedFloat32Array"> + <argument index="0" name="from" type="PackedInt32Array"> </argument> <description> - Constructs an array from a [PackedFloat32Array]. + Constructs an array from a [PackedInt32Array]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> <argument index="0" name="from" type="PackedInt64Array"> @@ -106,22 +114,31 @@ Constructs an array from a [PackedInt64Array]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedInt32Array"> + <argument index="0" name="from" type="PackedStringArray"> </argument> <description> - Constructs an array from a [PackedInt32Array]. + Constructs an array from a [PackedStringArray]. </description> </method> - <method name="Array"> + <method name="Array" qualifiers="constructor"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedByteArray"> + <argument index="0" name="from" type="PackedVector2Array"> </argument> <description> - Constructs an array from a [PackedByteArray]. + Constructs an array from a [PackedVector2Array]. + </description> + </method> + <method name="Array" qualifiers="constructor"> + <return type="Array"> + </return> + <argument index="0" name="from" type="PackedVector3Array"> + </argument> + <description> + Constructs an array from a [PackedVector3Array]. </description> </method> <method name="append"> @@ -133,6 +150,21 @@ Appends an element at the end of the array (alias of [method push_back]). </description> </method> + <method name="append_array"> + <return type="void"> + </return> + <argument index="0" name="array" type="Array"> + </argument> + <description> + Appends another array at the end of this array. + [codeblock] + var array1 = [1, 2, 3] + var array2 = [4, 5, 6] + array1.append_array(array2) + print(array1) # Prints [1, 2, 3, 4, 5, 6]. + [/codeblock] + </description> + </method> <method name="back"> <return type="Variant"> </return> @@ -160,7 +192,7 @@ </argument> <argument index="1" name="obj" type="Object"> </argument> - <argument index="2" name="func" type="String"> + <argument index="2" name="func" type="StringName"> </argument> <argument index="3" name="before" type="bool" default="true"> </argument> @@ -320,6 +352,70 @@ Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Array"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="void"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="pop_back"> <return type="Variant"> </return> @@ -362,7 +458,7 @@ </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> <argument index="0" name="size" type="int"> </argument> @@ -433,7 +529,7 @@ </return> <argument index="0" name="obj" type="Object"> </argument> - <argument index="1" name="func" type="String"> + <argument index="1" name="func" type="StringName"> </argument> <description> Sorts the array using a custom method. The arguments are an object that holds the method and the name of such 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]. diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 8c92975b9c..31e6ea5e54 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -81,6 +81,15 @@ <member name="albedo_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture to multiply by [member albedo_color]. Used for basic texturing of objects. </member> + <member name="alpha_antialiasing_edge" type="float" setter="set_alpha_antialiasing_edge" getter="get_alpha_antialiasing_edge"> + Threshold at which antialiasing will by applied on the alpha channel. + </member> + <member name="alpha_antialiasing_mode" type="int" setter="set_alpha_antialiasing" getter="get_alpha_antialiasing" enum="BaseMaterial3D.AlphaAntiAliasing"> + The type of alpha antialiasing to apply. See [enum AlphaAntiAliasing]. + </member> + <member name="alpha_hash_scale" type="float" setter="set_alpha_hash_scale" getter="get_alpha_hash_scale"> + The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code]. + </member> <member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold"> Threshold at which the alpha scissor will discard values. </member> @@ -486,10 +495,13 @@ <constant name="TRANSPARENCY_ALPHA_SCISSOR" value="2" enum="Transparency"> The material will cut off all values below a threshold, the rest will remain opaque. </constant> - <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="3" enum="Transparency"> + <constant name="TRANSPARENCY_ALPHA_HASH" value="3" enum="Transparency"> + The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque. + </constant> + <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="4" enum="Transparency"> The material will use the texture's alpha value for transparency, but will still be rendered in the pre-pass. </constant> - <constant name="TRANSPARENCY_MAX" value="4" enum="Transparency"> + <constant name="TRANSPARENCY_MAX" value="5" enum="Transparency"> Represents the size of the [enum Transparency] enum. </constant> <constant name="SHADING_MODE_UNSHADED" value="0" enum="ShadingMode"> @@ -555,6 +567,15 @@ <constant name="BLEND_MODE_MUL" value="3" enum="BlendMode"> The color of the object is multiplied by the background. </constant> + <constant name="ALPHA_ANTIALIASING_OFF" value="0" enum="AlphaAntiAliasing"> + Disables Alpha AntiAliasing for the material. + </constant> + <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE" value="1" enum="AlphaAntiAliasing"> + Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask. + </constant> + <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE" value="2" enum="AlphaAntiAliasing"> + Enables AlphaToCoverage and forces all non-zero alpha values to [code]1[/code]. Alpha values in the material are passed to the AntiAliasing sample mask. + </constant> <constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0" enum="DepthDrawMode"> Default depth draw mode. Depth is drawn only for opaque objects. </constant> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 42ca3ad24b..877d3ca85a 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -19,26 +19,23 @@ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> </tutorials> <methods> - <method name="Basis"> + <method name="Basis" qualifiers="constructor"> <return type="Basis"> </return> - <argument index="0" name="from" type="Quat"> - </argument> <description> - Constructs a pure rotation basis matrix from the given quaternion. + Constructs a default-initialized [Basis] set to [constant IDENTITY]. </description> </method> - <method name="Basis"> + <method name="Basis" qualifiers="constructor"> <return type="Basis"> </return> - <argument index="0" name="from" type="Vector3"> + <argument index="0" name="from" type="Basis"> </argument> <description> - Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle). - Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles. + Constructs a [Basis] as a copy of the given [Basis]. </description> </method> - <method name="Basis"> + <method name="Basis" qualifiers="constructor"> <return type="Basis"> </return> <argument index="0" name="axis" type="Vector3"> @@ -49,7 +46,26 @@ Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]phi[/code], in radians. The axis must be a normalized vector. </description> </method> - <method name="Basis"> + <method name="Basis" qualifiers="constructor"> + <return type="Basis"> + </return> + <argument index="0" name="euler" type="Vector3"> + </argument> + <description> + Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle). + Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles. + </description> + </method> + <method name="Basis" qualifiers="constructor"> + <return type="Basis"> + </return> + <argument index="0" name="from" type="Quat"> + </argument> + <description> + Constructs a pure rotation basis matrix from the given quaternion. + </description> + </method> + <method name="Basis" qualifiers="constructor"> <return type="Basis"> </return> <argument index="0" name="x_axis" type="Vector3"> @@ -115,6 +131,46 @@ Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Basis"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Basis"> + </return> + <argument index="0" name="right" type="Basis"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Basis"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="orthonormalized"> <return type="Basis"> </return> @@ -187,25 +243,6 @@ Returns the transposed version of the matrix. </description> </method> - <method name="xform"> - <return type="Vector3"> - </return> - <argument index="0" name="v" type="Vector3"> - </argument> - <description> - Returns a vector transformed (multiplied) by the matrix. - </description> - </method> - <method name="xform_inv"> - <return type="Vector3"> - </return> - <argument index="0" name="v" type="Vector3"> - </argument> - <description> - Returns a vector transformed (multiplied) by the transposed basis matrix. - [b]Note:[/b] This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection. - </description> - </method> </methods> <members> <member name="x" type="Vector3" setter="" getter="" default="Vector3( 1, 0, 0 )"> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 7244da56ca..fcf2feb3b9 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -238,10 +238,6 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normalmap" type="Texture2D" setter="set_normalmap" getter="get_normalmap"> - Normal map to be used for the [member texture] property. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end. </member> diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index ad5c549fee..f137ede90f 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -36,19 +36,35 @@ <tutorials> </tutorials> <methods> - <method name="Callable"> + <method name="Callable" qualifiers="constructor"> + <return type="Callable"> + </return> + <description> + Constructs a null [Callable] with no object nor method bound. + </description> + </method> + <method name="Callable" qualifiers="constructor"> + <return type="Callable"> + </return> + <argument index="0" name="from" type="Callable"> + </argument> + <description> + Constructs a [Callable] as a copy of the given [Callable]. + </description> + </method> + <method name="Callable" qualifiers="constructor"> <return type="Callable"> </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method_name" type="StringName"> + <argument index="1" name="method" type="StringName"> </argument> <description> - Creates a new [Callable] for the method called [code]method_name[/code] in the specified [code]object[/code]. + Creates a new [Callable] for the method called [code]method[/code] in the specified [code]object[/code]. </description> </method> <method name="bind" qualifiers="vararg"> - <return type="void"> + <return type="Callable"> </return> <description> </description> @@ -112,6 +128,22 @@ <description> </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Callable"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Callable"> + </argument> + <description> + </description> + </method> <method name="unbind"> <return type="Callable"> </return> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index b6a108fb25..b3fe452b12 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -163,6 +163,13 @@ </argument> <description> Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in worldspace. + [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: + [codeblock] + # This code block is part of a script that inherits from Node3D. + # `control` is a reference to a node inheriting from Control. + control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) + control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) + [/codeblock] </description> </method> </methods> diff --git a/doc/classes/CanvasGroup.xml b/doc/classes/CanvasGroup.xml new file mode 100644 index 0000000000..ceeda6c3f5 --- /dev/null +++ b/doc/classes/CanvasGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CanvasGroup" inherits="Node2D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="clear_margin" type="float" setter="set_clear_margin" getter="get_clear_margin" default="10.0"> + </member> + <member name="fit_margin" type="float" setter="set_fit_margin" getter="get_fit_margin" default="10.0"> + </member> + <member name="use_mipmaps" type="bool" setter="set_use_mipmaps" getter="is_using_mipmaps" default="false"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 11000ce8d5..8efa1adae8 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -86,16 +86,6 @@ </argument> <argument index="3" name="texture" type="Texture2D" default="null"> </argument> - <argument index="4" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="5" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> Draws a colored polygon of any amount of points, convex or concave. </description> @@ -122,19 +112,9 @@ </argument> <argument index="1" name="texture" type="Texture2D"> </argument> - <argument index="2" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="3" name="specular_map" type="Texture2D" default="null"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> </argument> - <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="5" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> - </argument> - <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <description> Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. @@ -173,16 +153,6 @@ </argument> <argument index="1" name="texture" type="Texture2D"> </argument> - <argument index="2" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="3" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="5" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="6" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation. </description> @@ -198,16 +168,6 @@ </argument> <argument index="3" name="texture" type="Texture2D" default="null"> </argument> - <argument index="4" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="5" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> Draws a polygon of any amount of points, convex or concave. </description> @@ -251,16 +211,6 @@ </argument> <argument index="4" name="width" type="float" default="1.0"> </argument> - <argument index="5" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> 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. </description> @@ -358,16 +308,6 @@ </argument> <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> - <argument index="3" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="4" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="5" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="6" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="7" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> Draws a texture at a given position. </description> @@ -385,16 +325,6 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> - </argument> <description> 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. </description> @@ -412,17 +342,7 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="8" name="clip_uv" type="bool" default="true"> - </argument> - <argument index="9" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0"> - </argument> - <argument index="10" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> + <argument index="5" name="clip_uv" type="bool" default="true"> </argument> <description> 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. @@ -592,6 +512,8 @@ </method> </methods> <members> + <member name="clip_children" type="bool" setter="set_clip_children" getter="is_clipping_children" default="false"> + </member> <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1"> The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. </member> @@ -640,7 +562,7 @@ </signal> <signal name="item_rect_changed"> <description> - Emitted when the item rect has changed. + Emitted when the item's [Rect2] boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing [member Sprite2D.texture]). </description> </signal> <signal name="visibility_changed"> diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml new file mode 100644 index 0000000000..0ca132746b --- /dev/null +++ b/doc/classes/CanvasTexture.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CanvasTexture" inherits="Texture2D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture"> + </member> + <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture"> + </member> + <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )"> + </member> + <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0"> + </member> + <member name="specular_texture" type="Texture2D" setter="set_specular_texture" getter="get_specular_texture"> + </member> + <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> + </member> + <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index ef438e422a..ae8703c837 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -16,74 +16,31 @@ <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link> </tutorials> <methods> - <method name="Color"> + <method name="Color" qualifiers="constructor"> <return type="Color"> </return> - <argument index="0" name="from" type="String"> - </argument> <description> - Constructs a color from an HTML hexadecimal color string in RGB or RGBA format. See also [method @GDScript.ColorN]. - [codeblocks] - [gdscript] - # Each of the following creates the same color RGBA(178, 217, 10, 255). - var c3 = Color("#b2d90a") # RGB format with "#". - var c4 = Color("b2d90a") # RGB format. - var c1 = Color("#b2d90aff") # RGBA format with "#". - var c2 = Color("b2d90aff") # RGBA format. - [/gdscript] - [csharp] - // Each of the following creates the same color RGBA(178, 217, 10, 255). - var c3 = new Color("#b2d90a"); - var c4 = new Color("b2d90a"); // RGB format. - var c1 = new Color("#b2d90aff"); - var c2 = new Color("b2d90aff"); // RGBA format. - [/csharp] - [/codeblocks] - You can also use the "web color" short-hand form by only using 3 or 4 digits. - [codeblocks] - [gdscript] - # Each of the following creates the same color RGBA(17, 34, 51, 255). - var c3 = Color("#123") # RGB format with "#". - var c4 = Color("123") # RGB format. - var c1 = Color("#123f") # RGBA format with "#". - var c2 = Color("123f") # RGBA format. - [/gdscript] - [csharp] - // Each of the following creates the same color RGBA(17, 34, 51, 255). - var c3 = new Color("#123"); - var c4 = new Color("123"); // RGB format. - var c1 = new Color("#123f"); - var c2 = new Color("123f"); // RGBA format. - [/csharp] - [/codeblocks] + Constructs a default-initialized [Color] with all components set to [code]0[/code]. </description> </method> - <method name="Color"> + <method name="Color" qualifiers="constructor"> <return type="Color"> </return> - <argument index="0" name="from" type="int"> + <argument index="0" name="from" type="Color"> </argument> <description> - Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile). - [codeblocks] - [gdscript] - var c = Color(274) # Equivalent to RGBA(0, 0, 1, 18) - [/gdscript] - [csharp] - var c = new Color(274); // Equivalent to RGBA(0, 0, 1, 18) - [/csharp] - [/codeblocks] + Constructs a [Color] as a copy of the given [Color]. </description> </method> - <method name="Color"> + <method name="Color" qualifiers="constructor"> <return type="Color"> </return> - <argument index="0" name="c" type="Color"> + <argument index="0" name="from" type="Color"> </argument> - <argument index="1" name="a" type="float"> + <argument index="1" name="alpha" type="float"> </argument> <description> - Constructs a color from an existing color, but with a custom alpha value. + Constructs a [Color] from an existing color, but with a custom alpha value. [codeblocks] [gdscript] var red = Color(Color.red, 0.5) # 50% transparent red. @@ -94,7 +51,7 @@ [/codeblocks] </description> </method> - <method name="Color"> + <method name="Color" qualifiers="constructor"> <return type="Color"> </return> <argument index="0" name="r" type="float"> @@ -103,19 +60,21 @@ </argument> <argument index="2" name="b" type="float"> </argument> + <argument index="3" name="a" type="float"> + </argument> <description> - Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1. + Constructs a [Color] from an RGBA profile using values between 0 and 1. [codeblocks] [gdscript] - var color = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255) + var color = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204) [/gdscript] [csharp] - var color = new Color(0.2f, 1.0f, 0.7f); // Equivalent to RGBA(51, 255, 178, 255) + var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Equivalent to RGBA(51, 255, 178, 255, 204) [/csharp] [/codeblocks] </description> </method> - <method name="Color"> + <method name="Color" qualifiers="constructor"> <return type="Color"> </return> <argument index="0" name="r" type="float"> @@ -124,16 +83,14 @@ </argument> <argument index="2" name="b" type="float"> </argument> - <argument index="3" name="a" type="float"> - </argument> <description> - Constructs a color from an RGBA profile using values between 0 and 1. + Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1. [codeblocks] [gdscript] - var color = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204) + var color = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255) [/gdscript] [csharp] - var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Equivalent to RGBA(51, 255, 178, 255, 204) + var color = new Color(0.2f, 1.0f, 0.7f); // Equivalent to RGBA(51, 255, 178, 255) [/csharp] [/codeblocks] </description> @@ -159,23 +116,6 @@ [/codeblocks] </description> </method> - <method name="contrasted"> - <return type="Color"> - </return> - <description> - Returns the most contrasting color. - [codeblocks] - [gdscript] - var color = Color(0.3, 0.4, 0.9) - var contrasted_color = color.contrasted() # Equivalent to RGBA(204, 229, 102, 255) - [/gdscript] - [csharp] - var color = new Color(0.3f, 0.4f, 0.9f); - Color contrastedColor = color.Contrasted(); // Equivalent to RGBA(204, 229, 102, 255) - [/csharp] - [/codeblocks] - </description> - </method> <method name="darkened"> <return type="Color"> </return> @@ -195,29 +135,6 @@ [/codeblocks] </description> </method> - <method name="from_hsv"> - <return type="Color"> - </return> - <argument index="0" name="h" type="float"> - </argument> - <argument index="1" name="s" type="float"> - </argument> - <argument index="2" name="v" type="float"> - </argument> - <argument index="3" name="a" type="float" default="1.0"> - </argument> - <description> - Constructs a color from an HSV profile. [code]h[/code], [code]s[/code], and [code]v[/code] are values between 0 and 1. - [codeblocks] - [gdscript] - var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) - [/gdscript] - [csharp] - Color color = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); // Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) - [/csharp] - [/codeblocks] - </description> - </method> <method name="inverted"> <return type="Color"> </return> @@ -238,7 +155,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="color" type="Color"> + <argument index="0" name="to" type="Color"> </argument> <description> Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -286,6 +203,98 @@ [/codeblocks] </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="to_abgr32"> <return type="int"> </return> diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 7c0cd981e4..09ba4c8b26 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="color" type="Color" setter="set_frame_color" getter="get_frame_color" default="Color( 1, 1, 1, 1 )"> + <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> The fill color. [codeblocks] [gdscript] diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index f495bfe894..6ea7b79dff 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -75,15 +75,17 @@ </description> </method> <method name="_make_custom_tooltip" qualifiers="virtual"> - <return type="Object"> + <return type="Control"> </return> <argument index="0" name="for_text" type="String"> </argument> <description> - Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. Use [code]for_text[/code] parameter to determine what text the tooltip should contain (likely the contents of [member hint_tooltip]). - The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead. + 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. + The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member hint_tooltip] for an example). [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value. - Example of usage with custom-constructed node: + [b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise the viewport that instantiates it will not be able to calculate its minimum size reliably. + Example of usage with a custom-constructed node: [codeblocks] [gdscript] func _make_custom_tooltip(for_text): @@ -92,7 +94,7 @@ return label [/gdscript] [csharp] - public override Godot.Object _MakeCustomTooltip(String forText) + public override Godot.Control _MakeCustomTooltip(String forText) { var label = new Label(); label.Text = forText; @@ -100,18 +102,18 @@ } [/csharp] [/codeblocks] - Example of usage with custom scene instance: + Example of usage with a custom scene instance: [codeblocks] [gdscript] func _make_custom_tooltip(for_text): - var tooltip = preload("SomeTooltipScene.tscn").instance() + var tooltip = preload("res://SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip [/gdscript] [csharp] - public override Godot.Object _MakeCustomTooltip(String forText) + public override Godot.Control _MakeCustomTooltip(String forText) { - Node tooltip = ResourceLoader.Load<PackedScene>("SomeTooltipScene.tscn").Instance(); + Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instance(); tooltip.GetNode<Label>("Label").Text = forText; return tooltip; } @@ -993,6 +995,25 @@ </member> <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" default=""""> Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. You can change the time required for the tooltip to appear with [code]gui/timers/tooltip_delay_sec[/code] option in Project Settings. + The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the [code]"TooltipPanel"[/code] and [code]"TooltipLabel"[/code] respectively. For example: + [codeblocks] + [gdscript] + var style_box = StyleBoxFlat.new() + style_box.set_bg_color(Color(1, 1, 0)) + style_box.set_border_width_all(2) + # We assume here that the `theme` property has been assigned a custom Theme beforehand. + theme.set_stylebox("panel", "TooltipPanel", style_box) + theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) + [/gdscript] + [csharp] + var styleBox = new StyleBoxFlat(); + styleBox.SetBgColor(new Color(1, 1, 0)); + styleBox.SetBorderWidthAll(2); + // We assume here that the `Theme` property has been assigned a custom Theme beforehand. + Theme.SetStyleBox("panel", "TooltipPanel", styleBox); + Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1)); + [/csharp] + [/codeblocks] </member> <member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" default="0.0"> Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 8c71b61553..91a04b1f28 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -6,8 +6,9 @@ <description> This class is used to store the state of a DTLS server. Upon [method setup] it converts connected [PacketPeerUDP] to [PacketPeerDTLS] accepting them via [method take_connection] as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. Below a small example of how to use it: - [codeblock] - # server.gd + [codeblocks] + [gdscript] + # ServerNode.gd extends Node var dtls := DTLSServer.new() @@ -28,15 +29,64 @@ continue # It is normal that 50% of the connections fails due to cookie exchange. print("Peer connected!") peers.append(dtls_peer) + for p in peers: p.poll() # Must poll to update the state. if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: while p.get_available_packet_count() > 0: print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) p.put_packet("Hello DTLS client".to_utf8()) - [/codeblock] - [codeblock] - # client.gd + [/gdscript] + [csharp] + using Godot; + using System; + // ServerNode.cs + public class ServerNode : Node + { + public DTLSServer Dtls = new DTLSServer(); + public UDPServer Server = new UDPServer(); + public Godot.Collections.Array<PacketPeerDTLS> Peers = new Godot.Collections.Array<PacketPeerDTLS>(); + public override void _Ready() + { + Server.Listen(4242); + var key = GD.Load<CryptoKey>("key.key"); // Your private key. + var cert = GD.Load<X509Certificate>("cert.crt"); // Your X509 certificate. + Dtls.Setup(key, cert); + } + + public override void _Process(float delta) + { + while (Server.IsConnectionAvailable()) + { + PacketPeerUDP peer = Server.TakeConnection(); + PacketPeerDTLS dtlsPeer = Dtls.TakeConnection(peer); + if (dtlsPeer.GetStatus() != PacketPeerDTLS.Status.Handshaking) + { + continue; // It is normal that 50% of the connections fails due to cookie exchange. + } + GD.Print("Peer connected!"); + Peers.Add(dtlsPeer); + } + + foreach (var p in Peers) + { + p.Poll(); // Must poll to update the state. + if (p.GetStatus() == PacketPeerDTLS.Status.Connected) + { + while (p.GetAvailablePacketCount() > 0) + { + GD.Print("Received Message From Client: " + p.GetPacket().GetStringFromUTF8()); + p.PutPacket("Hello Dtls Client".ToUTF8()); + } + } + } + } + } + [/csharp] + [/codeblocks] + [codeblocks] + [gdscript] + # ClientNode.gd extends Node var dtls := PacketPeerDTLS.new() @@ -56,7 +106,42 @@ while dtls.get_available_packet_count() > 0: print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) connected = true - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System.Text; + // ClientNode.cs + public class ClientNode : Node + { + public PacketPeerDTLS Dtls = new PacketPeerDTLS(); + public PacketPeerUDP Udp = new PacketPeerUDP(); + public bool Connected = false; + public override void _Ready() + { + Udp.ConnectToHost("127.0.0.1", 4242); + Dtls.ConnectToPeer(Udp, false); // Use true in production for certificate validation! + } + + public override void _Process(float delta) + { + Dtls.Poll(); + if (Dtls.GetStatus() == PacketPeerDTLS.Status.Connected) + { + if (!Connected) + { + // Try to contact server + Dtls.PutPacket("The Answer Is..42!".ToUTF8()); + } + while (Dtls.GetAvailablePacketCount() > 0) + { + GD.Print("Connected: " + Dtls.GetPacket().GetStringFromUTF8()); + Connected = true; + } + } + } + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index f9baa3b09a..8107d97b67 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -20,10 +20,18 @@ 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]. One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example: - [codeblock] + [codeblocks] + [gdscript] for i in Decal.TEXTURE_MAX: $NewDecal.set_texture(i, $OldDecal.get_texture(i)) - [/codeblock] + [/gdscript] + [csharp] + for (int i = 0; i < (int)Decal.DecalTexture.Max; i++) + { + GetNode<Decal>("NewDecal").SetTexture(i, GetNode<Decal>("OldDecal").GetTexture(i)); + } + [/csharp] + [/codeblocks] </description> </method> <method name="set_texture"> @@ -37,10 +45,18 @@ 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]. One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example: - [codeblock] + [codeblocks] + [gdscript] for i in Decal.TEXTURE_MAX: $NewDecal.set_texture(i, $OldDecal.get_texture(i)) - [/codeblock] + [/gdscript] + [csharp] + for (int i = 0; i < (int)Decal.DecalTexture.Max; i++) + { + GetNode<Decal>("NewDecal").SetTexture(i, GetNode<Decal>("OldDecal").GetTexture(i)); + } + [/csharp] + [/codeblocks] </description> </method> </methods> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index cb60d6e621..dc38fdf0e8 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -9,7 +9,8 @@ Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior. [b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate]. Creating a dictionary: - [codeblock] + [codeblocks] + [gdscript] var my_dir = {} # Creates an empty dictionary. var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} var another_dir = { @@ -17,28 +18,74 @@ key2: value2, key3: value3, } - [/codeblock] + [/gdscript] + [csharp] + var myDir = new Godot.Collections.Dictionary(); // Creates an empty dictionary. + var pointsDir = new Godot.Collections.Dictionary + { + {"White", 50}, + {"Yellow", 75}, + {"Orange", 100} + }; + [/csharp] + [/codeblocks] You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). - [codeblock] - export(String, "White", "Yellow", "Orange") var my_color + [codeblocks] + [gdscript] + export(string, "White", "Yellow", "Orange") var my_color var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} - func _ready(): # We can't use dot syntax here as `my_color` is a variable. var points = points_dir[my_color] - [/codeblock] + [/gdscript] + [csharp] + [Export(PropertyHint.Enum, "White,Yellow,Orange")] + public string MyColor { get; set; } + public Godot.Collections.Dictionary pointsDir = new Godot.Collections.Dictionary + { + {"White", 50}, + {"Yellow", 75}, + {"Orange", 100} + }; + + public override void _Ready() + { + int points = (int)pointsDir[MyColor]; + } + [/csharp] + [/codeblocks] In the above code, [code]points[/code] will be assigned the value that is paired with the appropriate color selected in [code]my_color[/code]. Dictionaries can contain more complex data: - [codeblock] + [codeblocks] + [gdscript] my_dir = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. - [/codeblock] + [/gdscript] + [csharp] + var myDir = new Godot.Collections.Dictionary + { + {"First Array", new Godot.Collections.Array{1, 2, 3, 4}} + }; + [/csharp] + [/codeblocks] To add a key to an existing dictionary, access it like an existing key and assign to it: - [codeblock] + [codeblocks] + [gdscript] var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. - [/codeblock] + [/gdscript] + [csharp] + var pointsDir = new Godot.Collections.Dictionary + { + {"White", 50}, + {"Yellow", 75}, + {"Orange", 100} + }; + pointsDir["blue"] = 150; // Add "Blue" as a key and assign 150 as its value. + [/csharp] + [/codeblocks] Finally, dictionaries can contain different types of keys and values in the same dictionary: - [codeblock] + [codeblocks] + [gdscript] # This is a valid dictionary. # To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`. # Indexing styles can be mixed and matched depending on your needs. @@ -48,29 +95,75 @@ 7: "Hello", "sub_dir": {"sub_key": "Nested value"}, } - [/codeblock] + [/gdscript] + [csharp] + // This is a valid dictionary. + // To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`. + // Indexing styles can be mixed and matched depending on your needs. + var myDir = new Godot.Collections.Dictionary { + {"String Key", 5}, + {4, new Godot.Collections.Array{1,2,3}}, + {7, "Hello"}, + {"sub_dir", new Godot.Collections.Dictionary{{"sub_key", "Nested value"}}} + }; + [/csharp] + [/codeblocks] [b]Note:[/b] Unlike [Array]s, you can't compare dictionaries directly: - [codeblock] - array1 = [1, 2, 3] - array2 = [1, 2, 3] + [codeblocks] + [gdscript] + var array1 = [1, 2, 3] + var array2 = [1, 2, 3] func compare_arrays(): print(array1 == array2) # Will print true. - dir1 = {"a": 1, "b": 2, "c": 3} - dir2 = {"a": 1, "b": 2, "c": 3} + var dir1 = {"a": 1, "b": 2, "c": 3} + var dir2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): print(dir1 == dir2) # Will NOT print true. - [/codeblock] + [/gdscript] + [csharp] + // You have to use GD.Hash(). + + public Godot.Collections.Array array1 = new Godot.Collections.Array{1, 2, 3}; + public Godot.Collections.Array array2 = new Godot.Collections.Array{1, 2, 3}; + + public void CompareArrays() + { + GD.Print(array1 == array2); // Will print FALSE!! + GD.Print(GD.Hash(array1) == GD.Hash(array2)); // Will print true. + } + + public Godot.Collections.Dictionary dir1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}}; + public Godot.Collections.Dictionary dir2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}}; + + public void CompareDictionaries() + { + GD.Print(dir1 == dir2); // Will NOT print true. + } + [/csharp] + [/codeblocks] You need to first calculate the dictionary's hash with [method hash] before you can compare them: - [codeblock] - dir1 = {"a": 1, "b": 2, "c": 3} - dir2 = {"a": 1, "b": 2, "c": 3} + [codeblocks] + [gdscript] + var dir1 = {"a": 1, "b": 2, "c": 3} + var dir2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): print(dir1.hash() == dir2.hash()) # Will print true. - [/codeblock] + [/gdscript] + [csharp] + // You have to use GD.Hash(). + public Godot.Collections.Dictionary dir1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}}; + public Godot.Collections.Dictionary dir2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}}; + + public void CompareDictionaries() + { + GD.Print(GD.Hash(dir1) == GD.Hash(dir2)); // Will print true. + } + [/csharp] + [/codeblocks] </description> <tutorials> <link title="GDScript basics: Dictionary">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link> @@ -78,6 +171,22 @@ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> <methods> + <method name="Dictionary" qualifiers="constructor"> + <return type="Dictionary"> + </return> + <description> + Constructs an empty [Dictionary]. + </description> + </method> + <method name="Dictionary" qualifiers="constructor"> + <return type="Dictionary"> + </return> + <argument index="0" name="from" type="Dictionary"> + </argument> + <description> + Constructs a [Dictionary] as a copy of the given [Dictionary]. + </description> + </method> <method name="clear"> <return type="void"> </return> @@ -129,11 +238,20 @@ <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: - [codeblock] + [codeblocks] + [gdscript] # Will evaluate to `true`. if "godot" in {"godot": "engine"}: pass - [/codeblock] + [/gdscript] + [csharp] + // You have to use Contains() here as an alternative to GDScript's `in` operator. + if (new Godot.Collections.Dictionary{{"godot", "engine"}}.Contains("godot")) + { + // I am executed. + } + [/csharp] + [/codeblocks] This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code]. </description> </method> @@ -151,12 +269,21 @@ </return> <description> Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value: - [codeblock] + [codeblocks] + [gdscript] var dict1 = {0: 10} var dict2 = {0: 10} # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. print(dict1.hash() == dict2.hash()) - [/codeblock] + [/gdscript] + [csharp] + var dict1 = new Godot.Collections.Dictionary{{0, 10}}; + var dict2 = new Godot.Collections.Dictionary{{0, 10}}; + // The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. + // Dictionary has no Hash() method. Use GD.Hash() instead. + GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); + [/csharp] + [/codeblocks] [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash. </description> </method> @@ -167,6 +294,30 @@ Returns the list of keys in the [Dictionary]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Dictionary"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Dictionary"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Variant"> + </return> + <argument index="0" name="key" type="Variant"> + </argument> + <description> + </description> + </method> <method name="size"> <return type="int"> </return> diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml new file mode 100644 index 0000000000..a6eb780159 --- /dev/null +++ b/doc/classes/DirectionalLight2D.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="DirectionalLight2D" inherits="Light2D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="height" type="float" setter="set_height" getter="get_height" default="0.0"> + The height of the light. Used with 2D normal mapping. + </member> + <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="10000.0"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index bcdadcd970..2d7292717d 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -7,7 +7,8 @@ Directory type. It is used to manage directories and their content (not restricted to the project folder). When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code]. Here is an example on how to iterate through the files of a directory: - [codeblock] + [codeblocks] + [gdscript] func dir_contents(path): var dir = Directory.new() if dir.open(path) == OK: @@ -21,7 +22,35 @@ file_name = dir.get_next() else: print("An error occurred when trying to access the path.") - [/codeblock] + [/gdscript] + [csharp] + public void DirContents(string path) + { + var dir = new Directory(); + if (dir.Open(path) == Error.Ok) + { + dir.ListDirBegin(); + string fileName = dir.GetNext(); + while (fileName != "") + { + if (dir.CurrentIsDir()) + { + GD.Print("Found directory: " + fileName); + } + else + { + GD.Print("Found file: " + fileName); + } + fileName = dir.GetNext(); + } + } + else + { + GD.Print("An error occurred when trying to access the path."); + } + } + [/csharp] + [/codeblocks] </description> <tutorials> <link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 53776b7752..d91ea6528a 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -923,7 +923,8 @@ <description> Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). - [codeblock] + [codeblocks] + [gdscript] # Set region, using Path2D node. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points()) @@ -932,7 +933,18 @@ # Reset region to default. DisplayServer.window_set_mouse_passthrough([]) - [/codeblock] + [/gdscript] + [csharp] + // Set region, using Path2D node. + DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints()); + + // Set region, using Polygon2D node. + DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon); + + // Reset region to default. + DisplayServer.WindowSetMousePassthrough(new Vector2[] {}); + [/csharp] + [/codeblocks] [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. [b]Note:[/b] This method is implemented on Linux, macOS and Windows. </description> @@ -1108,6 +1120,8 @@ <constant name="WINDOW_MODE_MAXIMIZED" value="2" enum="WindowMode"> </constant> <constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode"> + Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. + Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode. </constant> <constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags"> </constant> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index f687937e27..d2d0c54761 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -6,12 +6,20 @@ <description> DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font. DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization. - [codeblock] + [codeblocks] + [gdscript] var dynamic_font = DynamicFont.new() dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf") dynamic_font.size = 64 $"Label".set("custom_fonts/font", dynamic_font) - [/codeblock] + [/gdscript] + [csharp] + var dynamicFont = new DynamicFont(); + dynamicFont.FontData = ResourceLoader.Load<DynamicFontData>("res://BarlowCondensed-Bold.ttf"); + dynamicFont.Size = 64; + GetNode("Label").Set("custom_fonts/font", dynamicFont); + [/csharp] + [/codeblocks] [b]Note:[/b] DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File > Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font. </description> <tutorials> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index 2a7f27ef55..e5401134bf 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -7,7 +7,8 @@ EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin]. EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory. Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec": - [codeblock] + [codeblocks] + [gdscript] tool extends EditorImportPlugin @@ -39,14 +40,76 @@ var file = File.new() if file.open(source_file, File.READ) != OK: return FAILED - - var mesh = Mesh.new() - # Fill the Mesh with data read in "file", left as an exercise to the reader + var mesh = ArrayMesh.new() + # Fill the Mesh with data read in "file", left as an exercise to the reader. var filename = save_path + "." + get_save_extension() ResourceSaver.save(filename, mesh) return OK - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + + public class MySpecialPlugin : EditorImportPlugin + { + public override String GetImporterName() + { + return "my.special.plugin"; + } + + public override String GetVisibleName() + { + return "Special Mesh Importer"; + } + + public override Godot.Collections.Array GetRecognizedExtensions() + { + return new Godot.Collections.Array{"special", "spec"}; + } + + public override String GetSaveExtension() + { + return "mesh"; + } + + public override String GetResourceType() + { + return "Mesh"; + } + + public override int GetPresetCount() + { + return 1; + } + + public override String GetPresetName(int i) + { + return "Default"; + } + + public override Godot.Collections.Array GetImportOptions(int i) + { + return new Godot.Collections.Array{new Godot.Collections.Dictionary{{"name", "myOption"}, {"defaultValue", false}}}; + } + + public override int Import(String sourceFile, String savePath, Godot.Collections.Dictionary options, Godot.Collections.Array platformVariants, Godot.Collections.Array genFiles) + { + var file = new File(); + if (file.Open(sourceFile, File.ModeFlags.Read) != Error.Ok) + { + return (int)Error.Failed; + } + + var mesh = new ArrayMesh(); + // Fill the Mesh with data read in "file", left as an exercise to the reader. + String filename = savePath + "." + GetSaveExtension(); + ResourceSaver.Save(filename, mesh); + return (int)Error.Ok; + } + } + [/csharp] + [/codeblocks] </description> <tutorials> <link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> @@ -84,14 +147,28 @@ </argument> <description> 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: - [codeblock] + [codeblocks] + [gdscript] func get_option_visibility(option, options): # Only show the lossy quality setting if the compression mode is set to "Lossy". if option == "compress/lossy_quality" and options.has("compress/mode"): - return int(options["compress/mode"]) == COMPRESS_LOSSY + return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set return true - [/codeblock] + [/gdscript] + [csharp] + public void GetOptionVisibility(string option, Godot.Collections.Dictionary options) + { + // Only show the lossy quality setting if the compression mode is set to "Lossy". + if (option == "compress/lossyQuality" && options.Contains("compress/mode")) + { + return (int)options["compress/mode"] == COMPRESS_LOSSY; // This is a constant you set + } + + return true; + } + [/csharp] + [/codeblocks] Return [code]true[/code] to make all options always visible. </description> </method> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 6a64a7aa55..ca011abb36 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -210,6 +210,38 @@ <argument index="0" name="overlay" type="Control"> </argument> <description> + Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + [codeblocks] + [gdscript] + func forward_canvas_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64) + + func forward_canvas_gui_input(event): + if event is InputEventMouseMotion: + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + [/gdscript] + [csharp] + public override void ForwardCanvasDrawOverViewport(Godot.Control overlay) + { + // Draw a circle at cursor position. + overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); + } + + public override bool ForwardCanvasGuiInput(InputEvent @event) + { + if (@event is InputEventMouseMotion) + { + // Redraw viewport when cursor is moved. + UpdateOverlays(); + return true; + } + return false; + [/csharp] + [/codeblocks] </description> </method> <method name="forward_canvas_force_draw_over_viewport" qualifiers="virtual"> @@ -218,6 +250,8 @@ <argument index="0" name="overlay" type="Control"> </argument> <description> + This method is the same as [method forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> <method name="forward_canvas_gui_input" qualifiers="virtual"> @@ -227,21 +261,85 @@ </argument> <description> Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: - [codeblock] + [codeblocks] + [gdscript] # Prevents the InputEvent to reach other Editor classes func forward_canvas_gui_input(event): - var forward = true - return forward - [/codeblock] + return true + [/gdscript] + [csharp] + // Prevents the InputEvent to reach other Editor classes + public override bool ForwardCanvasGuiInput(InputEvent @event) + { + return true; + } + [/csharp] + [/codeblocks] Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: - [codeblock] - # Consumes InputEventMouseMotion and forwards other InputEvent types + [codeblocks] + [gdscript] + # Consumes InputEventMouseMotion and forwards other InputEvent types. func forward_canvas_gui_input(event): - var forward = false + return event is InputEventMouseMotion + [/gdscript] + [csharp] + // Consumes InputEventMouseMotion and forwards other InputEvent types. + public override bool ForwardCanvasGuiInput(InputEvent @event) + { + return @event is InputEventMouseMotion; + } + [/csharp] + [/codeblocks] + </description> + </method> + <method name="forward_spatial_draw_over_viewport" qualifiers="virtual"> + <return type="void"> + </return> + <argument index="0" name="overlay" type="Control"> + </argument> + <description> + Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + [codeblocks] + [gdscript] + func forward_spatial_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64) + + func forward_spatial_gui_input(camera, event): if event is InputEventMouseMotion: - forward = true - return forward - [/codeblock] + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + [/gdscript] + [csharp] + public override void ForwardSpatialDrawOverViewport(Godot.Control overlay) + { + // Draw a circle at cursor position. + overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); + } + + public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event) + { + if (@event is InputEventMouseMotion) + { + // Redraw viewport when cursor is moved. + UpdateOverlays(); + return true; + } + return false; + [/csharp] + [/codeblocks] + </description> + </method> + <method name="forward_spatial_force_draw_over_viewport" qualifiers="virtual"> + <return type="void"> + </return> + <argument index="0" name="overlay" type="Control"> + </argument> + <description> + This method is the same as [method forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> <method name="forward_spatial_gui_input" qualifiers="virtual"> @@ -253,21 +351,35 @@ </argument> <description> Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: - [codeblock] - # Prevents the InputEvent to reach other Editor classes + [codeblocks] + [gdscript] + # Prevents the InputEvent to reach other Editor classes. func forward_spatial_gui_input(camera, event): - var forward = true - return forward - [/codeblock] + return true + [/gdscript] + [csharp] + // Prevents the InputEvent to reach other Editor classes. + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + { + return true; + } + [/csharp] + [/codeblocks] Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: - [codeblock] - # Consumes InputEventMouseMotion and forwards other InputEvent types + [codeblocks] + [gdscript] + # Consumes InputEventMouseMotion and forwards other InputEvent types. func forward_spatial_gui_input(camera, event): - var forward = false - if event is InputEventMouseMotion: - forward = true - return forward - [/codeblock] + return event is InputEventMouseMotion + [/gdscript] + [csharp] + // Consumes InputEventMouseMotion and forwards other InputEvent types. + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + { + return @event is InputEventMouseMotion; + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_breakpoints" qualifiers="virtual"> @@ -291,13 +403,24 @@ Override this method in your plugin to return a [Texture2D] in order to give it an icon. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size. - [codeblock] + [codeblocks] + [gdscript] func get_plugin_icon(): # You can use a custom icon: return preload("res://addons/my_plugin/my_plugin_icon.svg") # Or use a built-in icon: return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") - [/codeblock] + [/gdscript] + [csharp] + public override Texture2D GetPluginIcon() + { + // You can use a custom icon: + return ResourceLoader.Load<Texture2D>("res://addons/my_plugin/my_plugin_icon.svg"); + // Or use a built-in icon: + return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons"); + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_plugin_name" qualifiers="virtual"> @@ -379,7 +502,7 @@ Remember that you have to manage the visibility of all your editor controls manually. </description> </method> - <method name="queue_save_layout" qualifiers="const"> + <method name="queue_save_layout"> <return type="void"> </return> <description> @@ -511,6 +634,7 @@ <return type="void"> </return> <description> + Enables calling of [method forward_canvas_force_draw_over_viewport] for the 2D editor and [method forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. </description> </method> <method name="set_input_event_forwarding_always_enabled"> @@ -542,7 +666,7 @@ <return type="int"> </return> <description> - Updates the overlays of the editor (2D/3D) viewport. + Updates the overlays of the 2D and 3D editor viewport. Causes methods [method forward_canvas_draw_over_viewport], [method forward_canvas_force_draw_over_viewport], [method forward_spatial_draw_over_viewport] and [method forward_spatial_force_draw_over_viewport] to be called. </description> </method> </methods> diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index cb1f5d2e77..5cddecffa8 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -6,24 +6,50 @@ <description> Imported scenes can be automatically modified right after import by setting their [b]Custom Script[/b] Import property to a [code]tool[/code] script that inherits from this class. The [method post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example: - [codeblock] - tool # Needed so it runs in editor + [codeblocks] + [gdscript] + tool # Needed so it runs in editor. extends EditorScenePostImport - - # This sample changes all node names - - # Called right after the scene is imported and gets the root node + # This sample changes all node names. + # Called right after the scene is imported and gets the root node. func post_import(scene): # Change all node names to "modified_[oldnodename]" iterate(scene) return scene # Remember to return the imported scene - func iterate(node): if node != null: node.name = "modified_" + node.name for child in node.get_children(): iterate(child) - [/codeblock] + [/gdscript] + [csharp] + using Godot; + + // This sample changes all node names. + // Called right after the scene is imported and gets the root node. + [Tool] + public class NodeRenamer : EditorScenePostImport + { + public override Object PostImport(Object scene) + { + // Change all node names to "modified_[oldnodename]" + Iterate(scene as Node); + return scene; // Remember to return the imported scene + } + public void Iterate(Node node) + { + if (node != null) + { + node.Name = "modified_" + node.Name; + foreach (Node child in node.GetChildren()) + { + Iterate(child); + } + } + } + } + [/csharp] + [/codeblocks] </description> <tutorials> <link title="Importing 3D scenes: Custom script">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link> diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index e96044bf48..60ccf451b8 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -7,13 +7,28 @@ Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [kbd]Ctrl + Shift + X[/kbd]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead. [b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled. [b]Example script:[/b] - [codeblock] + [codeblocks] + [gdscript] tool extends EditorScript func _run(): print("Hello from the Godot Editor!") - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + + [Tool] + public class HelloEditor : EditorScript + { + public override void _Run() + { + GD.Print("Hello from the Godot Editor!"); + } + } + [/csharp] + [/codeblocks] [b]Note:[/b] The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot [b]Output[/b] dock. </description> <tutorials> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 0c6a2d61cd..6088ae7a43 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -7,15 +7,24 @@ Object that holds the project-independent editor settings. These settings are generally visible in the [b]Editor > Editor Settings[/b] menu. Property names use slash delimiters to distinguish sections. Setting values can be of any [Variant] type. It's recommended to use [code]snake_case[/code] for editor settings to be consistent with the Godot editor itself. Accessing the settings can be done using the following methods, such as: - [codeblock] - # `settings.set("some/property", value)` also works as this class overrides `_set()` internally. - settings.set_setting("some/property",value) - - # `settings.get("some/property", value)` also works as this class overrides `_get()` internally. + [codeblocks] + [gdscript] + var settings = EditorInterface.get_editor_settings() + # `settings.set("some/property", 10)` also works as this class overrides `_set()` internally. + settings.set_setting("some/property", 10) + # `settings.get("some/property")` also works as this class overrides `_get()` internally. settings.get_setting("some/property") - var list_of_settings = settings.get_property_list() - [/codeblock] + [/gdscript] + [csharp] + EditorSettings settings = GetEditorInterface().GetEditorSettings(); + // `settings.set("some/property", value)` also works as this class overrides `_set()` internally. + settings.SetSetting("some/property", Value); + // `settings.get("some/property", value)` also works as this class overrides `_get()` internally. + settings.GetSetting("some/property"); + Godot.Collections.Array listOfSettings = settings.GetPropertyList(); + [/csharp] + [/codeblocks] [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings]. </description> <tutorials> @@ -32,8 +41,10 @@ - [code]type[/code]: [int] (see [enum Variant.Type]) - optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String] [b]Example:[/b] - [codeblock] - editor_settings.set("category/property_name", 0) + [codeblocks] + [gdscript] + var settings = EditorInterface.get_editor_settings() + settings.set("category/property_name", 0) var property_info = { "name": "category/property_name", @@ -42,8 +53,23 @@ "hint_string": "one,two,three" } - editor_settings.add_property_info(property_info) - [/codeblock] + settings.add_property_info(property_info) + [/gdscript] + [csharp] + var settings = GetEditorInterface().GetEditorSettings(); + settings.Set("category/property_name", 0); + + var propertyInfo = new Godot.Collections.Dictionary + { + {"name", "category/propertyName"}, + {"type", Variant.Type.Int}, + {"hint", PropertyHint.Enum}, + {"hint_string", "one,two,three"} + }; + + settings.AddPropertyInfo(propertyInfo); + [/csharp] + [/codeblocks] </description> </method> <method name="erase"> diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index f5204e7bab..c97459d9dc 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -9,45 +9,95 @@ When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples. The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu. Below shows an example of a custom parser that extracts strings from a CSV file to write into a POT. - [codeblock] + [codeblocks] + [gdscript] tool extends EditorTranslationParserPlugin - func parse_file(path, msgids, msgids_context_plural): var file = File.new() file.open(path, File.READ) var text = file.get_as_text() - var split_strs = text.split(",", false, 0) + var split_strs = text.split(",", false) for s in split_strs: msgids.append(s) #print("Extracted string: " + s) - func get_recognized_extensions(): return ["csv"] - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + + [Tool] + public class CustomParser : EditorTranslationParserPlugin + { + public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + { + var file = new File(); + file.Open(path, File.ModeFlags.Read); + string text = file.GetAsText(); + string[] splitStrs = text.Split(",", false); + foreach (var s in splitStrs) + { + msgids.Add(s); + //GD.Print("Extracted string: " + s) + } + } + + public override Godot.Collections.Array GetRecognizedExtensions() + { + return new Godot.Collections.Array{"csv"}; + } + } + [/csharp] + [/codeblocks] To add a translatable string associated with context or plural, add it to [code]msgids_context_plural[/code]: - [codeblock] + [codeblocks] + [gdscript] # This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". msgids_context_plural.append(["Test 1", "context", "test 1 plurals"]) # This will add a message with msgid "A test without context" and msgid_plural "plurals". msgids_context_plural.append(["A test without context", "", "plurals"]) # This will add a message with msgid "Only with context" and msgctxt "a friendly context". msgids_context_plural.append(["Only with context", "a friendly context", ""]) - [/codeblock] + [/gdscript] + [csharp] + // This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". + msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"}); + // This will add a message with msgid "A test without context" and msgid_plural "plurals". + msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"}); + // This will add a message with msgid "Only with context" and msgctxt "a friendly context". + msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""}); + [/csharp] + [/codeblocks] [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [File] type. For example: - [codeblock] + [codeblocks] + [gdscript] func parse_file(path, msgids, msgids_context_plural): var res = ResourceLoader.load(path, "Script") - var text = res.get_source_code() + var text = res.source_code # Parsing logic. - func get_recognized_extensions(): return ["gd"] - [/codeblock] + [/gdscript] + [csharp] + public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + { + var res = ResourceLoader.Load<Script>(path, "Script"); + string text = res.SourceCode; + // Parsing logic. + } + + public override Godot.Collections.Array GetRecognizedExtensions() + { + return new Godot.Collections.Array{"gd"}; + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 297cccaaac..fab8512e4a 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -117,12 +117,24 @@ [code]year[/code] - Holds the year the version was released in as an int [code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: - [codeblock] + [codeblocks] + [gdscript] if Engine.get_version_info().hex >= 0x030200: # Do things specific to version 3.2 or later else: # Do things specific to versions before 3.2 - [/codeblock] + [/gdscript] + [csharp] + if ((int)Engine.GetVersionInfo()["hex"] >= 0x030200) + { + // Do things specific to version 3.2 or later + } + else + { + // Do things specific to versions before 3.2 + } + [/csharp] + [/codeblocks] </description> </method> <method name="has_singleton" qualifiers="const"> diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index f2611dc850..d777c6fd9d 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -7,21 +7,46 @@ An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. An example expression text using the built-in math functions could be [code]sqrt(pow(3, 2) + pow(4, 2))[/code]. In the following example we use a [LineEdit] node to write our expression and show the result. - [codeblock] - onready var expression = Expression.new() + [codeblocks] + [gdscript] + var expression = Expression.new() func _ready(): $LineEdit.connect("text_entered", self, "_on_text_entered") func _on_text_entered(command): - var error = expression.parse(command, []) + var error = expression.parse(command) if error != OK: print(expression.get_error_text()) return - var result = expression.execute([], null, true) + var result = expression.execute() if not expression.has_execute_failed(): $LineEdit.text = str(result) - [/codeblock] + [/gdscript] + [csharp] + public Expression expression = new Expression(); + + public override void _Ready() + { + GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered)); + } + + private void OnTextEntered(string command) + { + Error error = expression.Parse(command); + if (error != Error.Ok) + { + GD.Print(expression.GetErrorText()); + return; + } + object result = expression.Execute(); + if (!expression.HasExecuteFailed()) + { + GetNode<LineEdit>("LineEdit").Text = result.ToString(); + } + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml deleted file mode 100644 index dc9246ad35..0000000000 --- a/doc/classes/FuncRef.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="FuncRef" inherits="Reference" version="4.0"> - <brief_description> - Reference to a function in an object. - </brief_description> - <description> - In GDScript, functions are not [i]first-class objects[/i]. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments. - However, by creating a [FuncRef] using the [method @GDScript.funcref] function, a reference to a function in a given object can be created, passed around and called. - </description> - <tutorials> - </tutorials> - <methods> - <method name="call_func" qualifiers="vararg"> - <return type="Variant"> - </return> - <description> - Calls the referenced function previously set in [member function] or [method @GDScript.funcref]. - </description> - </method> - <method name="call_funcv"> - <return type="Variant"> - </return> - <argument index="0" name="arg_array" type="Array"> - </argument> - <description> - Calls the referenced function previously set in [member function] or [method @GDScript.funcref]. Contrarily to [method call_func], this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array]. - </description> - </method> - <method name="is_valid" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns whether the object still exists and has the function assigned. - </description> - </method> - <method name="set_instance"> - <return type="void"> - </return> - <argument index="0" name="instance" type="Object"> - </argument> - <description> - The object containing the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary]. - </description> - </method> - </methods> - <members> - <member name="function" type="StringName" setter="set_function" getter="get_function" default="@"""> - The name of the referenced function. - </member> - </members> - <constants> - </constants> -</class> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index ba201af5db..c09151405a 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -52,10 +52,6 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map"> - Normal map to be used for the [member texture] property. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end. </member> diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index 86dc8e864a..a6bcc1301b 100644 --- a/doc/classes/Geometry2D.xml +++ b/doc/classes/Geometry2D.xml @@ -200,11 +200,11 @@ Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType]. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - [b]Note:[/b] To translate the polygon's vertices specifically, use the [method Transform2D.xform] method: + [b]Note:[/b] To translate the polygon's vertices specifically, multiply them to a [Transform2D]: [codeblock] var polygon = PackedVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) var offset = Vector2(50, 50) - polygon = Transform2D(0, offset).xform(polygon) + polygon = Transform2D(0, offset) * polygon print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)] [/codeblock] </description> diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index abb105a41c..4ccbdee144 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -4,7 +4,7 @@ A color interpolator resource which can be used to generate colors between user-defined color points. </brief_description> <description> - Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1. + Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the gradient will interpolate from color 1 to color 2 and from color 2 to color 3. The gradient will initially have 2 colors (black and white), one (black) at gradient lower offset 0 and the other (white) at the gradient higher offset 1. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="1" name="color" type="Color"> </argument> <description> - Adds the specified color to the end of the ramp, with the specified offset. + Adds the specified color to the end of the gradient, with the specified offset. </description> </method> <method name="get_color"> @@ -26,7 +26,7 @@ <argument index="0" name="point" type="int"> </argument> <description> - Returns the color of the ramp color at index [code]point[/code]. + Returns the color of the gradient color at index [code]point[/code]. </description> </method> <method name="get_offset"> @@ -35,14 +35,14 @@ <argument index="0" name="point" type="int"> </argument> <description> - Returns the offset of the ramp color at index [code]point[/code]. + Returns the offset of the gradient color at index [code]point[/code]. </description> </method> <method name="get_point_count" qualifiers="const"> <return type="int"> </return> <description> - Returns the number of colors in the ramp. + Returns the number of colors in the gradient. </description> </method> <method name="interpolate"> @@ -71,7 +71,7 @@ <argument index="1" name="color" type="Color"> </argument> <description> - Sets the color of the ramp color at index [code]point[/code]. + Sets the color of the gradient color at index [code]point[/code]. </description> </method> <method name="set_offset"> @@ -82,7 +82,7 @@ <argument index="1" name="offset" type="float"> </argument> <description> - Sets the offset for the ramp color at index [code]point[/code]. + Sets the offset for the gradient color at index [code]point[/code]. </description> </method> </methods> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 9dc38b018a..ec8ca7456a 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -9,6 +9,7 @@ A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header. + [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. </description> <tutorials> <link title="HTTP client class">https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link> @@ -180,7 +181,7 @@ <member name="connection" type="StreamPeer" setter="set_connection" getter="get_connection"> The connection to use for this client. </member> - <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="4096"> + <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="65536"> The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk]. </member> </members> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 8cc7ecfbe3..6eae881ffe 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -23,7 +23,7 @@ # Note: Don't make simultaneous requests using a single HTTPRequest node. # The snippet below is provided for reference only. var body = {"name": "Godette"} - var error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) + error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) if error != OK: push_error("An error occurred in the HTTP request.") @@ -65,11 +65,9 @@ texture_rect.texture = texture [/codeblock] - [b]Gzipped response bodies[/b] - HttpRequest will automatically handle decompression of response bodies. - A "Accept-Encoding" header will be automatically added to each of your requests, unless one is already specified. - Any response with a "Content-Encoding: gzip" header will automatically be decompressed and delivered to you as a uncompressed bytes. + [b]Gzipped response bodies[/b]: HTTPRequest will automatically handle decompression of response bodies. A [code]Accept-Encoding[/code] header will be automatically added to each of your requests, unless one is already specified. Any response with a [code]Content-Encoding: gzip[/code] header will automatically be decompressed and delivered to you as uncompressed bytes. [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header. + [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. </description> <tutorials> <link title="Making HTTP requests">https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link> @@ -153,9 +151,9 @@ <member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" default="-1"> Maximum allowed size for response bodies. If the response body is compressed, this will be used as the maximum allowed size for the decompressed body. </member> - <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="4096"> + <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="65536"> The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size]. - Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory. + Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. </member> <member name="download_file" type="String" setter="set_download_file" getter="get_download_file" default=""""> The file to download into. Will output any received file into it. diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 20be20db34..3b108468de 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -346,6 +346,16 @@ Loads an image from file [code]path[/code]. See [url=https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_images.html#supported-image-formats]Supported image formats[/url] for a list of supported image formats and limitations. </description> </method> + <method name="load_bmp_from_buffer"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="buffer" type="PackedByteArray"> + </argument> + <description> + Loads an image from the binary contents of a BMP file. + [b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported. + </description> + </method> <method name="load_jpg_from_buffer"> <return type="int" enum="Error"> </return> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index c5f0c2df8c..f6698352ab 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -11,8 +11,25 @@ <link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <methods> + <method name="get_height" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="set_height"> + <return type="void"> + </return> + <argument index="0" name="height" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> + <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="Light2D.BlendMode" default="0"> + The Light2D's blend mode. See [enum BlendMode] constants for values. + </member> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> The Light2D's [Color]. </member> @@ -25,15 +42,6 @@ <member name="energy" type="float" setter="set_energy" getter="get_energy" default="1.0"> The Light2D's energy value. The larger the value, the stronger the light. </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Light2D.Mode" default="0"> - The Light2D's mode. See [enum Mode] constants for values. - </member> - <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> - The offset of the Light2D's [code]texture[/code]. - </member> - <member name="range_height" type="float" setter="set_height" getter="get_height" default="0.0"> - The height of the Light2D. Used with 2D normal mapping. - </member> <member name="range_item_cull_mask" type="int" setter="set_item_cull_mask" getter="get_item_cull_mask" default="1"> The layer mask. Only objects with a matching mask will be affected by the Light2D. </member> @@ -49,9 +57,6 @@ <member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" default="-1024"> Minimum [code]z[/code] value of objects that are affected by the Light2D. </member> - <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size" default="2048"> - Shadow buffer size. - </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 0 )"> [Color] of shadows cast by the Light2D. </member> @@ -67,26 +72,8 @@ <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1"> The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching light mask will cast shadows. </member> - <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> - [Texture2D] used for the Light2D's appearance. - </member> - <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0"> - The [code]texture[/code]'s scale factor. - </member> </members> <constants> - <constant name="MODE_ADD" value="0" enum="Mode"> - Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. - </constant> - <constant name="MODE_SUB" value="1" enum="Mode"> - Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. - </constant> - <constant name="MODE_MIX" value="2" enum="Mode"> - Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. - </constant> - <constant name="MODE_MASK" value="3" enum="Mode"> - The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. - </constant> <constant name="SHADOW_FILTER_NONE" value="0" enum="ShadowFilter"> No filter applies to the shadow map. See [member shadow_filter]. </constant> @@ -96,5 +83,14 @@ <constant name="SHADOW_FILTER_PCF13" value="2" enum="ShadowFilter"> Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter]. </constant> + <constant name="BLEND_MODE_ADD" value="0" enum="BlendMode"> + Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. + </constant> + <constant name="BLEND_MODE_SUB" value="1" enum="BlendMode"> + Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. + </constant> + <constant name="BLEND_MODE_MIX" value="2" enum="BlendMode"> + Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. + </constant> </constants> </class> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 2d475fc449..15307de897 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -12,7 +12,6 @@ <methods> </methods> <members> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="2" /> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> The button's text that will be displayed inside the button's area. diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 55ae54d12b..3c3cbbfa29 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -78,38 +78,6 @@ If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. </description> </method> - <method name="finish"> - <return type="void"> - </return> - <description> - Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0. - </description> - </method> - <method name="idle"> - <return type="bool"> - </return> - <argument index="0" name="delta" type="float"> - </argument> - <description> - Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0. - </description> - </method> - <method name="init"> - <return type="void"> - </return> - <description> - Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0. - </description> - </method> - <method name="iteration"> - <return type="bool"> - </return> - <argument index="0" name="delta" type="float"> - </argument> - <description> - Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0. - </description> - </method> </methods> <signals> <signal name="on_request_permissions_result"> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index d97e0f0f21..fe38c08280 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -31,7 +31,6 @@ <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" override="true" enum="BaseButton.ActionMode" default="0" /> <member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" /> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false"> If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current [MenuButton] and open the other one. </member> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index 08ab01036c..b2e0442be8 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -32,10 +32,10 @@ </methods> <members> <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0"> - Doesn't do anything at the time of writing. + The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. </member> <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0"> - Doesn't do anything at the time of writing. + The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true"> If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. @@ -69,13 +69,15 @@ </signals> <constants> <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode"> - Doesn't do anything at the time of writing. + Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. </constant> <constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode"> - Doesn't do anything at the time of writing. + Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. + [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH]. </constant> <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode"> - Doesn't do anything at the time of writing. + Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges. + [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH]. </constant> </constants> </class> diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 658f0e6c28..93ede047fd 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -25,7 +25,23 @@ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> </tutorials> <methods> - <method name="NodePath"> + <method name="NodePath" qualifiers="constructor"> + <return type="NodePath"> + </return> + <description> + Constructs an empty [NodePath]. + </description> + </method> + <method name="NodePath" qualifiers="constructor"> + <return type="NodePath"> + </return> + <argument index="0" name="from" type="NodePath"> + </argument> + <description> + Constructs a [NodePath] as a copy of the given [NodePath]. + </description> + </method> + <method name="NodePath" qualifiers="constructor"> <return type="NodePath"> </return> <argument index="0" name="from" type="String"> @@ -65,7 +81,7 @@ </description> </method> <method name="get_concatenated_subnames"> - <return type="String"> + <return type="StringName"> </return> <description> Returns all subnames concatenated with a colon character ([code]:[/code]) as separator, i.e. the right side of the first colon in a node path. @@ -76,7 +92,7 @@ </description> </method> <method name="get_name"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -99,7 +115,7 @@ </description> </method> <method name="get_subname"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -134,6 +150,22 @@ Returns [code]true[/code] if the node path is empty. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="NodePath"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="NodePath"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 0b43522bce..4a6893879d 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -10,7 +10,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedByteArray"> + <method name="PackedByteArray" qualifiers="constructor"> + <return type="PackedByteArray"> + </return> + <description> + Constructs an empty [PackedByteArray]. + </description> + </method> + <method name="PackedByteArray" qualifiers="constructor"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="from" type="PackedByteArray"> + </argument> + <description> + Constructs a [PackedByteArray] as a copy of the given [PackedByteArray]. + </description> + </method> + <method name="PackedByteArray" qualifiers="constructor"> <return type="PackedByteArray"> </return> <argument index="0" name="from" type="Array"> @@ -20,9 +36,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="byte" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -128,9 +144,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="byte" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -143,10 +159,42 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedByteArray"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="right" type="PackedByteArray"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedByteArray"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="byte" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends an element at the end of the array. @@ -155,16 +203,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -173,9 +221,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="byte" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Changes the byte at the given index. diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index ec087e1b39..3065d16945 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -10,7 +10,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedColorArray"> + <method name="PackedColorArray" qualifiers="constructor"> + <return type="PackedColorArray"> + </return> + <description> + Constructs an empty [PackedColorArray]. + </description> + </method> + <method name="PackedColorArray" qualifiers="constructor"> + <return type="PackedColorArray"> + </return> + <argument index="0" name="from" type="PackedColorArray"> + </argument> + <description> + Constructs a [PackedColorArray] as a copy of the given [PackedColorArray]. + </description> + </method> + <method name="PackedColorArray" qualifiers="constructor"> <return type="PackedColorArray"> </return> <argument index="0" name="from" type="Array"> @@ -20,9 +36,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="color" type="Color"> + <argument index="0" name="value" type="Color"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -56,9 +72,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="color" type="Color"> + <argument index="1" name="value" type="Color"> </argument> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -71,10 +87,42 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedColorArray"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedColorArray"> + </return> + <argument index="0" name="right" type="PackedColorArray"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedColorArray"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="color" type="Color"> + <argument index="0" name="value" type="Color"> </argument> <description> Appends a value to the array. @@ -83,16 +131,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -101,9 +149,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="color" type="Color"> + <argument index="1" name="value" type="Color"> </argument> <description> Changes the [Color] at the given index. @@ -123,6 +171,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedColorArray"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index a6b726944b..ab9594d2e3 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -11,7 +11,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedFloat32Array"> + <method name="PackedFloat32Array" qualifiers="constructor"> + <return type="PackedFloat32Array"> + </return> + <description> + Constructs an empty [PackedFloat32Array]. + </description> + </method> + <method name="PackedFloat32Array" qualifiers="constructor"> + <return type="PackedFloat32Array"> + </return> + <argument index="0" name="from" type="PackedFloat32Array"> + </argument> + <description> + Constructs a [PackedFloat32Array] as a copy of the given [PackedFloat32Array]. + </description> + </method> + <method name="PackedFloat32Array" qualifiers="constructor"> <return type="PackedFloat32Array"> </return> <argument index="0" name="from" type="Array"> @@ -21,7 +37,7 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> <argument index="0" name="value" type="float"> </argument> @@ -57,7 +73,7 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -72,8 +88,32 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedFloat32Array"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedFloat32Array"> + </return> + <argument index="0" name="right" type="PackedFloat32Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedFloat32Array"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> <argument index="0" name="value" type="float"> </argument> @@ -84,16 +124,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,7 +142,7 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -124,6 +164,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedFloat32Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index f867cda3b6..3088aee483 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -11,7 +11,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedFloat64Array"> + <method name="PackedFloat64Array" qualifiers="constructor"> + <return type="PackedFloat64Array"> + </return> + <description> + Constructs an empty [PackedFloat64Array]. + </description> + </method> + <method name="PackedFloat64Array" qualifiers="constructor"> + <return type="PackedFloat64Array"> + </return> + <argument index="0" name="from" type="PackedFloat64Array"> + </argument> + <description> + Constructs a [PackedFloat64Array] as a copy of the given [PackedFloat64Array]. + </description> + </method> + <method name="PackedFloat64Array" qualifiers="constructor"> <return type="PackedFloat64Array"> </return> <argument index="0" name="from" type="Array"> @@ -21,7 +37,7 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> <argument index="0" name="value" type="float"> </argument> @@ -57,7 +73,7 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -72,8 +88,40 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedFloat64Array"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedFloat64Array"> + </return> + <argument index="0" name="right" type="PackedFloat64Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedFloat64Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> <argument index="0" name="value" type="float"> </argument> @@ -84,16 +132,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,7 +150,7 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -124,6 +172,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedFloat64Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index b796d9cacb..eded545de8 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -11,7 +11,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedInt32Array"> + <method name="PackedInt32Array" qualifiers="constructor"> + <return type="PackedInt32Array"> + </return> + <description> + Constructs an empty [PackedInt32Array]. + </description> + </method> + <method name="PackedInt32Array" qualifiers="constructor"> + <return type="PackedInt32Array"> + </return> + <argument index="0" name="from" type="PackedInt32Array"> + </argument> + <description> + Constructs a [PackedInt32Array] as a copy of the given [PackedInt32Array]. + </description> + </method> + <method name="PackedInt32Array" qualifiers="constructor"> <return type="PackedInt32Array"> </return> <argument index="0" name="from" type="Array"> @@ -21,9 +37,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="integer" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +73,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="integer" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -72,10 +88,42 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedInt32Array"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedInt32Array"> + </return> + <argument index="0" name="right" type="PackedInt32Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedInt32Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="integer" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends a value to the array. @@ -84,16 +132,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,9 +150,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="integer" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Changes the integer at the given index. @@ -124,6 +172,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedInt32Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 3d0d9a1360..83731b1023 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -11,7 +11,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedInt64Array"> + <method name="PackedInt64Array" qualifiers="constructor"> + <return type="PackedInt64Array"> + </return> + <description> + Constructs an empty [PackedInt64Array]. + </description> + </method> + <method name="PackedInt64Array" qualifiers="constructor"> + <return type="PackedInt64Array"> + </return> + <argument index="0" name="from" type="PackedInt64Array"> + </argument> + <description> + Constructs a [PackedInt64Array] as a copy of the given [PackedInt64Array]. + </description> + </method> + <method name="PackedInt64Array" qualifiers="constructor"> <return type="PackedInt64Array"> </return> <argument index="0" name="from" type="Array"> @@ -21,9 +37,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="integer" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +73,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="integer" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -72,10 +88,42 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedInt64Array"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedInt64Array"> + </return> + <argument index="0" name="right" type="PackedInt64Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedInt64Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="integer" type="int"> + <argument index="0" name="value" type="int"> </argument> <description> Appends a value to the array. @@ -84,16 +132,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,9 +150,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="integer" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Changes the integer at the given index. @@ -124,6 +172,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedInt64Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 5f3a16ac73..c71f5ffa7e 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -11,7 +11,23 @@ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> <methods> - <method name="PackedStringArray"> + <method name="PackedStringArray" qualifiers="constructor"> + <return type="PackedStringArray"> + </return> + <description> + Constructs an empty [PackedStringArray]. + </description> + </method> + <method name="PackedStringArray" qualifiers="constructor"> + <return type="PackedStringArray"> + </return> + <argument index="0" name="from" type="PackedStringArray"> + </argument> + <description> + Constructs a [PackedStringArray] as a copy of the given [PackedStringArray]. + </description> + </method> + <method name="PackedStringArray" qualifiers="constructor"> <return type="PackedStringArray"> </return> <argument index="0" name="from" type="Array"> @@ -21,9 +37,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="string" type="String"> + <argument index="0" name="value" type="String"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +73,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="string" type="String"> + <argument index="1" name="value" type="String"> </argument> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -72,10 +88,42 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedStringArray"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedStringArray"> + </return> + <argument index="0" name="right" type="PackedStringArray"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedStringArray"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="String"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="string" type="String"> + <argument index="0" name="value" type="String"> </argument> <description> Appends a string element at end of the array. @@ -84,16 +132,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,9 +150,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="string" type="String"> + <argument index="1" name="value" type="String"> </argument> <description> Changes the [String] at the given index. @@ -124,6 +172,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedStringArray"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index cb62aea95c..5f68d9256d 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -11,7 +11,23 @@ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> </tutorials> <methods> - <method name="PackedVector2Array"> + <method name="PackedVector2Array" qualifiers="constructor"> + <return type="PackedVector2Array"> + </return> + <description> + Constructs an empty [PackedVector2Array]. + </description> + </method> + <method name="PackedVector2Array" qualifiers="constructor"> + <return type="PackedVector2Array"> + </return> + <argument index="0" name="from" type="PackedVector2Array"> + </argument> + <description> + Constructs a [PackedVector2Array] as a copy of the given [PackedVector2Array]. + </description> + </method> + <method name="PackedVector2Array" qualifiers="constructor"> <return type="PackedVector2Array"> </return> <argument index="0" name="from" type="Array"> @@ -21,9 +37,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="vector2" type="Vector2"> + <argument index="0" name="value" type="Vector2"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +73,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="vector2" type="Vector2"> + <argument index="1" name="value" type="Vector2"> </argument> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -72,10 +88,50 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedVector2Array"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="PackedVector2Array"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedVector2Array"> + </return> + <argument index="0" name="right" type="PackedVector2Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedVector2Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="vector2" type="Vector2"> + <argument index="0" name="value" type="Vector2"> </argument> <description> Inserts a [Vector2] at the end. @@ -84,16 +140,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -102,9 +158,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="vector2" type="Vector2"> + <argument index="1" name="value" type="Vector2"> </argument> <description> Changes the [Vector2] at the given index. @@ -124,6 +180,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedVector2Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index f268fbcc83..e681e1deb7 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -10,7 +10,23 @@ <tutorials> </tutorials> <methods> - <method name="PackedVector3Array"> + <method name="PackedVector3Array" qualifiers="constructor"> + <return type="PackedVector3Array"> + </return> + <description> + Constructs an empty [PackedVector3Array]. + </description> + </method> + <method name="PackedVector3Array" qualifiers="constructor"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="from" type="PackedVector3Array"> + </argument> + <description> + Constructs a [PackedVector3Array] as a copy of the given [PackedVector3Array]. + </description> + </method> + <method name="PackedVector3Array" qualifiers="constructor"> <return type="PackedVector3Array"> </return> <argument index="0" name="from" type="Array"> @@ -20,9 +36,9 @@ </description> </method> <method name="append"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="vector3" type="Vector3"> + <argument index="0" name="value" type="Vector3"> </argument> <description> Appends an element at the end of the array (alias of [method push_back]). @@ -56,9 +72,9 @@ <method name="insert"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="at_index" type="int"> </argument> - <argument index="1" name="vector3" type="Vector3"> + <argument index="1" name="value" type="Vector3"> </argument> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). @@ -71,10 +87,50 @@ Reverses the order of the elements in the array. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedVector3Array"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="right" type="PackedVector3Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="PackedVector3Array"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="push_back"> - <return type="void"> + <return type="bool"> </return> - <argument index="0" name="vector3" type="Vector3"> + <argument index="0" name="value" type="Vector3"> </argument> <description> Inserts a [Vector3] at the end. @@ -83,16 +139,16 @@ <method name="remove"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> <description> Removes an element from the array by index. </description> </method> <method name="resize"> - <return type="void"> + <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="new_size" type="int"> </argument> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. @@ -101,9 +157,9 @@ <method name="set"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="vector3" type="Vector3"> + <argument index="1" name="value" type="Vector3"> </argument> <description> Changes the [Vector3] at the given index. @@ -123,6 +179,22 @@ Sorts the elements of the array in ascending order. </description> </method> + <method name="subarray"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + </description> + </method> + <method name="to_byte_array"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 668655b725..cab821b4c0 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -25,7 +25,7 @@ </argument> <description> Calling this method connects this UDP peer to the given [code]host[/code]/[code]port[/code] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer]. - Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. + [b]Note:[/b] Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. </description> </method> <method name="get_packet_ip" qualifiers="const"> @@ -123,6 +123,18 @@ </return> <description> Waits for a packet to arrive on the listening port. See [method listen]. + [b]Note:[/b] [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: + [codeblock] + # Server + socket.set_dest_address("127.0.0.1", 789) + socket.put_packet("Time to stop".to_ascii()) + + # Client + while socket.wait() == OK: + var data = socket.get_packet().get_string_from_ascii() + if data == "Time to stop": + return + [/codeblock] </description> </method> </methods> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index d420e6ccdc..e3242512c4 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -10,7 +10,23 @@ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> - <method name="Plane"> + <method name="Plane" qualifiers="constructor"> + <return type="Plane"> + </return> + <description> + Constructs a default-initialized [Plane] with all components set to [code]0[/code]. + </description> + </method> + <method name="Plane" qualifiers="constructor"> + <return type="Plane"> + </return> + <argument index="0" name="from" type="Plane"> + </argument> + <description> + Constructs a [Plane] as a copy of the given [Plane]. + </description> + </method> + <method name="Plane" qualifiers="constructor"> <return type="Plane"> </return> <argument index="0" name="a" type="float"> @@ -25,28 +41,39 @@ Creates a plane from the four parameters. The three components of the resulting plane's [member normal] are [code]a[/code], [code]b[/code] and [code]c[/code], and the plane has a distance of [code]d[/code] from the origin. </description> </method> - <method name="Plane"> + <method name="Plane" qualifiers="constructor"> <return type="Plane"> </return> - <argument index="0" name="v1" type="Vector3"> + <argument index="0" name="normal" type="Vector3"> </argument> - <argument index="1" name="v2" type="Vector3"> + <argument index="1" name="d" type="float"> </argument> - <argument index="2" name="v3" type="Vector3"> + <description> + Creates a plane from the normal and the plane's distance to the origin. + </description> + </method> + <method name="Plane" qualifiers="constructor"> + <return type="Plane"> + </return> + <argument index="0" name="point" type="Vector3"> + </argument> + <argument index="1" name="normal" type="Vector3"> </argument> <description> - Creates a plane from the three points, given in clockwise order. + Creates a plane from the given position and a plane normal. </description> </method> - <method name="Plane"> + <method name="Plane" qualifiers="constructor"> <return type="Plane"> </return> - <argument index="0" name="normal" type="Vector3"> + <argument index="0" name="point1" type="Vector3"> </argument> - <argument index="1" name="d" type="float"> + <argument index="1" name="point2" type="Vector3"> + </argument> + <argument index="2" name="point3" type="Vector3"> </argument> <description> - Creates a plane from the normal and the plane's distance to the origin. + Creates a plane from the three points, given in clockwise order. </description> </method> <method name="center"> @@ -77,7 +104,7 @@ </description> </method> <method name="intersect_3"> - <return type="Vector3"> + <return type="Variant"> </return> <argument index="0" name="b" type="Plane"> </argument> @@ -88,7 +115,7 @@ </description> </method> <method name="intersects_ray"> - <return type="Vector3"> + <return type="Variant"> </return> <argument index="0" name="from" type="Vector3"> </argument> @@ -99,11 +126,11 @@ </description> </method> <method name="intersects_segment"> - <return type="Vector3"> + <return type="Variant"> </return> - <argument index="0" name="begin" type="Vector3"> + <argument index="0" name="from" type="Vector3"> </argument> - <argument index="1" name="end" type="Vector3"> + <argument index="1" name="to" type="Vector3"> </argument> <description> Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned. @@ -112,7 +139,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="plane" type="Plane"> + <argument index="0" name="to_plane" type="Plane"> </argument> <description> Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -121,7 +148,7 @@ <method name="is_point_over"> <return type="bool"> </return> - <argument index="0" name="point" type="Vector3"> + <argument index="0" name="plane" type="Vector3"> </argument> <description> Returns [code]true[/code] if [code]point[/code] is located above the plane. @@ -134,6 +161,34 @@ Returns a copy of the plane, normalized. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Plane"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Plane"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Plane"> + </return> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Plane"> + </argument> + <description> + </description> + </method> <method name="project"> <return type="Vector3"> </return> diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml new file mode 100644 index 0000000000..9337bc8351 --- /dev/null +++ b/doc/classes/PointLight2D.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PointLight2D" inherits="Light2D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="height" type="float" setter="set_height" getter="get_height" default="0.0"> + The height of the light. Used with 2D normal mapping. + </member> + <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> + The offset of the light's [member texture]. + </member> + <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> + [Texture2D] used for the light's appearance. + </member> + <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0"> + The [member texture]'s scale factor. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 335df1ac3f..3aca83658d 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -101,10 +101,6 @@ <member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false"> If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code]. </member> - <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map"> - The normal map gives depth to the Polygon2D. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> The offset applied to each vertex. </member> @@ -114,14 +110,8 @@ </member> <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[ ]"> </member> - <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0"> - </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> </member> - <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )"> - </member> - <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map"> - </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. </member> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 91998ead34..7ca2dae4d7 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -435,19 +435,24 @@ If [code]true[/code], the home indicator is hidden automatically. This only affects iOS devices without a physical home button. </member> <member name="display/window/size/always_on_top" type="bool" setter="" getter="" default="false"> - Force the window to be always on top. + Forces the main window to be always on top. + [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5. </member> <member name="display/window/size/borderless" type="bool" setter="" getter="" default="false"> - Force the window to be borderless. + Forces the main window to be borderless. + [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5. </member> <member name="display/window/size/fullscreen" type="bool" setter="" getter="" default="false"> - Sets the window to full screen when it starts. + Sets the main window to full screen when the project starts. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. + Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode. + [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5. </member> <member name="display/window/size/height" type="int" setter="" getter="" default="600"> Sets the game's main viewport height. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled. </member> <member name="display/window/size/resizable" type="bool" setter="" getter="" default="true"> Allows the window to be resizable by default. + [b]Note:[/b] This setting is ignored on iOS and Android. </member> <member name="display/window/size/test_height" type="int" setter="" getter="" default="0"> If greater than zero, overrides the window height when running the game. Useful for testing stretch modes. @@ -818,6 +823,8 @@ <member name="logging/file_logging/max_log_files" type="int" setter="" getter="" default="5"> Specifies the maximum amount of log files allowed (used for rotation). </member> + <member name="memory/limits/command_queue/multithreading_queue_size_kb" type="int" setter="" getter="" default="256"> + </member> <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="4096"> Godot uses a message queue to defer some function calls. If you run out of space on it (you will see an error), you can increase the size here. </member> @@ -1004,8 +1011,11 @@ </member> <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> </member> - <member name="rendering/quality/2d/use_pixel_snap" type="bool" setter="" getter="" default="false"> - If [code]true[/code], forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles. + <member name="rendering/quality/2d/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false"> + </member> + <member name="rendering/quality/2d/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> + </member> + <member name="rendering/quality/2d_shadow_atlas/size" type="int" setter="" getter="" default="2048"> </member> <member name="rendering/quality/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2"> Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. @@ -1102,6 +1112,8 @@ </member> <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_limit" type="float" setter="" getter="" default="0.18"> </member> + <member name="rendering/quality/screen_filters/use_debanding" type="bool" setter="" getter="" default="false"> + </member> <member name="rendering/quality/screen_space_reflection/roughness_quality" type="int" setter="" getter="" default="1"> Sets the quality for rough screen-space reflections. Turning off will make all screen space reflections sharp, while higher values make rough reflections look better. </member> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 6c95e303b8..5932a624f2 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -13,25 +13,33 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> - <method name="Quat"> + <method name="Quat" qualifiers="constructor"> <return type="Quat"> </return> - <argument index="0" name="from" type="Basis"> + <description> + Constructs a default-initialized quaternion with all components set to [code]0[/code]. + </description> + </method> + <method name="Quat" qualifiers="constructor"> + <return type="Quat"> + </return> + <argument index="0" name="from" type="Quat"> </argument> <description> - Constructs a quaternion from the given [Basis]. + Constructs a [Quat] as a copy of the given [Quat]. </description> </method> - <method name="Quat"> + <method name="Quat" qualifiers="constructor"> <return type="Quat"> </return> - <argument index="0" name="euler" type="Vector3"> + <argument index="0" name="arc_from" type="Vector3"> + </argument> + <argument index="1" name="arc_to" type="Vector3"> </argument> <description> - Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). </description> </method> - <method name="Quat"> + <method name="Quat" qualifiers="constructor"> <return type="Quat"> </return> <argument index="0" name="axis" type="Vector3"> @@ -42,7 +50,25 @@ Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. </description> </method> - <method name="Quat"> + <method name="Quat" qualifiers="constructor"> + <return type="Quat"> + </return> + <argument index="0" name="euler" type="Vector3"> + </argument> + <description> + Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). + </description> + </method> + <method name="Quat" qualifiers="constructor"> + <return type="Quat"> + </return> + <argument index="0" name="from" type="Basis"> + </argument> + <description> + Constructs a quaternion from the given [Basis]. + </description> + </method> + <method name="Quat" qualifiers="constructor"> <return type="Quat"> </return> <argument index="0" name="x" type="float"> @@ -75,7 +101,7 @@ <method name="dot"> <return type="float"> </return> - <argument index="0" name="b" type="Quat"> + <argument index="0" name="with" type="Quat"> </argument> <description> Returns the dot product of two quaternions. @@ -98,7 +124,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="quat" type="Quat"> + <argument index="0" name="to" type="Quat"> </argument> <description> Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -132,24 +158,96 @@ Returns a copy of the quaternion, normalized to unit length. </description> </method> - <method name="set_axis_angle"> - <return type="void"> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> </return> - <argument index="0" name="axis" type="Vector3"> + <argument index="0" name="right" type="Quat"> </argument> - <argument index="1" name="angle" type="float"> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> </argument> <description> - Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector. </description> </method> - <method name="set_euler"> - <return type="void"> + <method name="operator *" qualifiers="operator"> + <return type="Quat"> </return> - <argument index="0" name="euler" type="Vector3"> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Quat"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Quat"> + </return> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> </argument> <description> - Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). </description> </method> <method name="slerp"> @@ -175,15 +273,6 @@ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees. </description> </method> - <method name="xform"> - <return type="Vector3"> - </return> - <argument index="0" name="v" type="Vector3"> - </argument> - <description> - Returns a vector transformed (multiplied) by this quaternion. - </description> - </method> </methods> <members> <member name="w" type="float" setter="" getter="" default="1.0"> diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index 644c427120..0ee34d4194 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -9,13 +9,20 @@ <tutorials> </tutorials> <methods> - <method name="RID"> + <method name="RID" qualifiers="constructor"> <return type="RID"> </return> - <argument index="0" name="from" type="Object"> + <description> + Constructs an empty [RID] with the invalid ID [code]0[/code]. + </description> + </method> + <method name="RID" qualifiers="constructor"> + <return type="RID"> + </return> + <argument index="0" name="from" type="RID"> </argument> <description> - Creates a new RID instance with the ID of a given resource. When not handed a valid resource, silently stores the unused ID 0. + Constructs a [RID] as a copy of the given [RID]. </description> </method> <method name="get_id"> @@ -25,6 +32,54 @@ Returns the ID of the referenced resource. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="RID"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml index d4f9517dd1..dcb75dc275 100644 --- a/doc/classes/RandomNumberGenerator.xml +++ b/doc/classes/RandomNumberGenerator.xml @@ -74,9 +74,10 @@ </method> </methods> <members> - <member name="seed" type="int" setter="set_seed" getter="get_seed" default="-6398989897141750821"> + <member name="seed" type="int" setter="set_seed" getter="get_seed" default="0"> The seed used by the random number generator. A given seed will give a reproducible sequence of pseudo-random numbers. [b]Note:[/b] The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. + [b]Note:[/b] The default value of this property is pseudo-random, and changes when calling [method randomize]. The [code]0[/code] value documented here is a placeholder, and not the actual default seed. </member> </members> <constants> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index aaeaa7629d..02a77a0e24 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -14,7 +14,32 @@ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link> </tutorials> <methods> - <method name="Rect2"> + <method name="Rect2" qualifiers="constructor"> + <return type="Rect2"> + </return> + <description> + Constructs a default-initialized [Rect2] with default (zero) values of [member position] and [member size]. + </description> + </method> + <method name="Rect2" qualifiers="constructor"> + <return type="Rect2"> + </return> + <argument index="0" name="from" type="Rect2"> + </argument> + <description> + Constructs a [Rect2] as a copy of the given [Rect2]. + </description> + </method> + <method name="Rect2" qualifiers="constructor"> + <return type="Rect2"> + </return> + <argument index="0" name="from" type="Rect2i"> + </argument> + <description> + Constructs a [Rect2] from a [Rect2i]. + </description> + </method> + <method name="Rect2" qualifiers="constructor"> <return type="Rect2"> </return> <argument index="0" name="position" type="Vector2"> @@ -25,7 +50,7 @@ Constructs a [Rect2] by position and size. </description> </method> - <method name="Rect2"> + <method name="Rect2" qualifiers="constructor"> <return type="Rect2"> </return> <argument index="0" name="x" type="float"> @@ -40,15 +65,6 @@ Constructs a [Rect2] by x, y, width, and height. </description> </method> - <method name="Rect2"> - <return type="Rect2"> - </return> - <argument index="0" name="from" type="Rect2i"> - </argument> - <description> - Constructs a [Rect2] from a [Rect2i]. - </description> - </method> <method name="abs"> <return type="Rect2"> </return> @@ -108,7 +124,7 @@ </argument> <argument index="2" name="right" type="float"> </argument> - <argument index="3" name=" bottom" type="float"> + <argument index="3" name="bottom" type="float"> </argument> <description> Returns a copy of the [Rect2] grown a given amount of units towards each direction individually. @@ -171,6 +187,30 @@ Returns a larger [Rect2] that contains this [Rect2] and [code]b[/code]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Rect2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Rect2"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Rect2"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="end" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 8b29daa264..e8b75a6ac6 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -12,18 +12,43 @@ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link> </tutorials> <methods> - <method name="Rect2i"> + <method name="Rect2i" qualifiers="constructor"> <return type="Rect2i"> </return> - <argument index="0" name="position" type="Vector2"> + <description> + Constructs a default-initialized [Rect2i] with default (zero) values of [member position] and [member size]. + </description> + </method> + <method name="Rect2i" qualifiers="constructor"> + <return type="Rect2i"> + </return> + <argument index="0" name="from" type="Rect2i"> + </argument> + <description> + Constructs a [Rect2i] as a copy of the given [Rect2i]. + </description> + </method> + <method name="Rect2i" qualifiers="constructor"> + <return type="Rect2i"> + </return> + <argument index="0" name="from" type="Rect2"> + </argument> + <description> + Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. + </description> + </method> + <method name="Rect2i" qualifiers="constructor"> + <return type="Rect2i"> + </return> + <argument index="0" name="position" type="Vector2i"> </argument> - <argument index="1" name="size" type="Vector2"> + <argument index="1" name="size" type="Vector2i"> </argument> <description> Constructs a [Rect2i] by position and size. </description> </method> - <method name="Rect2i"> + <method name="Rect2i" qualifiers="constructor"> <return type="Rect2i"> </return> <argument index="0" name="x" type="int"> @@ -38,15 +63,6 @@ Constructs a [Rect2i] by x, y, width, and height. </description> </method> - <method name="Rect2i"> - <return type="Rect2i"> - </return> - <argument index="0" name="from" type="Rect2"> - </argument> - <description> - Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. - </description> - </method> <method name="abs"> <return type="Rect2i"> </return> @@ -106,7 +122,7 @@ </argument> <argument index="2" name="right" type="int"> </argument> - <argument index="3" name=" bottom" type="int"> + <argument index="3" name="bottom" type="int"> </argument> <description> Returns a copy of the [Rect2i] grown a given amount of units towards each direction individually. @@ -158,6 +174,22 @@ Returns a larger [Rect2i] that contains this [Rect2i] and [code]b[/code]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Rect2i"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Rect2i"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 857c13deb5..5830a8452c 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -404,28 +404,6 @@ The mode of the light, see [enum CanvasLightMode] constants. </description> </method> - <method name="canvas_light_set_scale"> - <return type="void"> - </return> - <argument index="0" name="light" type="RID"> - </argument> - <argument index="1" name="scale" type="float"> - </argument> - <description> - Sets the texture's scale factor of the light. Equivalent to [member Light2D.texture_scale]. - </description> - </method> - <method name="canvas_light_set_shadow_buffer_size"> - <return type="void"> - </return> - <argument index="0" name="light" type="RID"> - </argument> - <argument index="1" name="size" type="int"> - </argument> - <description> - Sets the width of the shadow buffer, size gets scaled to the next power of two for this. - </description> - </method> <method name="canvas_light_set_shadow_color"> <return type="void"> </return> @@ -478,7 +456,7 @@ <argument index="1" name="texture" type="RID"> </argument> <description> - Sets texture to be used by light. Equivalent to [member Light2D.texture]. + Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture]. </description> </method> <method name="canvas_light_set_texture_offset"> @@ -489,7 +467,18 @@ <argument index="1" name="offset" type="Vector2"> </argument> <description> - Sets the offset of the light's texture. Equivalent to [member Light2D.offset]. + Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset]. + </description> + </method> + <method name="canvas_light_set_texture_scale"> + <return type="void"> + </return> + <argument index="0" name="light" type="RID"> + </argument> + <argument index="1" name="scale" type="float"> + </argument> + <description> + Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale]. </description> </method> <method name="canvas_light_set_transform"> @@ -708,6 +697,8 @@ </argument> <argument index="7" name="height_density" type="float"> </argument> + <argument index="8" name="aerial_perspective" type="float"> + </argument> <description> </description> </method> @@ -2965,6 +2956,16 @@ Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options. </description> </method> + <method name="viewport_set_use_debanding"> + <return type="void"> + </return> + <argument index="0" name="viewport" type="RID"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="viewport_set_use_xr"> <return type="void"> </return> @@ -3674,18 +3675,25 @@ <constant name="CANVAS_ITEM_TEXTURE_REPEAT_MAX" value="4" enum="CanvasItemTextureRepeat"> Max value for [enum CanvasItemTextureRepeat] enum. </constant> - <constant name="CANVAS_LIGHT_MODE_ADD" value="0" enum="CanvasLightMode"> + <constant name="CANVAS_GROUP_MODE_DISABLED" value="0" enum="CanvasGroupMode"> + </constant> + <constant name="CANVAS_GROUP_MODE_OPAQUE" value="1" enum="CanvasGroupMode"> + </constant> + <constant name="CANVAS_GROUP_MODE_TRANSPARENT" value="2" enum="CanvasGroupMode"> + </constant> + <constant name="CANVAS_LIGHT_MODE_POINT" value="0" enum="CanvasLightMode"> + </constant> + <constant name="CANVAS_LIGHT_MODE_DIRECTIONAL" value="1" enum="CanvasLightMode"> + </constant> + <constant name="CANVAS_LIGHT_BLEND_MODE_ADD" value="0" enum="CanvasLightBlendMode"> Adds light color additive to the canvas. </constant> - <constant name="CANVAS_LIGHT_MODE_SUB" value="1" enum="CanvasLightMode"> + <constant name="CANVAS_LIGHT_BLEND_MODE_SUB" value="1" enum="CanvasLightBlendMode"> Adds light color subtractive to the canvas. </constant> - <constant name="CANVAS_LIGHT_MODE_MIX" value="2" enum="CanvasLightMode"> + <constant name="CANVAS_LIGHT_BLEND_MODE_MIX" value="2" enum="CanvasLightBlendMode"> The light adds color depending on transparency. </constant> - <constant name="CANVAS_LIGHT_MODE_MASK" value="3" enum="CanvasLightMode"> - The light adds color depending on mask. - </constant> <constant name="CANVAS_LIGHT_FILTER_NONE" value="0" enum="CanvasLightShadowFilter"> Do not apply a filter to canvas light shadows. </constant> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 1a05c02b60..b7a2258fc1 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -8,15 +8,31 @@ <tutorials> </tutorials> <methods> - <method name="Signal"> + <method name="Signal" qualifiers="constructor"> + <return type="Signal"> + </return> + <description> + Constructs a null [Signal] with no object nor signal name bound. + </description> + </method> + <method name="Signal" qualifiers="constructor"> + <return type="Signal"> + </return> + <argument index="0" name="from" type="Signal"> + </argument> + <description> + Constructs a [Signal] as a copy of the given [Signal]. + </description> + </method> + <method name="Signal" qualifiers="constructor"> <return type="Signal"> </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="signal_name" type="StringName"> + <argument index="1" name="signal" type="StringName"> </argument> <description> - Creates a new signal named [code]signal_name[/code] in the given object. + Creates a new [Signal] with the name [code]signal[/code] in the specified [code]object[/code]. </description> </method> <method name="connect"> @@ -33,7 +49,7 @@ </description> </method> <method name="disconnect"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="callable" type="Callable"> </argument> @@ -91,6 +107,22 @@ <description> </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Signal"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Signal"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 8205889ea7..c56596423d 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -53,10 +53,6 @@ <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. </member> - <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map"> - The normal map gives depth to the Sprite2D. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> The texture's drawing offset. </member> @@ -69,15 +65,6 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> - <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0"> - Strength of the specular light effect of this [Sprite2D]. - </member> - <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )"> - The color of the specular light effect. - </member> - <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map"> - The specular map is used for more control on the shininess effect. - </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] object to draw. </member> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 4034a5ee07..4ee9dbf1f9 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -10,160 +10,23 @@ <link title="GDScript format strings">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link> </tutorials> <methods> - <method name="String"> + <method name="String" qualifiers="constructor"> <return type="String"> </return> - <argument index="0" name="from" type="bool"> - </argument> <description> - Constructs a new String from the given [bool]. + Constructs an empty [String] ([code]""[/code]). </description> </method> - <method name="String"> + <method name="String" qualifiers="constructor"> <return type="String"> </return> - <argument index="0" name="from" type="int"> + <argument index="0" name="from" type="String"> </argument> <description> - Constructs a new String from the given [int]. + Constructs a [String] as a copy of the given [String]. </description> </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="float"> - </argument> - <description> - Constructs a new String from the given [float]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Vector2"> - </argument> - <description> - Constructs a new String from the given [Vector2]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Vector2i"> - </argument> - <description> - Constructs a new String from the given [Vector2i]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Rect2"> - </argument> - <description> - Constructs a new String from the given [Rect2]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Rect2i"> - </argument> - <description> - Constructs a new String from the given [Rect2i]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <description> - Constructs a new String from the given [Vector3]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Vector3i"> - </argument> - <description> - Constructs a new String from the given [Vector3i]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Transform2D"> - </argument> - <description> - Constructs a new String from the given [Transform2D]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Plane"> - </argument> - <description> - Constructs a new String from the given [Plane]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Quat"> - </argument> - <description> - Constructs a new String from the given [Quat]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="AABB"> - </argument> - <description> - Constructs a new String from the given [AABB]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Basis"> - </argument> - <description> - Constructs a new String from the given [Basis]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Transform"> - </argument> - <description> - Constructs a new String from the given [Transform]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Color"> - </argument> - <description> - Constructs a new String from the given [Color]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="StringName"> - </argument> - <description> - Constructs a new String from the given [StringName]. - </description> - </method> - <method name="String"> + <method name="String" qualifiers="constructor"> <return type="String"> </return> <argument index="0" name="from" type="NodePath"> @@ -172,130 +35,13 @@ Constructs a new String from the given [NodePath]. </description> </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="RID"> - </argument> - <description> - Constructs a new String from the given [RID]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Callable"> - </argument> - <description> - Constructs a new String from the given [Callable]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Signal"> - </argument> - <description> - Constructs a new String from the given [Signal]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Dictionary"> - </argument> - <description> - Constructs a new String from the given [Dictionary]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="Array"> - </argument> - <description> - Constructs a new String from the given [Array]. - </description> - </method> - <method name="String"> + <method name="String" qualifiers="constructor"> <return type="String"> </return> - <argument index="0" name="from" type="PackedByteArray"> - </argument> - <description> - Constructs a new String from the given [PackedByteArray]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedInt32Array"> - </argument> - <description> - Constructs a new String from the given [PackedInt32Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedInt64Array"> - </argument> - <description> - Constructs a new String from the given [PackedInt64Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedFloat32Array"> - </argument> - <description> - Constructs a new String from the given [PackedFloat32Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedFloat64Array"> - </argument> - <description> - Constructs a new String from the given [PackedFloat64Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedStringArray"> - </argument> - <description> - Constructs a new String from the given [PackedStringArray]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedVector2Array"> - </argument> - <description> - Constructs a new String from the given [PackedVector2Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedVector3Array"> - </argument> - <description> - Constructs a new String from the given [PackedVector3Array]. - </description> - </method> - <method name="String"> - <return type="String"> - </return> - <argument index="0" name="from" type="PackedColorArray"> + <argument index="0" name="from" type="StringName"> </argument> <description> - Constructs a new String from the given [PackedColorArray]. + Constructs a new String from the given [StringName]. </description> </method> <method name="begins_with"> @@ -314,6 +60,14 @@ Returns the bigrams (pairs of consecutive letters) of this string. </description> </method> + <method name="bin_to_int"> + <return type="int"> + </return> + <argument index="0" name="with_prefix" type="bool" default="true"> + </argument> + <description> + </description> + </method> <method name="c_escape"> <return type="String"> </return> @@ -397,17 +151,6 @@ Returns [code]true[/code] if the string ends with the given string. </description> </method> - <method name="erase"> - <return type="void"> - </return> - <argument index="0" name="position" type="int"> - </argument> - <argument index="1" name="chars" type="int"> - </argument> - <description> - Erases [code]chars[/code] characters from the string starting from [code]position[/code]. - </description> - </method> <method name="find"> <return type="int"> </return> @@ -485,10 +228,13 @@ <method name="hex_to_int"> <return type="int"> </return> + <argument index="0" name="with_prefix" type="bool" default="true"> + </argument> <description> - Converts a string containing a hexadecimal number into an integer. Hexadecimal strings are expected to be prefixed with "[code]0x[/code]" otherwise [code]0[/code] is returned. + Converts a string containing a hexadecimal number into a decimal integer. If [code]with_prefix[/code] is [code]true[/code], the hexadecimal string should start with the [code]0x[/code] prefix, otherwise [code]0[/code] is returned. [codeblock] print("0xff".hex_to_int()) # Print "255" + print("ab".hex_to_int(false)) # Print "171" [/codeblock] </description> </method> @@ -512,20 +258,6 @@ [/codeblock] </description> </method> - <method name="humanize_size"> - <return type="String"> - </return> - <argument index="0" name="size" type="int"> - </argument> - <description> - Converts [code]size[/code] represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units. - [codeblock] - var bytes = 133790307 - var size = String.humanize_size(bytes) - print(size) # prints "127.5 MiB" - [/codeblock] - </description> - </method> <method name="insert"> <return type="String"> </return> @@ -734,6 +466,86 @@ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to] and [method naturalnocasecmp_to]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="String"> + </return> + <argument index="0" name="right" type="Variant"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="String"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> <method name="ord_at"> <return type="int"> </return> @@ -990,11 +802,11 @@ Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using [code]-1[/code] will return remaining characters from given position. </description> </method> - <method name="to_ascii"> + <method name="to_ascii_buffer"> <return type="PackedByteArray"> </return> <description> - Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces. + Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8_buffer], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces. </description> </method> <method name="to_float"> @@ -1025,25 +837,25 @@ Returns the string converted to uppercase. </description> </method> - <method name="to_utf16"> + <method name="to_utf16_buffer"> <return type="PackedByteArray"> </return> <description> Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes). </description> </method> - <method name="to_utf32"> + <method name="to_utf32_buffer"> <return type="PackedByteArray"> </return> <description> Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes). </description> </method> - <method name="to_utf8"> + <method name="to_utf8_buffer"> <return type="PackedByteArray"> </return> <description> - Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. + Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii_buffer], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii_buffer]. </description> </method> <method name="trim_prefix"> @@ -1067,8 +879,10 @@ <method name="xml_escape"> <return type="String"> </return> + <argument index="0" name="escape_quotes" type="bool" default="false"> + </argument> <description> - Returns a copy of the string with special characters escaped using the XML standard. + Returns a copy of the string with special characters escaped using the XML standard. If [code]escape_quotes[/code] is [code]true[/code], the single quote ([code]'[/code]) and double quote ([code]"[/code]) characters are also escaped. </description> </method> <method name="xml_unescape"> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index 5d8ac6fdcc..af0074f080 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -9,7 +9,23 @@ <tutorials> </tutorials> <methods> - <method name="StringName"> + <method name="StringName" qualifiers="constructor"> + <return type="StringName"> + </return> + <description> + Constructs an empty [StringName]. + </description> + </method> + <method name="StringName" qualifiers="constructor"> + <return type="StringName"> + </return> + <argument index="0" name="from" type="StringName"> + </argument> + <description> + Constructs a [StringName] as a copy of the given [StringName]. + </description> + </method> + <method name="StringName" qualifiers="constructor"> <return type="StringName"> </return> <argument index="0" name="from" type="String"> @@ -18,6 +34,38 @@ Creates a new [StringName] from the given [String]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="String"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="StringName"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index f8aa14cb2b..6f5577b61b 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -119,10 +119,6 @@ <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> Modulates the color of the texture when this style box is drawn. </member> - <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map"> - The normal map to use when drawing this style box. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> Species a sub-region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index ef1f370185..15c2d3504c 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -4,7 +4,7 @@ Tabs control. </brief_description> <description> - Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interact with children. + Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children. </description> <tutorials> </tutorials> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index a23a4936f8..53d706db2d 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -213,6 +213,12 @@ Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit]. </description> </method> + <method name="get_selection_column" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_selection_from_column" qualifiers="const"> <return type="int"> </return> @@ -227,6 +233,18 @@ Returns the selection begin line. </description> </method> + <method name="get_selection_line" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_selection_mode" qualifiers="const"> + <return type="int" enum="TextEdit.SelectionMode"> + </return> + <description> + </description> + </method> <method name="get_selection_text" qualifiers="const"> <return type="String"> </return> @@ -555,6 +573,18 @@ <description> </description> </method> + <method name="set_selection_mode"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="TextEdit.SelectionMode"> + </argument> + <argument index="1" name="line" type="int" default="-1"> + </argument> + <argument index="2" name="column" type="int" default="-1"> + </argument> + <description> + </description> + </method> <method name="toggle_fold_line"> <return type="void"> </return> @@ -732,6 +762,16 @@ <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags"> Search from end to beginning. </constant> + <constant name="SELECTION_MODE_NONE" value="0" enum="SelectionMode"> + </constant> + <constant name="SELECTION_MODE_SHIFT" value="1" enum="SelectionMode"> + </constant> + <constant name="SELECTION_MODE_POINTER" value="2" enum="SelectionMode"> + </constant> + <constant name="SELECTION_MODE_WORD" value="3" enum="SelectionMode"> + </constant> + <constant name="SELECTION_MODE_LINE" value="4" enum="SelectionMode"> + </constant> <constant name="GUTTER_TYPE_STRING" value="0" enum="GutterType"> </constant> <constant name="GUTTER_TPYE_ICON" value="1" enum="GutterType"> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index f283efdc3d..ff8b439a3d 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -22,16 +22,6 @@ </argument> <argument index="3" name="transpose" type="bool" default="false"> </argument> - <argument index="4" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="5" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="7" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0"> - </argument> - <argument index="8" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0"> - </argument> <description> Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [code]position[/code]. </description> @@ -49,16 +39,6 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0"> - </argument> - <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0"> - </argument> <description> Draws the texture using a [CanvasItem] with the [RenderingServer] API. </description> @@ -76,17 +56,7 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture2D" default="null"> - </argument> - <argument index="6" name="specular_map" type="Texture2D" default="null"> - </argument> - <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )"> - </argument> - <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0"> - </argument> - <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0"> - </argument> - <argument index="10" name="clip_uv" type="bool" default="true"> + <argument index="5" name="clip_uv" type="bool" default="true"> </argument> <description> Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API. diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 371ba80723..c500052592 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -280,7 +280,7 @@ Position for tile origin. See [enum TileOrigin] for possible values. </member> <member name="cell_y_sort" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false"> - If [code]true[/code], the TileMap's children will be drawn in order of their Y coordinate. + If [code]true[/code], the TileMap's direct children will be drawn in order of their Y coordinate. </member> <member name="centered_textures" type="bool" setter="set_centered_textures" getter="is_centered_textures_enabled" default="false"> If [code]true[/code], the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, [member compatibility_mode] is ignored. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 9ab9d9ca7a..adc5880c71 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -389,15 +389,6 @@ Returns the offset of the tile's navigation polygon. </description> </method> - <method name="tile_get_normal_map" qualifiers="const"> - <return type="Texture2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <description> - Returns the tile's normal map texture. - </description> - </method> <method name="tile_get_occluder_offset" qualifiers="const"> <return type="Vector2"> </return> @@ -600,18 +591,6 @@ Sets an offset for the tile's navigation polygon. </description> </method> - <method name="tile_set_normal_map"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="normal_map" type="Texture2D"> - </argument> - <description> - Sets the tile's normal map texture. - [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - </description> - </method> <method name="tile_set_occluder_offset"> <return type="void"> </return> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 52dda75dff..cda69f6a64 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -16,57 +16,46 @@ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> </tutorials> <methods> - <method name="Transform"> + <method name="Transform" qualifiers="constructor"> <return type="Transform"> </return> - <argument index="0" name="x_axis" type="Vector3"> - </argument> - <argument index="1" name="y_axis" type="Vector3"> - </argument> - <argument index="2" name="z_axis" type="Vector3"> - </argument> - <argument index="3" name="origin" type="Vector3"> - </argument> <description> - Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled). + Constructs a default-initialized [Transform] set to [constant IDENTITY]. </description> </method> - <method name="Transform"> + <method name="Transform" qualifiers="constructor"> <return type="Transform"> </return> - <argument index="0" name="basis" type="Basis"> - </argument> - <argument index="1" name="origin" type="Vector3"> + <argument index="0" name="from" type="Transform"> </argument> <description> - Constructs a Transform from a [Basis] and [Vector3]. + Constructs a [Transform] as a copy of the given [Transform]. </description> </method> - <method name="Transform"> + <method name="Transform" qualifiers="constructor"> <return type="Transform"> </return> - <argument index="0" name="from" type="Transform2D"> + <argument index="0" name="basis" type="Basis"> </argument> - <description> - Constructs a Transform from a [Transform2D]. - </description> - </method> - <method name="Transform"> - <return type="Transform"> - </return> - <argument index="0" name="from" type="Quat"> + <argument index="1" name="origin" type="Vector3"> </argument> <description> - Constructs a Transform from a [Quat]. The origin will be [code]Vector3(0, 0, 0)[/code]. + Constructs a Transform from a [Basis] and [Vector3]. </description> </method> - <method name="Transform"> + <method name="Transform" qualifiers="constructor"> <return type="Transform"> </return> - <argument index="0" name="from" type="Basis"> + <argument index="0" name="x_axis" type="Vector3"> + </argument> + <argument index="1" name="y_axis" type="Vector3"> + </argument> + <argument index="2" name="z_axis" type="Vector3"> + </argument> + <argument index="3" name="origin" type="Vector3"> </argument> <description> - Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0). + Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled). </description> </method> <method name="affine_inverse"> @@ -79,7 +68,7 @@ <method name="interpolate_with"> <return type="Transform"> </return> - <argument index="0" name="transform" type="Transform"> + <argument index="0" name="xform" type="Transform"> </argument> <argument index="1" name="weight" type="float"> </argument> @@ -97,7 +86,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="transform" type="Transform"> + <argument index="0" name="xform" type="Transform"> </argument> <description> Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. @@ -116,6 +105,54 @@ Operations take place in global space. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="right" type="PackedVector3Array"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Transform"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="AABB"> + </return> + <argument index="0" name="right" type="AABB"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> <method name="orthonormalized"> <return type="Transform"> </return> @@ -153,24 +190,6 @@ Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> - <method name="xform"> - <return type="Variant"> - </return> - <argument index="0" name="v" type="Variant"> - </argument> - <description> - Transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform. - </description> - </method> - <method name="xform_inv"> - <return type="Variant"> - </return> - <argument index="0" name="v" type="Variant"> - </argument> - <description> - Inverse-transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform. - </description> - </method> </methods> <members> <member name="basis" type="Basis" setter="" getter="" default="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index b23bb4d33b..ff291663fa 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -14,29 +14,23 @@ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link> </tutorials> <methods> - <method name="Transform2D"> + <method name="Transform2D" qualifiers="constructor"> <return type="Transform2D"> </return> - <argument index="0" name="from" type="Transform"> - </argument> <description> - Constructs the transform from a 3D [Transform]. + Constructs a default-initialized [Transform] set to [constant IDENTITY]. </description> </method> - <method name="Transform2D"> + <method name="Transform2D" qualifiers="constructor"> <return type="Transform2D"> </return> - <argument index="0" name="x_axis" type="Vector2"> - </argument> - <argument index="1" name="y_axis" type="Vector2"> - </argument> - <argument index="2" name="origin" type="Vector2"> + <argument index="0" name="from" type="Transform2D"> </argument> <description> - Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors). + Constructs a [Transform2D] as a copy of the given [Transform2D]. </description> </method> - <method name="Transform2D"> + <method name="Transform2D" qualifiers="constructor"> <return type="Transform2D"> </return> <argument index="0" name="rotation" type="float"> @@ -47,6 +41,19 @@ Constructs the transform from a given angle (in radians) and position. </description> </method> + <method name="Transform2D" qualifiers="constructor"> + <return type="Transform2D"> + </return> + <argument index="0" name="x_axis" type="Vector2"> + </argument> + <argument index="1" name="y_axis" type="Vector2"> + </argument> + <argument index="2" name="origin" type="Vector2"> + </argument> + <description> + Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors). + </description> + </method> <method name="affine_inverse"> <return type="Transform2D"> </return> @@ -98,9 +105,9 @@ <method name="interpolate_with"> <return type="Transform2D"> </return> - <argument index="0" name="transform" type="Transform2D"> + <argument index="0" name="xform" type="Transform2D"> </argument> - <argument index="1" name="weight" type="float"> + <argument index="1" name="t" type="float"> </argument> <description> Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0). @@ -116,12 +123,68 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="transform" type="Transform2D"> + <argument index="0" name="xform" type="Transform2D"> </argument> <description> Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Rect2"> + </return> + <argument index="0" name="right" type="Rect2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Transform2D"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="PackedVector2Array"> + </return> + <argument index="0" name="right" type="PackedVector2Array"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="orthonormalized"> <return type="Transform2D"> </return> @@ -157,24 +220,6 @@ Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> - <method name="xform"> - <return type="Variant"> - </return> - <argument index="0" name="v" type="Variant"> - </argument> - <description> - Transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform. - </description> - </method> - <method name="xform_inv"> - <return type="Variant"> - </return> - <argument index="0" name="v" type="Variant"> - </argument> - <description> - Inverse-transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform. - </description> - </method> </methods> <members> <member name="origin" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )"> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 025d6474ee..f99231de39 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -17,7 +17,23 @@ <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link> </tutorials> <methods> - <method name="Vector2"> + <method name="Vector2" qualifiers="constructor"> + <return type="Vector2"> + </return> + <description> + Constructs a default-initialized [Vector2] with all components set to [code]0[/code]. + </description> + </method> + <method name="Vector2" qualifiers="constructor"> + <return type="Vector2"> + </return> + <argument index="0" name="from" type="Vector2"> + </argument> + <description> + Constructs a [Vector2] as a copy of the given [Vector2]. + </description> + </method> + <method name="Vector2" qualifiers="constructor"> <return type="Vector2"> </return> <argument index="0" name="from" type="Vector2i"> @@ -26,7 +42,7 @@ Constructs a new [Vector2] from [Vector2i]. </description> </method> - <method name="Vector2"> + <method name="Vector2" qualifiers="constructor"> <return type="Vector2"> </return> <argument index="0" name="x" type="float"> @@ -177,7 +193,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="v" type="Vector2"> + <argument index="0" name="to" type="Vector2"> </argument> <description> Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -208,7 +224,7 @@ <method name="lerp"> <return type="Vector2"> </return> - <argument index="0" name="b" type="Vector2"> + <argument index="0" name="with" type="Vector2"> </argument> <argument index="1" name="t" type="float"> </argument> @@ -234,6 +250,146 @@ Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Transform2D"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="posmod"> <return type="Vector2"> </return> @@ -296,7 +452,7 @@ <method name="slerp"> <return type="Vector2"> </return> - <argument index="0" name="b" type="Vector2"> + <argument index="0" name="with" type="Vector2"> </argument> <argument index="1" name="t" type="float"> </argument> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 75ddc46dab..a4ea5c2742 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -14,18 +14,23 @@ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link> </tutorials> <methods> - <method name="Vector2i"> + <method name="Vector2i" qualifiers="constructor"> <return type="Vector2i"> </return> - <argument index="0" name="x" type="int"> - </argument> - <argument index="1" name="y" type="int"> + <description> + Constructs a default-initialized [Vector2i] with all components set to [code]0[/code]. + </description> + </method> + <method name="Vector2i" qualifiers="constructor"> + <return type="Vector2i"> + </return> + <argument index="0" name="from" type="Vector2i"> </argument> <description> - Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code]. + Constructs a [Vector2i] as a copy of the given [Vector2i]. </description> </method> - <method name="Vector2i"> + <method name="Vector2i" qualifiers="constructor"> <return type="Vector2i"> </return> <argument index="0" name="from" type="Vector2"> @@ -34,6 +39,17 @@ Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated. </description> </method> + <method name="Vector2i" qualifiers="constructor"> + <return type="Vector2i"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <description> + Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code]. + </description> + </method> <method name="abs"> <return type="Vector2i"> </return> @@ -48,6 +64,154 @@ Returns the ratio of [member x] to [member y]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector2i"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector2i"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="sign"> <return type="Vector2i"> </return> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index b26fe09e91..6ba0d6ab8d 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -17,7 +17,23 @@ <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link> </tutorials> <methods> - <method name="Vector3"> + <method name="Vector3" qualifiers="constructor"> + <return type="Vector3"> + </return> + <description> + Constructs a default-initialized [Vector3] with all components set to [code]0[/code]. + </description> + </method> + <method name="Vector3" qualifiers="constructor"> + <return type="Vector3"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <description> + Constructs a [Vector3] as a copy of the given [Vector3]. + </description> + </method> + <method name="Vector3" qualifiers="constructor"> <return type="Vector3"> </return> <argument index="0" name="from" type="Vector3i"> @@ -26,7 +42,7 @@ Constructs a new [Vector3] from [Vector3i]. </description> </method> - <method name="Vector3"> + <method name="Vector3" qualifiers="constructor"> <return type="Vector3"> </return> <argument index="0" name="x" type="float"> @@ -74,7 +90,7 @@ <method name="cross"> <return type="Vector3"> </return> - <argument index="0" name="b" type="Vector3"> + <argument index="0" name="with" type="Vector3"> </argument> <description> Returns the cross product of this vector and [code]b[/code]. @@ -126,7 +142,7 @@ <method name="dot"> <return type="float"> </return> - <argument index="0" name="b" type="Vector3"> + <argument index="0" name="with" type="Vector3"> </argument> <description> Returns the dot product of this vector and [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player. @@ -152,7 +168,7 @@ <method name="is_equal_approx"> <return type="bool"> </return> - <argument index="0" name="v" type="Vector3"> + <argument index="0" name="to" type="Vector3"> </argument> <description> Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -223,10 +239,166 @@ Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Basis"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="outer"> <return type="Basis"> </return> - <argument index="0" name="b" type="Vector3"> + <argument index="0" name="with" type="Vector3"> </argument> <description> Returns the outer product with [code]b[/code]. @@ -271,7 +443,7 @@ <method name="rotated"> <return type="Vector3"> </return> - <argument index="0" name="axis" type="Vector3"> + <argument index="0" name="by_axis" type="Vector3"> </argument> <argument index="1" name="phi" type="float"> </argument> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index f977b81ce7..a1ae2aceab 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -14,7 +14,32 @@ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link> </tutorials> <methods> - <method name="Vector3i"> + <method name="Vector3i" qualifiers="constructor"> + <return type="Vector3i"> + </return> + <description> + Constructs a default-initialized [Vector3i] with all components set to [code]0[/code]. + </description> + </method> + <method name="Vector3i" qualifiers="constructor"> + <return type="Vector3i"> + </return> + <argument index="0" name="from" type="Vector3i"> + </argument> + <description> + Constructs a [Vector3i] as a copy of the given [Vector3i]. + </description> + </method> + <method name="Vector3i" qualifiers="constructor"> + <return type="Vector3i"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <description> + Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. + </description> + </method> + <method name="Vector3i" qualifiers="constructor"> <return type="Vector3i"> </return> <argument index="0" name="x" type="int"> @@ -27,13 +52,10 @@ Returns a [Vector3i] with the given components. </description> </method> - <method name="Vector3i"> + <method name="abs"> <return type="Vector3i"> </return> - <argument index="0" name="from" type="Vector3"> - </argument> <description> - Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. </description> </method> <method name="max_axis"> @@ -50,6 +72,154 @@ Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. </description> </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector3i"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector3i"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator []" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> <method name="sign"> <return type="Vector3i"> </return> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 84974874de..85dc5e8fd8 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -250,9 +250,15 @@ The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. [b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually. </member> + <member name="snap_2d_transforms_to_pixel" type="bool" setter="set_snap_2d_transforms_to_pixel" getter="is_snap_2d_transforms_to_pixel_enabled" default="false"> + </member> + <member name="snap_2d_vertices_to_pixel" type="bool" setter="set_snap_2d_vertices_to_pixel" getter="is_snap_2d_vertices_to_pixel_enabled" default="false"> + </member> <member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" default="false"> If [code]true[/code], the viewport should render its background as transparent. </member> + <member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false"> + </member> <member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d"> The custom [World2D] which can be used as 2D environment source. </member> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index c1a991fca1..a0711b4214 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -362,6 +362,8 @@ <constant name="MODE_MAXIMIZED" value="2" enum="Mode"> </constant> <constant name="MODE_FULLSCREEN" value="3" enum="Mode"> + Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. + Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode. </constant> <constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags"> </constant> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index ce4d000a9b..03e8bee7d5 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -91,16 +91,23 @@ <tutorials> </tutorials> <methods> - <method name="bool"> + <method name="bool" qualifiers="constructor"> <return type="bool"> </return> - <argument index="0" name="from" type="int"> + <description> + Constructs a default-initialized [bool] set to [code]false[/code]. + </description> + </method> + <method name="bool" qualifiers="constructor"> + <return type="bool"> + </return> + <argument index="0" name="from" type="bool"> </argument> <description> - Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints. + Constructs a [bool] as a copy of the given [bool]. </description> </method> - <method name="bool"> + <method name="bool" qualifiers="constructor"> <return type="bool"> </return> <argument index="0" name="from" type="float"> @@ -109,14 +116,45 @@ Cast a [float] value to a boolean value, this method will return [code]false[/code] if [code]0.0[/code] is passed in, and [code]true[/code] for all other floats. </description> </method> - <method name="bool"> + <method name="bool" qualifiers="constructor"> + <return type="bool"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <description> + Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints. + </description> + </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="bool"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="bool"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="bool"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> <return type="bool"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="right" type="bool"> </argument> <description> - Cast a [String] value to a boolean value, this method will return [code]false[/code] if [code]""[/code] is passed in, and [code]true[/code] for all non-empty strings. - Examples: [code]bool("False")[/code] returns [code]true[/code], [code]bool("")[/code] returns [code]false[/code]. </description> </method> </methods> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 16a696f959..85fe31eec8 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -9,7 +9,23 @@ <tutorials> </tutorials> <methods> - <method name="float"> + <method name="float" qualifiers="constructor"> + <return type="float"> + </return> + <description> + Constructs a default-initialized [float] set to [code]0.0[/code]. + </description> + </method> + <method name="float" qualifiers="constructor"> + <return type="float"> + </return> + <argument index="0" name="from" type="float"> + </argument> + <description> + Constructs a [float] as a copy of the given [float]. + </description> + </method> + <method name="float" qualifiers="constructor"> <return type="float"> </return> <argument index="0" name="from" type="bool"> @@ -18,22 +34,233 @@ Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0. </description> </method> - <method name="float"> + <method name="float" qualifiers="constructor"> <return type="float"> </return> <argument index="0" name="from" type="int"> </argument> <description> - Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to 1.0. + Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code]. + </description> + </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> </description> </method> - <method name="float"> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> <return type="float"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> </argument> <description> - Cast a [String] value to a floating-point value. This method accepts float value strings like [code]"1.23"[/code] and exponential notation strings for its parameter so calling [code]float("1e3")[/code] will return 1000.0 and calling [code]float("1e-3")[/code] will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling [code]float("1a3")[/code] will return 1 while calling [code]float("1e3a2")[/code] will return 1000.0. </description> </method> </methods> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 2c9f0ad371..5ac9f8405a 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -23,7 +23,23 @@ <tutorials> </tutorials> <methods> - <method name="int"> + <method name="int" qualifiers="constructor"> + <return type="int"> + </return> + <description> + Constructs a default-initialized [int] set to [code]0[/code]. + </description> + </method> + <method name="int" qualifiers="constructor"> + <return type="int"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <description> + Constructs an [int] as a copy of the given [int]. + </description> + </method> + <method name="int" qualifiers="constructor"> <return type="int"> </return> <argument index="0" name="from" type="bool"> @@ -32,7 +48,7 @@ Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0. </description> </method> - <method name="int"> + <method name="int" qualifiers="constructor"> <return type="int"> </return> <argument index="0" name="from" type="float"> @@ -41,13 +57,278 @@ Cast a float value to an integer value, this method simply removes the number fractions, so for example [code]int(2.7)[/code] will be equals to 2, [code]int(.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2. </description> </method> - <method name="int"> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator !=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator %" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator &" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2"> + </return> + <argument index="0" name="right" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector2i"> + </return> + <argument index="0" name="right" type="Vector2i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3"> + </return> + <argument index="0" name="right" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Vector3i"> + </return> + <argument index="0" name="right" type="Vector3i"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Quat"> + </return> + <argument index="0" name="right" type="Quat"> + </argument> + <description> + </description> + </method> + <method name="operator *" qualifiers="operator"> + <return type="Color"> + </return> + <argument index="0" name="right" type="Color"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator +" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator -" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="float"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator /" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator <" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <<" qualifiers="operator"> <return type="int"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator <=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> </argument> <description> - Cast a [String] value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like [code]'1.7'[/code]. This method will ignore all non-number characters, so calling [code]int('1e3')[/code] will return 13. + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator ==" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator >" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="float"> + </argument> + <description> + </description> + </method> + <method name="operator >=" qualifiers="operator"> + <return type="bool"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator >>" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator ^" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator |" qualifiers="operator"> + <return type="int"> + </return> + <argument index="0" name="right" type="int"> + </argument> + <description> + </description> + </method> + <method name="operator ~" qualifiers="operator"> + <return type="int"> + </return> + <description> </description> </method> </methods> |