From 424cd00f8b14aa51aad82c52996740d7648ae691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 4 Nov 2020 15:38:26 +0100 Subject: [PATCH] doc: Sync classref with current source + fixup some bindings Includes various changes triggered by the refactoring of method bindings. --- core/math/rect2.h | 12 +-- core/variant_call.cpp | 40 ++++----- doc/classes/AABB.xml | 12 ++- doc/classes/AnimatedSprite2D.xml | 6 -- doc/classes/Array.xml | 6 +- doc/classes/Basis.xml | 19 ---- doc/classes/CPUParticles2D.xml | 4 - doc/classes/Callable.xml | 2 +- doc/classes/CanvasGroup.xml | 21 +++++ doc/classes/CanvasItem.xml | 88 ++----------------- doc/classes/CanvasTexture.xml | 29 ++++++ doc/classes/Color.xml | 25 +----- doc/classes/ColorRect.xml | 2 +- doc/classes/DirectionalLight2D.xml | 20 +++++ doc/classes/EditorPlugin.xml | 2 +- doc/classes/GPUParticles2D.xml | 4 - doc/classes/Geometry2D.xml | 4 +- doc/classes/Light2D.xml | 56 ++++++------ doc/classes/LinkButton.xml | 1 - doc/classes/MenuButton.xml | 1 - doc/classes/NodePath.xml | 6 +- doc/classes/PackedByteArray.xml | 22 ++--- doc/classes/PackedColorArray.xml | 38 +++++--- doc/classes/PackedFloat32Array.xml | 30 +++++-- doc/classes/PackedFloat64Array.xml | 30 +++++-- doc/classes/PackedInt32Array.xml | 38 +++++--- doc/classes/PackedInt64Array.xml | 38 +++++--- doc/classes/PackedStringArray.xml | 38 +++++--- doc/classes/PackedVector2Array.xml | 38 +++++--- doc/classes/PackedVector3Array.xml | 38 +++++--- doc/classes/Plane.xml | 14 +-- doc/classes/PointLight2D.xml | 27 ++++++ doc/classes/Polygon2D.xml | 10 --- doc/classes/ProjectSettings.xml | 11 ++- doc/classes/Quat.xml | 65 ++++---------- doc/classes/Rect2.xml | 2 +- doc/classes/Rect2i.xml | 6 +- doc/classes/RenderingServer.xml | 68 +++++++------- doc/classes/Signal.xml | 2 +- doc/classes/Sprite2D.xml | 13 --- doc/classes/String.xml | 54 +++++------- doc/classes/StyleBoxTexture.xml | 4 - doc/classes/TextEdit.xml | 40 +++++++++ doc/classes/Texture2D.xml | 32 +------ doc/classes/TileSet.xml | 21 ----- doc/classes/Transform.xml | 22 +---- doc/classes/Transform2D.xml | 36 ++------ doc/classes/Vector2.xml | 6 +- doc/classes/Vector3.xml | 10 +-- doc/classes/Vector3i.xml | 6 ++ doc/classes/Viewport.xml | 6 ++ .../doc_classes/VisualScriptPropertyGet.xml | 2 + scene/2d/light_2d.cpp | 8 +- scene/2d/light_2d.h | 4 +- servers/rendering_server.cpp | 7 ++ servers/rendering_server.h | 1 + 56 files changed, 576 insertions(+), 571 deletions(-) create mode 100644 doc/classes/CanvasGroup.xml create mode 100644 doc/classes/CanvasTexture.xml create mode 100644 doc/classes/DirectionalLight2D.xml create mode 100644 doc/classes/PointLight2D.xml diff --git a/core/math/rect2.h b/core/math/rect2.h index 4e6cecaab2fd..5a746aa732cd 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -367,8 +367,8 @@ struct Rect2i { new_rect.position.x = MAX(p_rect.position.x, position.x); new_rect.position.y = MAX(p_rect.position.y, position.y); - Point2 p_rect_end = p_rect.position + p_rect.size; - Point2 end = position + size; + Point2i p_rect_end = p_rect.position + p_rect.size; + Point2i end = position + size; new_rect.size.x = (int)(MIN(p_rect_end.x, end.x) - new_rect.position.x); new_rect.size.y = (int)(MIN(p_rect_end.y, end.y) - new_rect.position.y); @@ -390,7 +390,7 @@ struct Rect2i { return new_rect; } - bool has_point(const Point2 &p_point) const { + bool has_point(const Point2i &p_point) const { if (p_point.x < position.x) { return false; } @@ -485,10 +485,10 @@ struct Rect2i { size(p_r2.size) { } Rect2i(int p_x, int p_y, int p_width, int p_height) : - position(Point2(p_x, p_y)), - size(Size2(p_width, p_height)) { + position(Point2i(p_x, p_y)), + size(Size2i(p_width, p_height)) { } - Rect2i(const Point2 &p_pos, const Size2 &p_size) : + Rect2i(const Point2i &p_pos, const Size2i &p_size) : position(p_pos), size(p_size) { } diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 6ffefccb6797..b1a046a72c17 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1357,7 +1357,7 @@ void register_variant_methods() { _VariantCall::construct_funcs = memnew_arr(_VariantCall::ConstructFunc, Variant::VARIANT_MAX); _VariantCall::constant_data = memnew_arr(_VariantCall::ConstantData, Variant::VARIANT_MAX); - /* STRING */ + /* String */ bind_method(String, casecmp_to, sarray("to"), varray()); bind_method(String, nocasecmp_to, sarray("to"), varray()); @@ -1405,7 +1405,7 @@ void register_variant_methods() { bind_method(String, plus_file, sarray("file"), varray()); bind_method(String, ord_at, sarray("at"), varray()); bind_method(String, dedent, sarray(), varray()); - //string needs to be immutable when binding + // FIXME: String needs to be immutable when binding //bind_method(String, erase, sarray("position", "chars"), varray()); bind_method(String, hash, sarray(), varray()); bind_method(String, md5_text, sarray(), varray()); @@ -1415,7 +1415,7 @@ void register_variant_methods() { bind_method(String, sha1_buffer, sarray(), varray()); bind_method(String, sha256_buffer, sarray(), varray()); bind_method(String, empty, sarray(), varray()); - //static function, not sure how to bind + // FIXME: Static function, not sure how to bind //bind_method(String, humanize_size, sarray("size"), varray()); bind_method(String, is_abs_path, sarray(), varray()); @@ -1457,7 +1457,7 @@ void register_variant_methods() { bind_method(String, to_utf16_buffer, sarray(), varray()); bind_method(String, to_utf32_buffer, sarray(), varray()); - /* VECTOR2 */ + /* Vector2 */ bind_method(Vector2, angle, sarray(), varray()); bind_method(Vector2, angle_to, sarray("to"), varray()); @@ -1490,15 +1490,16 @@ void register_variant_methods() { bind_method(Vector2, cross, sarray("with"), varray()); bind_method(Vector2, abs, sarray(), varray()); bind_method(Vector2, sign, sarray(), varray()); + bind_method(Vector2, snapped, sarray("by"), varray()); bind_method(Vector2, clamped, sarray("length"), varray()); - /* VECTOR2I */ + /* Vector2i */ bind_method(Vector2i, aspect, sarray(), varray()); bind_method(Vector2i, sign, sarray(), varray()); bind_method(Vector2i, abs, sarray(), varray()); - /* RECT2 */ + /* Rect2 */ bind_method(Rect2, get_area, sarray(), varray()); bind_method(Rect2, has_no_area, sarray(), varray()); @@ -1585,7 +1586,7 @@ void register_variant_methods() { bind_methodv(intersects_ray, &Plane::intersects_ray_bind, sarray("from", "dir"), varray()); bind_methodv(intersects_segment, &Plane::intersects_segment_bind, sarray("from", "to"), varray()); - /* Quaternion */ + /* Quat */ bind_method(Quat, length, sarray(), varray()); bind_method(Quat, length_squared, sarray(), varray()); @@ -1594,13 +1595,12 @@ void register_variant_methods() { bind_method(Quat, is_equal_approx, sarray("to"), varray()); bind_method(Quat, inverse, sarray(), varray()); bind_method(Quat, dot, sarray("with"), varray()); - bind_method(Quat, xform, sarray("v3"), varray()); bind_method(Quat, slerp, sarray("b", "t"), varray()); bind_method(Quat, slerpni, sarray("b", "t"), varray()); bind_method(Quat, cubic_slerp, sarray("b", "pre_a", "post_b", "t"), varray()); bind_method(Quat, get_euler, sarray(), varray()); - //Quat is atomic, this should be done via construcror + // FIXME: Quat is atomic, this should be done via construcror //ADDFUNC1(QUAT, NIL, Quat, set_euler, VECTOR3, "euler", varray()); //ADDFUNC2(QUAT, NIL, Quat, set_axis_angle, VECTOR3, "axis", FLOAT, "angle", varray()); @@ -1621,7 +1621,7 @@ void register_variant_methods() { bind_method(Color, to_html, sarray("with_alpha"), varray(true)); bind_method(Color, blend, sarray("over"), varray()); - //Color is immutable, need to probably find a way to do this via constructor + // FIXME: Color is immutable, need to probably find a way to do this via constructor //ADDFUNC4R(COLOR, COLOR, Color, from_hsv, FLOAT, "h", FLOAT, "s", FLOAT, "v", FLOAT, "a", varray(1.0)); bind_method(Color, is_equal_approx, sarray("to"), varray()); @@ -1651,8 +1651,6 @@ void register_variant_methods() { bind_method(Callable, hash, sarray(), varray()); bind_method(Callable, unbind, sarray("argcount"), varray()); - //#define bind_custom(m_type, m_name, m_method, m_flags, m_arg_types, m_ret_type, m_arg_names) _VariantCall::_bind_custom(m_type, m_name, m_method, m_flags, m_arg_types, m_ret_type) - bind_custom(Variant::CALLABLE, "call", _VariantCall::func_Callable_call, Variant::InternalMethod::FLAG_VARARGS | Variant::InternalMethod::FLAG_RETURNS_VARIANT, Vector(), Variant::NIL, sarray()); bind_custom(Variant::CALLABLE, "call_deferred", _VariantCall::func_Callable_call_deferred, Variant::InternalMethod::FLAG_VARARGS, Vector(), Variant::NIL, sarray()); bind_custom(Variant::CALLABLE, "bind", _VariantCall::func_Callable_bind, Variant::InternalMethod::FLAG_VARARGS, Vector(), Variant::CALLABLE, sarray()); @@ -1682,9 +1680,6 @@ void register_variant_methods() { bind_method(Transform2D, rotated, sarray("phi"), varray()); bind_method(Transform2D, scaled, sarray("scale"), varray()); bind_method(Transform2D, translated, sarray("offset"), varray()); - //too complex to bind this, operator * should be used instead - //ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform, NIL, "v", varray()); - //ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform_inv, NIL, "v", varray()); bind_method(Transform2D, basis_xform, sarray("v"), varray()); bind_method(Transform2D, basis_xform_inv, sarray("v"), varray()); bind_method(Transform2D, interpolate_with, sarray("xform", "t"), varray()); @@ -1703,9 +1698,6 @@ void register_variant_methods() { bind_method(Basis, tdotx, sarray("with"), varray()); bind_method(Basis, tdoty, sarray("with"), varray()); bind_method(Basis, tdotz, sarray("with"), varray()); - //use the operators instead - //ADDFUNC1R(BASIS, VECTOR3, Basis, xform, VECTOR3, "v", varray()); - //ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray()); bind_method(Basis, get_orthogonal_index, sarray(), varray()); bind_method(Basis, slerp, sarray("b", "t"), varray()); bind_method(Basis, is_equal_approx, sarray("b"), varray()); @@ -1748,9 +1740,6 @@ void register_variant_methods() { bind_method(Transform, looking_at, sarray("target", "up"), varray()); bind_method(Transform, interpolate_with, sarray("xform", "weight"), varray()); bind_method(Transform, is_equal_approx, sarray("xform"), varray()); - //use the operators instead - //ADDFUNC1R(TRANSFORM, NIL, Transform, xform, NIL, "v", varray()); - //ADDFUNC1R(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray()); /* Dictionary */ @@ -1923,6 +1912,7 @@ void register_variant_methods() { bind_method(PackedVector2Array, invert, sarray(), varray()); bind_method(PackedVector2Array, subarray, sarray("from", "to"), varray()); bind_method(PackedVector2Array, to_byte_array, sarray(), varray()); + bind_method(PackedVector2Array, sort, sarray(), varray()); /* Vector3 Array */ @@ -1939,6 +1929,7 @@ void register_variant_methods() { bind_method(PackedVector3Array, invert, sarray(), varray()); bind_method(PackedVector3Array, subarray, sarray("from", "to"), varray()); bind_method(PackedVector3Array, to_byte_array, sarray(), varray()); + bind_method(PackedVector3Array, sort, sarray(), varray()); /* Color Array */ @@ -1955,8 +1946,9 @@ void register_variant_methods() { bind_method(PackedColorArray, invert, sarray(), varray()); bind_method(PackedColorArray, subarray, sarray("from", "to"), varray()); bind_method(PackedColorArray, to_byte_array, sarray(), varray()); + bind_method(PackedColorArray, sort, sarray(), varray()); - /* REGISTER CONSTRUCTORS */ + /* Register constructors */ _VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::FLOAT, "y", Variant::FLOAT); _VariantCall::add_constructor(_VariantCall::Vector2i_init1, Variant::VECTOR2I, "x", Variant::INT, "y", Variant::INT); @@ -1964,7 +1956,7 @@ void register_variant_methods() { _VariantCall::add_constructor(_VariantCall::Rect2_init1, Variant::RECT2, "position", Variant::VECTOR2, "size", Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Rect2_init2, Variant::RECT2, "x", Variant::FLOAT, "y", Variant::FLOAT, "width", Variant::FLOAT, "height", Variant::FLOAT); - _VariantCall::add_constructor(_VariantCall::Rect2i_init1, Variant::RECT2I, "position", Variant::VECTOR2, "size", Variant::VECTOR2); + _VariantCall::add_constructor(_VariantCall::Rect2i_init1, Variant::RECT2I, "position", Variant::VECTOR2I, "size", Variant::VECTOR2I); _VariantCall::add_constructor(_VariantCall::Rect2i_init2, Variant::RECT2I, "x", Variant::INT, "y", Variant::INT, "width", Variant::INT, "height", Variant::INT); _VariantCall::add_constructor(_VariantCall::Transform2D_init2, Variant::TRANSFORM2D, "rotation", Variant::FLOAT, "position", Variant::VECTOR2); @@ -1997,7 +1989,7 @@ void register_variant_methods() { _VariantCall::add_constructor(_VariantCall::Callable_init2, Variant::CALLABLE, "object", Variant::OBJECT, "method_name", Variant::STRING_NAME); _VariantCall::add_constructor(_VariantCall::Signal_init2, Variant::SIGNAL, "object", Variant::OBJECT, "signal_name", Variant::STRING_NAME); - /* REGISTER CONSTANTS */ + /* Register constants */ _populate_named_colors(); for (Map::Element *color = _named_colors.front(); color; color = color->next()) { diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index c547563a6ed1..4f95b44f83c1 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -176,8 +176,18 @@ Returns [code]true[/code] if the [AABB] is on both sides of a plane. + + + + + + + + + + - + diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index 39228eab79de..969e9cc85b6a 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -63,12 +63,6 @@ If [code]true[/code], the [member animation] is currently playing. - - Strength of the specular light effect of this [AnimatedSprite2D]. - - - The color of the specular light effect. - The animation speed is multiplied by this value. diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 87b7443a8a3d..d0f90f513d4d 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -160,7 +160,7 @@ - + @@ -362,7 +362,7 @@ - + @@ -433,7 +433,7 @@ - + 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/Basis.xml b/doc/classes/Basis.xml index 42ca3ad24b94..4201a31402cf 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -187,25 +187,6 @@ Returns the transposed version of the matrix. - - - - - - - Returns a vector transformed (multiplied) by the matrix. - - - - - - - - - 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. - - diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 7244da56ca4c..fcf2feb3b919 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -238,10 +238,6 @@ If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. - - 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. - 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. diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index ad5c549fee9f..7aaf087540c6 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -48,7 +48,7 @@ - + diff --git a/doc/classes/CanvasGroup.xml b/doc/classes/CanvasGroup.xml new file mode 100644 index 000000000000..ceeda6c3f539 --- /dev/null +++ b/doc/classes/CanvasGroup.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 9f6baae8a3a6..8efa1adae8c3 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -86,16 +86,6 @@ - - - - - - - - - - Draws a colored polygon of any amount of points, convex or concave. @@ -122,19 +112,9 @@ - - - + - - - - - - - - - + Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. @@ -173,16 +153,6 @@ - - - - - - - - - - Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation. @@ -198,16 +168,6 @@ - - - - - - - - - - Draws a polygon of any amount of points, convex or concave. @@ -251,16 +211,6 @@ - - - - - - - - - - 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. @@ -358,16 +308,6 @@ - - - - - - - - - - Draws a texture at a given position. @@ -385,16 +325,6 @@ - - - - - - - - - - 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. @@ -412,17 +342,7 @@ - - - - - - - - - - - + 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 @@ + + The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml new file mode 100644 index 000000000000..0ca132746bea --- /dev/null +++ b/doc/classes/CanvasTexture.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index ef438e422a3f..ffa0fa54c948 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -195,29 +195,6 @@ [/codeblocks] - - - - - - - - - - - - - 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] - - @@ -238,7 +215,7 @@ - + Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 7c0cd981e4c3..09ba4c8b2691 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -12,7 +12,7 @@ - + The fill color. [codeblocks] [gdscript] diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml new file mode 100644 index 000000000000..a6eb78015905 --- /dev/null +++ b/doc/classes/DirectionalLight2D.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + The height of the light. Used with 2D normal mapping. + + + + + + + diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 6a64a7aa5560..95d88e86a611 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -379,7 +379,7 @@ Remember that you have to manage the visibility of all your editor controls manually. - + diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index ba201af5dbb5..c09151405ae8 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -52,10 +52,6 @@ If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. - - 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. - 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. diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index 86dc8e864a4d..a6bcc1301b69 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] diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index c5f0c2df8c85..f6698352aba5 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -11,8 +11,25 @@ https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html + + + + + + + + + + + + + + + + The Light2D's blend mode. See [enum BlendMode] constants for values. + The Light2D's [Color]. @@ -25,15 +42,6 @@ The Light2D's energy value. The larger the value, the stronger the light. - - The Light2D's mode. See [enum Mode] constants for values. - - - The offset of the Light2D's [code]texture[/code]. - - - The height of the Light2D. Used with 2D normal mapping. - The layer mask. Only objects with a matching mask will be affected by the Light2D. @@ -49,9 +57,6 @@ Minimum [code]z[/code] value of objects that are affected by the Light2D. - - Shadow buffer size. - [Color] of shadows cast by the Light2D. @@ -67,26 +72,8 @@ The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching light mask will cast shadows. - - [Texture2D] used for the Light2D's appearance. - - - The [code]texture[/code]'s scale factor. - - - Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. - - - Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. - - - Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. - - - 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. - No filter applies to the shadow map. See [member shadow_filter]. @@ -96,5 +83,14 @@ Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter]. + + Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. + + + Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. + + + Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. + diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 2d475fc4497b..15307de897ac 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -12,7 +12,6 @@ - The button's text that will be displayed inside the button's area. diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index d97e0f0f210d..fe38c0828047 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -31,7 +31,6 @@ - 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. diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 658f0e6c28d3..f711ba4d6b92 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -65,7 +65,7 @@ - + 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 +76,7 @@ - + @@ -99,7 +99,7 @@ - + diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 0b43522bcef3..7c2d56646669 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -20,9 +20,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -128,9 +128,9 @@ - + - + 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]). @@ -144,9 +144,9 @@ - + - + Appends an element at the end of the array. @@ -155,16 +155,16 @@ - + Removes an element from the array by index. - + - + 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 +173,9 @@ - + - + Changes the byte at the given index. diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index ec087e1b39d5..c42d14c5bd85 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -20,9 +20,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -56,9 +56,9 @@ - + - + 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,9 +72,9 @@ - + - + Appends a value to the array. @@ -83,16 +83,16 @@ - + Removes an element from the array by index. - + - + 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 +101,9 @@ - + - + Changes the [Color] at the given index. @@ -123,6 +123,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index a6b726944be7..dd8464825111 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -21,7 +21,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,7 @@ - + @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index f867cda3b661..91c3f4874b56 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -21,7 +21,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,7 @@ - + @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index b796d9cacbd7..a0a9922d0c14 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -21,9 +21,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +57,9 @@ - + - + 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]). @@ -73,9 +73,9 @@ - + - + Appends a value to the array. @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,9 @@ - + - + Changes the integer at the given index. @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 3d0d9a136098..542dabcfa058 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -21,9 +21,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +57,9 @@ - + - + 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]). @@ -73,9 +73,9 @@ - + - + Appends a value to the array. @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,9 @@ - + - + Changes the integer at the given index. @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 5f3a16ac73c0..7c710cf0fb71 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -21,9 +21,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +57,9 @@ - + - + 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]). @@ -73,9 +73,9 @@ - + - + Appends a string element at end of the array. @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,9 @@ - + - + Changes the [String] at the given index. @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index cb62aea95c12..98034afc932c 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -21,9 +21,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -57,9 +57,9 @@ - + - + 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]). @@ -73,9 +73,9 @@ - + - + Inserts a [Vector2] at the end. @@ -84,16 +84,16 @@ - + Removes an element from the array by index. - + - + 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 +102,9 @@ - + - + Changes the [Vector2] at the given index. @@ -124,6 +124,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index f268fbcc830d..3db33fbcd9df 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -20,9 +20,9 @@ - + - + Appends an element at the end of the array (alias of [method push_back]). @@ -56,9 +56,9 @@ - + - + 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,9 +72,9 @@ - + - + Inserts a [Vector3] at the end. @@ -83,16 +83,16 @@ - + Removes an element from the array by index. - + - + 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 +101,9 @@ - + - + Changes the [Vector3] at the given index. @@ -123,6 +123,22 @@ Sorts the elements of the array in ascending order. + + + + + + + + + + + + + + + + diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index d420e6ccdc7e..9352eee1eb0e 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -77,7 +77,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -99,11 +99,11 @@ - + - + - + 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 +112,7 @@ - + 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 +121,7 @@ - + Returns [code]true[/code] if [code]point[/code] is located above the plane. diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml new file mode 100644 index 000000000000..9337bc835195 --- /dev/null +++ b/doc/classes/PointLight2D.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + The height of the light. Used with 2D normal mapping. + + + The offset of the light's [member texture]. + + + [Texture2D] used for the light's appearance. + + + The [member texture]'s scale factor. + + + + + diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 335df1ac3f36..3aca83658d4f 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -101,10 +101,6 @@ If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code]. - - 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. - The offset applied to each vertex. @@ -114,14 +110,8 @@ - - - - - - The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 91998ead34ac..856c2e7c3732 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -818,6 +818,8 @@ Specifies the maximum amount of log files allowed (used for rotation). + + 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. @@ -1004,8 +1006,11 @@ - - If [code]true[/code], forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles. + + + + + Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. @@ -1102,6 +1107,8 @@ + + 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. diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 6c95e303b850..76cfa0d99dfd 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -16,45 +16,45 @@ - + + + + + + + - Constructs a quaternion from the given [Basis]. + Constructs a quaternion defined by the given values. - + + + - 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). + Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. - - - + - Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. + 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). - - - - - - - + - Constructs a quaternion defined by the given values. + Constructs a quaternion from the given [Basis]. @@ -75,7 +75,7 @@ - + Returns the dot product of two quaternions. @@ -98,7 +98,7 @@ - + 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,26 +132,6 @@ Returns a copy of the quaternion, normalized to unit length. - - - - - - - - - Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector. - - - - - - - - - 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). - - @@ -175,15 +155,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. - - - - - - - Returns a vector transformed (multiplied) by this quaternion. - - diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index aaeaa7629de1..a72ba35a9841 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -108,7 +108,7 @@ - + Returns a copy of the [Rect2] grown a given amount of units towards each direction individually. diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 8b29daa26434..de2932e8161d 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -15,9 +15,9 @@ - + - + Constructs a [Rect2i] by position and size. @@ -106,7 +106,7 @@ - + Returns a copy of the [Rect2i] grown a given amount of units towards each direction individually. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 857c13deb582..5830a8452c2d 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -404,28 +404,6 @@ The mode of the light, see [enum CanvasLightMode] constants. - - - - - - - - - Sets the texture's scale factor of the light. Equivalent to [member Light2D.texture_scale]. - - - - - - - - - - - Sets the width of the shadow buffer, size gets scaled to the next power of two for this. - - @@ -478,7 +456,7 @@ - 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]. @@ -489,7 +467,18 @@ - 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]. + + + + + + + + + + + Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale]. @@ -708,6 +697,8 @@ + + @@ -2965,6 +2956,16 @@ Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options. + + + + + + + + + + @@ -3674,18 +3675,25 @@ Max value for [enum CanvasItemTextureRepeat] enum. - + + + + + + + + + + + Adds light color additive to the canvas. - + Adds light color subtractive to the canvas. - + The light adds color depending on transparency. - - The light adds color depending on mask. - Do not apply a filter to canvas light shadows. diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 1a05c02b6005..51490caf6f39 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -33,7 +33,7 @@ - + diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 8205889ea75c..c56596423d13 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -53,10 +53,6 @@ The number of columns in the sprite sheet. - - 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. - The texture's drawing offset. @@ -69,15 +65,6 @@ The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. - - Strength of the specular light effect of this [Sprite2D]. - - - The color of the specular light effect. - - - The specular map is used for more control on the shininess effect. - [Texture2D] object to draw. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 4034a5ee0716..fcd8f57cd1c8 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -314,6 +314,14 @@ Returns the bigrams (pairs of consecutive letters) of this string. + + + + + + + + @@ -397,17 +405,6 @@ Returns [code]true[/code] if the string ends with the given string. - - - - - - - - - Erases [code]chars[/code] characters from the string starting from [code]position[/code]. - - @@ -485,10 +482,13 @@ + + - 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] @@ -512,20 +512,6 @@ [/codeblock] - - - - - - - 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] - - @@ -990,11 +976,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. - + - 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. @@ -1025,25 +1011,25 @@ Returns the string converted to uppercase. - + Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes). - + Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes). - + - 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]. @@ -1067,8 +1053,10 @@ + + - 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. diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index f8aa14cb2b6d..6f5577b61b59 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -119,10 +119,6 @@ Modulates the color of the texture when this style box is drawn. - - 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. - 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/TextEdit.xml b/doc/classes/TextEdit.xml index a23a4936f8d5..53d706db2d45 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]. + + + + + + @@ -227,6 +233,18 @@ Returns the selection begin line. + + + + + + + + + + + + @@ -555,6 +573,18 @@ + + + + + + + + + + + + @@ -732,6 +762,16 @@ Search from end to beginning. + + + + + + + + + + diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index f283efdc3d08..ff8b439a3dc7 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -22,16 +22,6 @@ - - - - - - - - - - Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [code]position[/code]. @@ -49,16 +39,6 @@ - - - - - - - - - - Draws the texture using a [CanvasItem] with the [RenderingServer] API. @@ -76,17 +56,7 @@ - - - - - - - - - - - + Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 9ab9d9ca7a5c..adc5880c7152 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -389,15 +389,6 @@ Returns the offset of the tile's navigation polygon. - - - - - - - Returns the tile's normal map texture. - - @@ -600,18 +591,6 @@ Sets an offset for the tile's navigation polygon. - - - - - - - - - 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. - - diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 52dda75dff9b..8e539e64f792 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -79,7 +79,7 @@ - + @@ -97,7 +97,7 @@ - + Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. @@ -153,24 +153,6 @@ Unlike [method rotated] and [method scaled], this does not use matrix multiplication. - - - - - - - Transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform. - - - - - - - - - Inverse-transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform. - - diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index b23bb4d33bf2..66adeab3a6f4 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -17,10 +17,12 @@ - + + + - Constructs the transform from a 3D [Transform]. + Constructs the transform from a given angle (in radians) and position. @@ -39,12 +41,10 @@ - - - + - Constructs the transform from a given angle (in radians) and position. + Constructs the transform from a 3D [Transform]. @@ -98,9 +98,9 @@ - + - + Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0). @@ -116,7 +116,7 @@ - + Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component. @@ -157,24 +157,6 @@ Unlike [method rotated] and [method scaled], this does not use matrix multiplication. - - - - - - - Transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform. - - - - - - - - - Inverse-transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform. - - diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 025d6474ee57..231e0ed06a6e 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -177,7 +177,7 @@ - + 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 +208,7 @@ - + @@ -296,7 +296,7 @@ - + diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index b26fe09e917d..7e47f768b48c 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -74,7 +74,7 @@ - + Returns the cross product of this vector and [code]b[/code]. @@ -126,7 +126,7 @@ - + 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 +152,7 @@ - + Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. @@ -226,7 +226,7 @@ - + Returns the outer product with [code]b[/code]. @@ -271,7 +271,7 @@ - + diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index f977b81ce7d0..45e237fb2312 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -36,6 +36,12 @@ Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. + + + + + + diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 84974874def0..85dc5e8fd8db 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. + + + + If [code]true[/code], the viewport should render its background as transparent. + + The custom [World2D] which can be used as 2D environment source. diff --git a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml index f13d449064f0..1c22070ab1be 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml @@ -31,5 +31,7 @@ + + diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index a147ac078065..8e425b62da54 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -445,10 +445,6 @@ void PointLight2D::_bind_methods() { PointLight2D::PointLight2D() { RS::get_singleton()->canvas_light_set_mode(_get_light(), RS::CANVAS_LIGHT_MODE_POINT); - _scale = 1.0; -} - -PointLight2D::~PointLight2D() { } ////////// @@ -457,6 +453,7 @@ void DirectionalLight2D::set_max_distance(float p_distance) { max_distance = p_distance; RS::get_singleton()->canvas_light_set_directional_distance(_get_light(), max_distance); } + float DirectionalLight2D::get_max_distance() const { return max_distance; } @@ -468,7 +465,8 @@ void DirectionalLight2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_RANGE, "0,16384.0,1.0,or_greater"), "set_max_distance", "get_max_distance"); } + DirectionalLight2D::DirectionalLight2D() { RS::get_singleton()->canvas_light_set_mode(_get_light(), RS::CANVAS_LIGHT_MODE_DIRECTIONAL); - set_max_distance(10000.0); + set_max_distance(max_distance); // Update RenderingServer. } diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 5f53fa227afb..7dfeddc8e50e 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -58,7 +58,6 @@ class Light2D : public Node2D { Color color; Color shadow_color; float height; - float _scale; float energy; int z_min; int z_max; @@ -139,7 +138,7 @@ class PointLight2D : public Light2D { GDCLASS(PointLight2D, Light2D); private: - float _scale; + float _scale = 1.0; Ref texture; Vector2 texture_offset; @@ -172,7 +171,6 @@ class PointLight2D : public Light2D { String get_configuration_warning() const override; PointLight2D(); - ~PointLight2D(); }; class DirectionalLight2D : public Light2D { diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 1c9e80ac51a9..121bf3ee929c 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2190,6 +2190,13 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_REPEAT_MIRROR); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_REPEAT_MAX); + BIND_ENUM_CONSTANT(CANVAS_GROUP_MODE_DISABLED); + BIND_ENUM_CONSTANT(CANVAS_GROUP_MODE_OPAQUE); + BIND_ENUM_CONSTANT(CANVAS_GROUP_MODE_TRANSPARENT); + + BIND_ENUM_CONSTANT(CANVAS_LIGHT_MODE_POINT); + BIND_ENUM_CONSTANT(CANVAS_LIGHT_MODE_DIRECTIONAL); + BIND_ENUM_CONSTANT(CANVAS_LIGHT_BLEND_MODE_ADD); BIND_ENUM_CONSTANT(CANVAS_LIGHT_BLEND_MODE_SUB); BIND_ENUM_CONSTANT(CANVAS_LIGHT_BLEND_MODE_MIX); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 409658ed1a34..3aa15623ebef 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1445,6 +1445,7 @@ VARIANT_ENUM_CAST(RenderingServer::ShadowCastingSetting); VARIANT_ENUM_CAST(RenderingServer::NinePatchAxisMode); VARIANT_ENUM_CAST(RenderingServer::CanvasItemTextureFilter); VARIANT_ENUM_CAST(RenderingServer::CanvasItemTextureRepeat); +VARIANT_ENUM_CAST(RenderingServer::CanvasGroupMode); VARIANT_ENUM_CAST(RenderingServer::CanvasLightMode); VARIANT_ENUM_CAST(RenderingServer::CanvasLightBlendMode); VARIANT_ENUM_CAST(RenderingServer::CanvasLightShadowFilter);