From 0f249f5c0aa2c3a89848f03f155b76e834e4c32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 9 Nov 2020 17:46:03 +0100 Subject: Variant: Sync docs with new constructors, fixups after #43403 Change DocData comparators for MethodDoc and ArgumentDoc to get a better ordering of constructors. --- core/math/color.h | 15 +- core/math/color_names.inc | 10 +- core/math/transform.cpp | 7 + core/math/transform.h | 5 +- core/string/ustring.h | 2 +- core/variant/variant_construct.cpp | 17 +- doc/classes/@GlobalScope.xml | 27 +-- doc/classes/AABB.xml | 16 ++ doc/classes/Array.xml | 44 ++-- doc/classes/Basis.xml | 28 ++- doc/classes/Callable.xml | 20 +- doc/classes/Color.xml | 71 ++---- doc/classes/DTLSServer.xml | 2 +- doc/classes/Dictionary.xml | 16 ++ doc/classes/FuncRef.xml | 53 ----- doc/classes/NodePath.xml | 16 ++ doc/classes/PackedByteArray.xml | 16 ++ doc/classes/PackedColorArray.xml | 16 ++ doc/classes/PackedFloat32Array.xml | 16 ++ doc/classes/PackedFloat64Array.xml | 16 ++ doc/classes/PackedInt32Array.xml | 16 ++ doc/classes/PackedInt64Array.xml | 16 ++ doc/classes/PackedStringArray.xml | 16 ++ doc/classes/PackedVector2Array.xml | 16 ++ doc/classes/PackedVector3Array.xml | 16 ++ doc/classes/Plane.xml | 41 +++- doc/classes/Quat.xml | 38 ++- doc/classes/RID.xml | 11 +- doc/classes/Rect2.xml | 34 ++- doc/classes/Rect2i.xml | 34 ++- doc/classes/Signal.xml | 20 +- doc/classes/String.xml | 264 +-------------------- doc/classes/StringName.xml | 16 ++ doc/classes/Transform.xml | 39 ++- doc/classes/Transform2D.xml | 25 +- doc/classes/Vector2.xml | 16 ++ doc/classes/Vector2i.xml | 24 +- doc/classes/Vector3.xml | 16 ++ doc/classes/Vector3i.xml | 28 ++- doc/classes/bool.xml | 16 +- doc/classes/float.xml | 19 +- doc/classes/int.xml | 19 +- editor/doc_data.h | 17 ++ modules/gdscript/doc_classes/@GDScript.xml | 76 +++--- .../doc_classes/VisualScriptBuiltinFunc.xml | 39 ++- 45 files changed, 701 insertions(+), 584 deletions(-) delete mode 100644 doc/classes/FuncRef.xml diff --git a/core/math/color.h b/core/math/color.h index 94502a79bf..a9be9e9035 100644 --- a/core/math/color.h +++ b/core/math/color.h @@ -209,15 +209,26 @@ struct Color { _FORCE_INLINE_ Color() {} /** - * RGB / RGBA construct parameters. Alpha is optional, but defaults to 1.0 + * RGBA construct parameters. + * Alpha is not optional as otherwise we can't bind the RGB version for scripting. */ - _FORCE_INLINE_ Color(float p_r, float p_g, float p_b, float p_a = 1.0) { + _FORCE_INLINE_ Color(float p_r, float p_g, float p_b, float p_a) { r = p_r; g = p_g; b = p_b; a = p_a; } + /** + * RGB construct parameters. + */ + _FORCE_INLINE_ Color(float p_r, float p_g, float p_b) { + r = p_r; + g = p_g; + b = p_b; + a = 1.0; + } + /** * Construct a Color from another Color, but with the specified alpha value. */ diff --git a/core/math/color_names.inc b/core/math/color_names.inc index cbc821026e..523c7e3c59 100644 --- a/core/math/color_names.inc +++ b/core/math/color_names.inc @@ -61,9 +61,7 @@ static NamedColor named_colors[] = { { "gold", Color(1.00, 0.84, 0.00) }, { "goldenrod", Color(0.85, 0.65, 0.13) }, { "gray", Color(0.75, 0.75, 0.75) }, - { "webgray", Color(0.50, 0.50, 0.50) }, { "green", Color(0.00, 1.00, 0.00) }, - { "webgreen", Color(0.00, 0.50, 0.00) }, { "greenyellow", Color(0.68, 1.00, 0.18) }, { "honeydew", Color(0.94, 1.00, 0.94) }, { "hotpink", Color(1.00, 0.41, 0.71) }, @@ -93,7 +91,6 @@ static NamedColor named_colors[] = { { "linen", Color(0.98, 0.94, 0.90) }, { "magenta", Color(1.00, 0.00, 1.00) }, { "maroon", Color(0.69, 0.19, 0.38) }, - { "webmaroon", Color(0.50, 0.00, 0.00) }, { "mediumaquamarine", Color(0.40, 0.80, 0.67) }, { "mediumblue", Color(0.00, 0.00, 0.80) }, { "mediumorchid", Color(0.73, 0.33, 0.83) }, @@ -126,7 +123,6 @@ static NamedColor named_colors[] = { { "plum", Color(0.87, 0.63, 0.87) }, { "powderblue", Color(0.69, 0.88, 0.90) }, { "purple", Color(0.63, 0.13, 0.94) }, - { "webpurple", Color(0.50, 0.00, 0.50) }, { "rebeccapurple", Color(0.40, 0.20, 0.60) }, { "red", Color(1.00, 0.00, 0.00) }, { "rosybrown", Color(0.74, 0.56, 0.56) }, @@ -148,9 +144,13 @@ static NamedColor named_colors[] = { { "teal", Color(0.00, 0.50, 0.50) }, { "thistle", Color(0.85, 0.75, 0.85) }, { "tomato", Color(1.00, 0.39, 0.28) }, - { "turquoise", Color(0.25, 0.88, 0.82) }, { "transparent", Color(1.00, 1.00, 1.00, 0.00) }, + { "turquoise", Color(0.25, 0.88, 0.82) }, { "violet", Color(0.93, 0.51, 0.93) }, + { "webgray", Color(0.50, 0.50, 0.50) }, + { "webgreen", Color(0.00, 0.50, 0.00) }, + { "webmaroon", Color(0.50, 0.00, 0.00) }, + { "webpurple", Color(0.50, 0.00, 0.50) }, { "wheat", Color(0.96, 0.87, 0.70) }, { "white", Color(1.00, 1.00, 1.00) }, { "whitesmoke", Color(0.96, 0.96, 0.96) }, diff --git a/core/math/transform.cpp b/core/math/transform.cpp index d36fd6a63d..733bb4d55e 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -200,6 +200,13 @@ Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) : origin(p_origin) { } +Transform::Transform(const Vector3 &p_x, const Vector3 &p_y, const Vector3 &p_z, const Vector3 &p_origin) : + origin(p_origin) { + basis.set_axis(0, p_x); + basis.set_axis(1, p_y); + basis.set_axis(2, p_z); +} + Transform::Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t ox, real_t oy, real_t oz) { basis = Basis(xx, xy, xz, yx, yy, yz, zx, zy, zz); origin = Vector3(ox, oy, oz); diff --git a/core/math/transform.h b/core/math/transform.h index 71847d36ac..c63dbcb989 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -106,9 +106,10 @@ public: operator String() const; - Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t ox, real_t oy, real_t oz); - Transform(const Basis &p_basis, const Vector3 &p_origin = Vector3()); Transform() {} + Transform(const Basis &p_basis, const Vector3 &p_origin = Vector3()); + Transform(const Vector3 &p_x, const Vector3 &p_y, const Vector3 &p_z, const Vector3 &p_origin); + Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t ox, real_t oy, real_t oz); }; _FORCE_INLINE_ Vector3 Transform::xform(const Vector3 &p_vector) const { diff --git a/core/string/ustring.h b/core/string/ustring.h index 35475a2124..201b439b12 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -433,10 +433,10 @@ public: /** * The constructors must not depend on other overloads */ - /* String(char32_t p_char);*/ _FORCE_INLINE_ String() {} _FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); } + String &operator=(const String &p_str) { _cowdata._ref(p_str._cowdata); return *this; diff --git a/core/variant/variant_construct.cpp b/core/variant/variant_construct.cpp index 5281265294..b777323e82 100644 --- a/core/variant/variant_construct.cpp +++ b/core/variant/variant_construct.cpp @@ -292,7 +292,7 @@ public: } static Variant::Type get_base_type() { - return Variant::CALLABLE; + return Variant::SIGNAL; } }; @@ -569,10 +569,12 @@ void Variant::_register_variant_constructors() { add_constructor>(sarray()); add_constructor>(sarray("from")); add_constructor>(sarray("from")); + add_constructor>(sarray("from")); add_constructor>(sarray()); add_constructor>(sarray("from")); add_constructor>(sarray("from")); + add_constructor>(sarray("from")); add_constructor>(sarray()); add_constructor>(sarray("from")); @@ -613,13 +615,15 @@ void Variant::_register_variant_constructors() { add_constructor>(sarray()); add_constructor>(sarray("from")); - add_constructor>(sarray("x", "y", "origin")); + add_constructor>(sarray("rotation", "position")); + add_constructor>(sarray("x_axis", "y_axis", "origin")); add_constructor>(sarray()); add_constructor>(sarray("from")); add_constructor>(sarray("normal", "d")); add_constructor>(sarray("point", "normal")); add_constructor>(sarray("point1", "point2", "point3")); + add_constructor>(sarray("a", "b", "c", "d")); add_constructor>(sarray()); add_constructor>(sarray("from")); @@ -627,6 +631,7 @@ void Variant::_register_variant_constructors() { add_constructor>(sarray("euler")); add_constructor>(sarray("axis", "angle")); add_constructor>(sarray("arc_from", "arc_to")); + add_constructor>(sarray("x", "y", "z", "w")); add_constructor>(sarray()); add_constructor>(sarray("from")); @@ -635,14 +640,20 @@ void Variant::_register_variant_constructors() { add_constructor>(sarray()); add_constructor>(sarray("from")); add_constructor>(sarray("from")); - add_constructor>(sarray("x", "y", "z")); + add_constructor>(sarray("euler")); + add_constructor>(sarray("axis", "phi")); + add_constructor>(sarray("x_axis", "y_axis", "z_axis")); add_constructor>(sarray()); add_constructor>(sarray("from")); add_constructor>(sarray("basis", "origin")); + add_constructor>(sarray("x_axis", "y_axis", "z_axis", "origin")); add_constructor>(sarray()); add_constructor>(sarray("from")); + add_constructor>(sarray("from", "alpha")); + add_constructor>(sarray("r", "g", "b")); + add_constructor>(sarray("r", "g", "b", "a")); add_constructor>(sarray()); add_constructor>(sarray("from")); 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 @@ Remainder/modulo operator ([code]%[/code]). - - String concatenation operator ([code]+[/code]). - - + Left shift operator ([code]<<[/code]). - + Right shift operator ([code]>>[/code]). - + Bitwise AND operator ([code]&[/code]). - + Bitwise OR operator ([code]|[/code]). - + Bitwise XOR operator ([code]^[/code]). - + Bitwise NOT operator ([code]~[/code]). - + Logical AND operator ([code]and[/code] or [code]&&[/code]). - + Logical OR operator ([code]or[/code] or [code]||[/code]). - + Logical XOR operator (not implemented in GDScript). - + Logical NOT operator ([code]not[/code] or [code]![/code]). - + Logical IN operator ([code]in[/code]). - + Represents the size of the [enum Variant.Operator] enum. diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index 4f95b44f83..a4972612d9 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -14,6 +14,22 @@ https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html + + + + + Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size]. + + + + + + + + + Constructs an [AABB] as a copy of the given [AABB]. + + diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index d0f90f513d..86ef5bef4c 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -46,37 +46,44 @@ - + + Constructs an empty [Array]. + + + + + + - Constructs an array from a [PackedColorArray]. + Constructs an [Array] as a copy of the given [Array]. - + - Constructs an array from a [PackedVector3Array]. + Constructs an array from a [PackedByteArray]. - + - Constructs an array from a [PackedVector2Array]. + Constructs an array from a [PackedColorArray]. - + - Constructs an array from a [PackedStringArray]. + Constructs an array from a [PackedFloat32Array]. @@ -91,10 +98,10 @@ - + - Constructs an array from a [PackedFloat32Array]. + Constructs an array from a [PackedInt32Array]. @@ -109,19 +116,28 @@ - + - Constructs an array from a [PackedInt32Array]. + Constructs an array from a [PackedStringArray]. - + - Constructs an array from a [PackedByteArray]. + Constructs an array from a [PackedVector2Array]. + + + + + + + + + Constructs an array from a [PackedVector3Array]. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 4201a31402..908f316e4e 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -22,20 +22,17 @@ - - - Constructs a pure rotation basis matrix from the given quaternion. + Constructs a default-initialized [Basis] set to [constant IDENTITY]. - + - 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]. @@ -49,6 +46,25 @@ 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. + + + + + + + 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 pure rotation basis matrix from the given quaternion. + + diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 7aaf087540..c31efc2581 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -36,15 +36,31 @@ + + + + + Constructs a null [Callable] with no object nor method bound. + + + + + + + + + Constructs a [Callable] as a copy of the given [Callable]. + + - + - 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]. diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index ca52d27a52..721fea8a19 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -19,71 +19,28 @@ - - - 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]. - + - 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]. - + - + - 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. @@ -103,14 +60,16 @@ + + - 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] @@ -124,16 +83,14 @@ - - - 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] diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 8bdaeb9211..91a04b1f28 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -132,7 +132,7 @@ // Try to contact server Dtls.PutPacket("The Answer Is..42!".ToUTF8()); } - while (Dtls.GetAvailablePacketCount() > 0) + while (Dtls.GetAvailablePacketCount() > 0) { GD.Print("Connected: " + Dtls.GetPacket().GetStringFromUTF8()); Connected = true; diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 8095d95551..a7a3632fef 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -171,6 +171,22 @@ https://godotengine.org/asset-library/asset/677 + + + + + Constructs an empty [Dictionary]. + + + + + + + + + Constructs a [Dictionary] as a copy of the given [Dictionary]. + + 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 @@ - - - - Reference to a function in an object. - - - 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. - - - - - - - - - Calls the referenced function previously set in [member function] or [method @GDScript.funcref]. - - - - - - - - - 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]. - - - - - - - Returns whether the object still exists and has the function assigned. - - - - - - - - - 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]. - - - - - - The name of the referenced function. - - - - - diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index f711ba4d6b..980bea0d9f 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -25,6 +25,22 @@ https://godotengine.org/asset-library/asset/520 + + + + + Constructs an empty [NodePath]. + + + + + + + + + Constructs a [NodePath] as a copy of the given [NodePath]. + + diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 7c2d566466..5ac5f15fb2 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -10,6 +10,22 @@ + + + + + Constructs an empty [PackedByteArray]. + + + + + + + + + Constructs a [PackedByteArray] as a copy of the given [PackedByteArray]. + + diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index c42d14c5bd..e4b9e02be7 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -10,6 +10,22 @@ + + + + + Constructs an empty [PackedColorArray]. + + + + + + + + + Constructs a [PackedColorArray] as a copy of the given [PackedColorArray]. + + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index dd84648251..1b2091f72b 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -11,6 +11,22 @@ + + + + + Constructs an empty [PackedFloat32Array]. + + + + + + + + + Constructs a [PackedFloat32Array] as a copy of the given [PackedFloat32Array]. + + diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 91c3f4874b..a55ac6bacc 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -11,6 +11,22 @@ + + + + + Constructs an empty [PackedFloat64Array]. + + + + + + + + + Constructs a [PackedFloat64Array] as a copy of the given [PackedFloat64Array]. + + diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index a0a9922d0c..ecf8abd1eb 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -11,6 +11,22 @@ + + + + + Constructs an empty [PackedInt32Array]. + + + + + + + + + Constructs a [PackedInt32Array] as a copy of the given [PackedInt32Array]. + + diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 542dabcfa0..a254a6ff5f 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -11,6 +11,22 @@ + + + + + Constructs an empty [PackedInt64Array]. + + + + + + + + + Constructs a [PackedInt64Array] as a copy of the given [PackedInt64Array]. + + diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 7c710cf0fb..c50ec38a93 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -11,6 +11,22 @@ https://godotengine.org/asset-library/asset/677 + + + + + Constructs an empty [PackedStringArray]. + + + + + + + + + Constructs a [PackedStringArray] as a copy of the given [PackedStringArray]. + + diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 98034afc93..0bd658c488 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -11,6 +11,22 @@ https://godotengine.org/asset-library/asset/519 + + + + + Constructs an empty [PackedVector2Array]. + + + + + + + + + Constructs a [PackedVector2Array] as a copy of the given [PackedVector2Array]. + + diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 3db33fbcd9..5b835f2fbf 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -10,6 +10,22 @@ + + + + + Constructs an empty [PackedVector3Array]. + + + + + + + + + Constructs a [PackedVector3Array] as a copy of the given [PackedVector3Array]. + + diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 9352eee1eb..bb0b25a552 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -10,6 +10,22 @@ https://docs.godotengine.org/en/latest/tutorials/math/index.html + + + + + Constructs a default-initialized [Plane] with all components set to [code]0[/code]. + + + + + + + + + Constructs a [Plane] as a copy of the given [Plane]. + + @@ -28,25 +44,36 @@ - + + + - + + 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. + Creates a plane from the given position and a plane normal. - + - + + + - 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. diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 76cfa0d99d..edfe99a8b8 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -16,16 +16,27 @@ - - - + + Constructs a default-initialized quaternion with all components set to [code]0[/code]. + + + + + + - + + Constructs a [Quat] as a copy of the given [Quat]. + + + + + + - + - Constructs a quaternion defined by the given values. @@ -57,6 +68,21 @@ Constructs a quaternion from the given [Basis]. + + + + + + + + + + + + + Constructs a quaternion defined by the given values. + + diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index 644c427120..d944f7a86a 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -12,10 +12,17 @@ - + + Constructs an empty [RID] with the invalid ID [code]0[/code]. + + + + + + - 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]. diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index a72ba35a98..b970d0188c 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -14,6 +14,31 @@ https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html + + + + + Constructs a default-initialized [Rect2] with default (zero) values of [member position] and [member size]. + + + + + + + + + Constructs a [Rect2] as a copy of the given [Rect2]. + + + + + + + + + Constructs a [Rect2] from a [Rect2i]. + + @@ -40,15 +65,6 @@ Constructs a [Rect2] by x, y, width, and height. - - - - - - - Constructs a [Rect2] from a [Rect2i]. - - diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index de2932e816..5c9162baf4 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -12,6 +12,31 @@ https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html + + + + + Constructs a default-initialized [Rect2i] with default (zero) values of [member position] and [member size]. + + + + + + + + + Constructs a [Rect2i] as a copy of the given [Rect2i]. + + + + + + + + + Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. + + @@ -38,15 +63,6 @@ Constructs a [Rect2i] by x, y, width, and height. - - - - - - - Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. - - diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 51490caf6f..bd091899ac 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -8,15 +8,31 @@ + + + + + Constructs a null [Signal] with no object nor signal name bound. + + + + + + + + + Constructs a [Signal] as a copy of the given [Signal]. + + - + - 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]. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index fcd8f57cd1..a600a575aa 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -13,154 +13,17 @@ - - - - Constructs a new String from the given [bool]. - - - - - - - - - Constructs a new String from the given [int]. - - - - - - - - - Constructs a new String from the given [float]. - - - - - - - - - Constructs a new String from the given [Vector2]. - - - - - - - - - Constructs a new String from the given [Vector2i]. - - - - - - - - - Constructs a new String from the given [Rect2]. - - - - - - - - - Constructs a new String from the given [Rect2i]. - - - - - - - - - Constructs a new String from the given [Vector3]. - - - - - - - - - Constructs a new String from the given [Vector3i]. - - - - - - - - - Constructs a new String from the given [Transform2D]. - - - - - - - - - Constructs a new String from the given [Plane]. - - - - - - - - - Constructs a new String from the given [Quat]. - - - - - - - - - Constructs a new String from the given [AABB]. - - - - - - - - - Constructs a new String from the given [Basis]. - - - - - - - - - Constructs a new String from the given [Transform]. - - - - - - - - Constructs a new String from the given [Color]. + Constructs an empty [String] ([code]""[/code]). - + - Constructs a new String from the given [StringName]. + Constructs a [String] as a copy of the given [String]. @@ -175,127 +38,10 @@ - - - - Constructs a new String from the given [RID]. - - - - - - - - - Constructs a new String from the given [Callable]. - - - - - - - - - Constructs a new String from the given [Signal]. - - - - - - - - - Constructs a new String from the given [Dictionary]. - - - - - - - - - Constructs a new String from the given [Array]. - - - - - - - - - Constructs a new String from the given [PackedByteArray]. - - - - - - - - - Constructs a new String from the given [PackedInt32Array]. - - - - - - - - - Constructs a new String from the given [PackedInt64Array]. - - - - - - - - - Constructs a new String from the given [PackedFloat32Array]. - - - - - - - - - Constructs a new String from the given [PackedFloat64Array]. - - - - - - - - - Constructs a new String from the given [PackedStringArray]. - - - - - - - - - Constructs a new String from the given [PackedVector2Array]. - - - - - - - - - Constructs a new String from the given [PackedVector3Array]. - - - - - - + - Constructs a new String from the given [PackedColorArray]. + Constructs a new String from the given [StringName]. diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index 5d8ac6fdcc..a847d44120 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -9,6 +9,22 @@ + + + + + Constructs an empty [StringName]. + + + + + + + + + Constructs a [StringName] as a copy of the given [StringName]. + + diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 8e539e64f7..920a6c704e 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -19,54 +19,43 @@ - - - - - - - - - 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]. - - - + - Constructs a Transform from a [Basis] and [Vector3]. + Constructs a [Transform] as a copy of the given [Transform]. - + - - Constructs a Transform from a [Transform2D]. - - - - - - + - Constructs a Transform from a [Quat]. The origin will be [code]Vector3(0, 0, 0)[/code]. + Constructs a Transform from a [Basis] and [Vector3]. - + + + + + + + - 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). diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 66adeab3a6..af67ad2bd4 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -14,6 +14,22 @@ https://godotengine.org/asset-library/asset/583 + + + + + Constructs a default-initialized [Transform] set to [constant IDENTITY]. + + + + + + + + + Constructs a [Transform2D] as a copy of the given [Transform2D]. + + @@ -38,15 +54,6 @@ Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors). - - - - - - - Constructs the transform from a 3D [Transform]. - - diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 231e0ed06a..da1526df52 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -17,6 +17,22 @@ https://github.com/godotengine/godot-demo-projects/tree/master/2d + + + + + Constructs a default-initialized [Vector2] with all components set to [code]0[/code]. + + + + + + + + + Constructs a [Vector2] as a copy of the given [Vector2]. + + diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 75ddc46dab..e5b85dff9e 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -17,12 +17,17 @@ - - - + + Constructs a default-initialized [Vector2i] with all components set to [code]0[/code]. + + + + + + - Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code]. + Constructs a [Vector2i] as a copy of the given [Vector2i]. @@ -34,6 +39,17 @@ Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated. + + + + + + + + + Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code]. + + diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 7e47f768b4..356c9501e1 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -17,6 +17,22 @@ https://github.com/godotengine/godot-demo-projects/tree/master/3d + + + + + Constructs a default-initialized [Vector3] with all components set to [code]0[/code]. + + + + + + + + + Constructs a [Vector3] as a copy of the given [Vector3]. + + diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 45e237fb23..761bddaeef 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -17,14 +17,17 @@ - - - - - + + Constructs a default-initialized [Vector3i] with all components set to [code]0[/code]. + + + + + + - Returns a [Vector3i] with the given components. + Constructs a [Vector3i] as a copy of the given [Vector3i]. @@ -36,6 +39,19 @@ Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. + + + + + + + + + + + Returns a [Vector3i] with the given components. + + diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index ce4d000a9b..e9f4c2ecf4 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -94,10 +94,17 @@ - + + Constructs a default-initialized [bool] set to [code]false[/code]. + + + + + + - 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]. @@ -112,11 +119,10 @@ - + - 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]. + 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. diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 16a696f959..8153d62bc9 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -12,28 +12,35 @@ - + + Constructs a default-initialized [float] set to [code]0.0[/code]. + + + + + + - 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. + Constructs a [float] as a copy of the given [float]. - + - Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to 1.0. + 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. - + - 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. + Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code]. diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 2c9f0ad371..27d873831b 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -26,28 +26,35 @@ - + + Constructs a default-initialized [int] set to [code]0[/code]. + + + + + + - 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. + Constructs an [int] as a copy of the given [int]. - + - 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. + 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. - + - 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. + 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. diff --git a/editor/doc_data.h b/editor/doc_data.h index 5fa20c6f0c..2cb475d137 100644 --- a/editor/doc_data.h +++ b/editor/doc_data.h @@ -43,6 +43,9 @@ public: String enumeration; String default_value; bool operator<(const ArgumentDoc &p_arg) const { + if (name == p_arg.name) { + return type < p_arg.type; + } return name < p_arg.name; } }; @@ -55,6 +58,20 @@ public: String description; Vector arguments; bool operator<(const MethodDoc &p_method) const { + if (name == p_method.name) { + // Must be a constructor since there is no overloading. + // We want this arbitrary order for a class "Foo": + // - 1. Default constructor: Foo() + // - 2. Copy constructor: Foo(Foo) + // - 3+. Other constructors Foo(Bar, ...) based on first argument's name + if (arguments.size() == 0 || p_method.arguments.size() == 0) { // 1. + return arguments.size() < p_method.arguments.size(); + } + if (arguments[0].type == return_type || p_method.arguments[0].type == p_method.return_type) { // 2. + return (arguments[0].type == return_type) || (p_method.arguments[0].type != p_method.return_type); + } + return arguments[0] < p_method.arguments[0]; + } return name < p_method.name; } }; diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 95818e5fcf..60051499a5 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -386,24 +386,6 @@ [/codeblock] - - - - - - - - - Returns a reference to the specified function [code]funcname[/code] in the [code]instance[/code] node. As functions aren't first-class objects in GDscript, use [code]funcref[/code] to store a [FuncRef] in a variable and call it later. - [codeblock] - func foo(): - return("bar") - - a = funcref(self, "foo") - print(a.call_func()) # Prints bar - [/codeblock] - - @@ -921,35 +903,6 @@ [/codeblock] - - - - - - - - - Random range, any floating point value between [code]from[/code] and [code]to[/code]. - [codeblock] - prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 - [/codeblock] - - - - - - - - - - - Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped. - [codeblock] - print(randi_range(0, 1)) # Prints 0 or 1 - print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 - [/codeblock] - - @@ -969,6 +922,20 @@ [/codeblock] + + + + + + + + + Random range, any floating point value between [code]from[/code] and [code]to[/code]. + [codeblock] + prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 + [/codeblock] + + @@ -982,6 +949,21 @@ [/codeblock] + + + + + + + + + Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped. + [codeblock] + print(randi_range(0, 1)) # Prints 0 or 1 + print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 + [/codeblock] + + diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index ca1215b0bd..000fbd0140 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -166,63 +166,60 @@ Create a [WeakRef] from the input. - - Create a [FuncRef] from the input. - - + Convert between types. - + Return the type of the input as an integer. Check [enum Variant.Type] for the integers that might be returned. - + Checks if a type is registered in the [ClassDB]. - + Return a character with the given ascii value. - + Convert the input to a string. - + Print the given string to the output window. - + Print the given string to the standard error output. - + Print the given string to the standard output, without adding a newline. - + Serialize a [Variant] to a string. - + Deserialize a [Variant] from a string serialized using [constant VAR_TO_STR]. - + Serialize a [Variant] to a [PackedByteArray]. - + Deserialize a [Variant] from a [PackedByteArray] serialized using [constant VAR_TO_BYTES]. - + Return the [Color] with the given name and alpha ranging from 0 to 1. [b]Note:[/b] Names are defined in [code]color_names.inc[/code]. - + Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to [constant MATH_LERP], but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula: [codeblock] var t = clamp((weight - from) / (to - from), 0.0, 1.0) return t * t * (3.0 - 2.0 * t) [/codeblock] - + - + - + - + Represents the size of the [enum BuiltinFunc] enum. -- cgit v1.2.3