diff options
Diffstat (limited to 'doc/classes')
213 files changed, 2528 insertions, 626 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 7f7df33471..2b1770f12b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -27,6 +27,9 @@ <member name="Engine" type="Engine" setter="" getter=""> The [Engine] singleton. </member> + <member name="EngineDebugger" type="EngineDebugger" setter="" getter=""> + The [EngineDebugger] singleton. + </member> <member name="Geometry2D" type="Geometry2D" setter="" getter=""> The [Geometry2D] singleton. </member> @@ -353,16 +356,16 @@ Right Direction key. </constant> <constant name="KEY_BACK" value="16777280" enum="KeyList"> - Back key. + Media back key. Not to be confused with the Back button on an Android device. </constant> <constant name="KEY_FORWARD" value="16777281" enum="KeyList"> - Forward key. + Media forward key. </constant> <constant name="KEY_STOP" value="16777282" enum="KeyList"> - Stop key. + Media stop key. </constant> <constant name="KEY_REFRESH" value="16777283" enum="KeyList"> - Refresh key. + Media refresh key. </constant> <constant name="KEY_VOLUMEDOWN" value="16777284" enum="KeyList"> Volume down key. diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index ae80abc5d2..faa380ff33 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -4,10 +4,12 @@ Axis-Aligned Bounding Box. </brief_description> <description> - AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + [AABB] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2]. + [b]Note:[/b] Unlike [Rect2], [AABB] does not have a variant that uses integer coordinates. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="AABB"> diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml index ff433370bd..f577bab992 100644 --- a/doc/classes/AESContext.xml +++ b/doc/classes/AESContext.xml @@ -5,7 +5,8 @@ </brief_description> <description> This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported. - [codeblock] + [codeblocks] + [gdscript] extends Node var aes = AESContext.new() @@ -35,7 +36,45 @@ aes.finish() # Check CBC assert(decrypted == data.to_utf8()) - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + using System.Diagnostics; + + public class Example : Node + { + public AESContext Aes = new AESContext(); + public override void _Ready() + { + string key = "My secret key!!!"; // Key must be either 16 or 32 bytes. + string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply padding if needed. + // Encrypt ECB + Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8()); + byte[] encrypted = Aes.Update(data.ToUTF8()); + Aes.Finish(); + // Decrypt ECB + Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8()); + byte[] decrypted = Aes.Update(encrypted); + Aes.Finish(); + // Check ECB + Debug.Assert(decrypted == data.ToUTF8()); + + string iv = "My secret iv!!!!"; // IV must be of exactly 16 bytes. + // Encrypt CBC + Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8(), iv.ToUTF8()); + encrypted = Aes.Update(data.ToUTF8()); + Aes.Finish(); + // Decrypt CBC + Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8(), iv.ToUTF8()); + decrypted = Aes.Update(encrypted); + Aes.Finish(); + // Check CBC + Debug.Assert(decrypted == data.ToUTF8()); + } + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 2695e86f47..0cd7d3dc25 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -7,7 +7,8 @@ A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path]. It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. - [codeblock] + [codeblocks] + [gdscript] class MyAStar: extends AStar @@ -16,7 +17,21 @@ func _estimate_cost(u, v): return min(0, abs(u - v) - 1) - [/codeblock] + [/gdscript] + [csharp] + public class MyAStar : AStar + { + public override float _ComputeCost(int u, int v) + { + return Mathf.Abs(u - v); + } + public override float _EstimateCost(int u, int v) + { + return Mathf.Min(0, Mathf.Abs(u - v) - 1); + } + } + [/csharp] + [/codeblocks] [method _estimate_cost] should return a lower bound of the distance, i.e. [code]_estimate_cost(u, v) <= _compute_cost(u, v)[/code]. This serves as a hint to the algorithm because the custom [code]_compute_cost[/code] might be computation-heavy. If this is not the case, make [method _estimate_cost] return the same value as [method _compute_cost] to provide the algorithm with the most accurate information. </description> <tutorials> @@ -57,10 +72,16 @@ </argument> <description> Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar(); + astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1 + [/csharp] + [/codeblocks] If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values. </description> </method> @@ -95,12 +116,20 @@ </argument> <description> Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar.new() astar.add_point(1, Vector3(1, 1, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2, false) - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar(); + astar.AddPoint(1, new Vector3(1, 1, 0)); + astar.AddPoint(2, new Vector3(0, 5, 0)); + astar.ConnectPoints(1, 2, false); + [/csharp] + [/codeblocks] </description> </method> <method name="disconnect_points"> @@ -142,13 +171,22 @@ </argument> <description> Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar(); + astar.AddPoint(1, new Vector3(0, 0, 0)); + astar.AddPoint(2, new Vector3(0, 5, 0)); + astar.ConnectPoints(1, 2); + Vector3 res = astar.GetClosestPositionInSegment(new Vector3(3, 3, 0)); // Returns (0, 3, 0) + [/csharp] + [/codeblocks] The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point. </description> </method> @@ -161,7 +199,8 @@ </argument> <description> Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 @@ -174,7 +213,20 @@ astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar(); + astar.AddPoint(1, new Vector3(0, 0, 0)); + astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1 + astar.AddPoint(3, new Vector3(1, 1, 0)); + astar.AddPoint(4, new Vector3(2, 0, 0)); + astar.ConnectPoints(1, 2, false); + astar.ConnectPoints(2, 3, false); + astar.ConnectPoints(4, 3, false); + astar.ConnectPoints(1, 4, false); + int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3] + [/csharp] + [/codeblocks] If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> </method> @@ -192,7 +244,8 @@ </argument> <description> Returns an array with the IDs of the points that form the connection with the given point. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0)) @@ -203,7 +256,19 @@ astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar(); + astar.AddPoint(1, new Vector3(0, 0, 0)); + astar.AddPoint(2, new Vector3(0, 1, 0)); + astar.AddPoint(3, new Vector3(1, 1, 0)); + astar.AddPoint(4, new Vector3(2, 0, 0)); + astar.ConnectPoints(1, 2, true); + astar.ConnectPoints(1, 3, true); + + int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3] + [/csharp] + [/codeblocks] </description> </method> <method name="get_point_count" qualifiers="const"> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 622d336ef6..1540d8dacc 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -44,10 +44,16 @@ </argument> <description> Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar2D.new() astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(1, 0), 4); // Adds the point (1, 0) with weight_scale 4 and id 1 + [/csharp] + [/codeblocks] If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values. </description> </method> @@ -80,12 +86,20 @@ </argument> <description> Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar2D.new() astar.add_point(1, Vector2(1, 1)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2, false) - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(1, 1)); + astar.AddPoint(2, new Vector2(0, 5)); + astar.ConnectPoints(1, 2, false); + [/csharp] + [/codeblocks] </description> </method> <method name="disconnect_points"> @@ -125,13 +139,22 @@ </argument> <description> Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(0, 0)); + astar.AddPoint(2, new Vector2(0, 5)); + astar.ConnectPoints(1, 2); + Vector2 res = astar.GetClosestPositionInSegment(new Vector2(3, 3)); // Returns (0, 3) + [/csharp] + [/codeblocks] The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point. </description> </method> @@ -144,7 +167,8 @@ </argument> <description> Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1 @@ -157,7 +181,21 @@ astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(0, 0)); + astar.AddPoint(2, new Vector2(0, 1), 1); // Default weight is 1 + astar.AddPoint(3, new Vector2(1, 1)); + astar.AddPoint(4, new Vector2(2, 0)); + + astar.ConnectPoints(1, 2, false); + astar.ConnectPoints(2, 3, false); + astar.ConnectPoints(4, 3, false); + astar.ConnectPoints(1, 4, false); + int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3] + [/csharp] + [/codeblocks] If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> </method> @@ -175,7 +213,8 @@ </argument> <description> Returns an array with the IDs of the points that form the connection with the given point. - [codeblock] + [codeblocks] + [gdscript] var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1)) @@ -186,7 +225,20 @@ astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] - [/codeblock] + [/gdscript] + [csharp] + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(0, 0)); + astar.AddPoint(2, new Vector2(0, 1)); + astar.AddPoint(3, new Vector2(1, 1)); + astar.AddPoint(4, new Vector2(2, 0)); + + astar.ConnectPoints(1, 2, true); + astar.ConnectPoints(1, 3, true); + + int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3] + [/csharp] + [/codeblocks] </description> </method> <method name="get_point_count" qualifiers="const"> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 6b1864b679..e5eb216062 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -76,6 +76,7 @@ <signals> <signal name="cancelled"> <description> + Emitted when the dialog is closed or the button created with [method add_cancel] is pressed. </description> </signal> <signal name="confirmed"> diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index 8d0534ccd2..e23a4fe9f8 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -5,8 +5,10 @@ </brief_description> <description> Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel. + [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps. </description> <tutorials> + <link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link> </tutorials> <methods> <method name="is_playing" qualifiers="const"> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index ad9706a52a..e1fb78e5b5 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -7,6 +7,7 @@ Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel. </description> <tutorials> + <link title="2D Sprite animation (also applies to 3D)">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link> </tutorials> <methods> <method name="is_playing" qualifiers="const"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 68f0a630ef..9529c60771 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -5,7 +5,8 @@ </brief_description> <description> An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track. - [codeblock] + [codeblocks] + [gdscript] # This creates an animation that makes the node "Enemy" move to the right by # 100 pixels in 0.5 seconds. var animation = Animation.new() @@ -13,11 +14,21 @@ animation.track_set_path(track_index, "Enemy:position:x") animation.track_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100) - [/codeblock] + [/gdscript] + [csharp] + // This creates an animation that makes the node "Enemy" move to the right by + // 100 pixels in 0.5 seconds. + var animation = new Animation(); + int trackIndex = animation.AddTrack(Animation.TrackType.Value); + animation.TrackSetPath(trackIndex, "Enemy:position:x"); + animation.TrackInsertKey(trackIndex, 0.0f, 0); + animation.TrackInsertKey(trackIndex, 0.5f, 100); + [/csharp] + [/codeblocks] Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> + <link title="Animation tutorial index">https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> </tutorials> <methods> <method name="add_track"> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 3d6ebd5934..8204b456d9 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -8,7 +8,7 @@ Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_input"> diff --git a/doc/classes/AnimationNodeAdd2.xml b/doc/classes/AnimationNodeAdd2.xml index 48983a624e..63127ade9a 100644 --- a/doc/classes/AnimationNodeAdd2.xml +++ b/doc/classes/AnimationNodeAdd2.xml @@ -7,7 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Blends two animations additively based on an amount value in the [code][0.0, 1.0][/code] range. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml index 1bfebc91fc..94a6ae4221 100644 --- a/doc/classes/AnimationNodeAdd3.xml +++ b/doc/classes/AnimationNodeAdd3.xml @@ -11,7 +11,7 @@ - A +add animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index ab44148c15..d8ac5413fd 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -7,7 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Only features one output set using the [member animation] property. Use it as an input for [AnimationNode] that blend animations together. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml index 2b56167225..e2cd12e685 100644 --- a/doc/classes/AnimationNodeBlend2.xml +++ b/doc/classes/AnimationNodeBlend2.xml @@ -7,7 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Blends two animations linearly based on an amount value in the [code][0.0, 1.0][/code] range. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlend3.xml b/doc/classes/AnimationNodeBlend3.xml index 5a306a225d..7c81b37663 100644 --- a/doc/classes/AnimationNodeBlend3.xml +++ b/doc/classes/AnimationNodeBlend3.xml @@ -11,7 +11,7 @@ - A +blend animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlendSpace1D.xml b/doc/classes/AnimationNodeBlendSpace1D.xml index 6e82f0afb7..263b59910b 100644 --- a/doc/classes/AnimationNodeBlendSpace1D.xml +++ b/doc/classes/AnimationNodeBlendSpace1D.xml @@ -10,7 +10,7 @@ You can set the extents of the axis using the [member min_space] and [member max_space]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_blend_point"> diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index f8680ba8ec..460c11cc5e 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -9,7 +9,7 @@ You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to create up the blend space by hand. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_blend_point"> diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 4a34d75ff9..8f87ce453f 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -7,7 +7,7 @@ This node may contain a sub-tree of any other blend type nodes, such as mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_node"> diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index 4ba0b82df6..d5793e5839 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -7,7 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_mix_mode" qualifiers="const"> diff --git a/doc/classes/AnimationNodeOutput.xml b/doc/classes/AnimationNodeOutput.xml index 38b05eb650..7640f4dcfa 100644 --- a/doc/classes/AnimationNodeOutput.xml +++ b/doc/classes/AnimationNodeOutput.xml @@ -6,7 +6,7 @@ <description> </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index 3b351a3345..e08e288c59 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -6,13 +6,19 @@ <description> Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically. [b]Example:[/b] - [codeblock] + [codeblocks] + [gdscript] var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") - [/codeblock] + [/gdscript] + [csharp] + var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback; + stateMachine.Travel("some_state"); + [/csharp] + [/codeblocks] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_node"> diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml index f4b89a5086..60ff425cdb 100644 --- a/doc/classes/AnimationNodeStateMachinePlayback.xml +++ b/doc/classes/AnimationNodeStateMachinePlayback.xml @@ -6,13 +6,19 @@ <description> Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code]. [b]Example:[/b] - [codeblock] + [codeblocks] + [gdscript] var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") - [/codeblock] + [/gdscript] + [csharp] + var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback; + stateMachine.Travel("some_state"); + [/csharp] + [/codeblocks] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_current_node" qualifiers="const"> diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index f0b7cc4099..2f0ebd7de6 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -5,16 +5,21 @@ <description> </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> <members> <member name="advance_condition" type="StringName" setter="set_advance_condition" getter="get_advance_condition" default="@"""> Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to [code]"idle"[/code]: - [codeblock] - $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) - [/codeblock] + [codeblocks] + [gdscript] + $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0)) + [/gdscript] + [csharp] + GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.x == 0)); + [/csharp] + [/codeblocks] </member> <member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance" default="false"> Turn on the transition automatically when this state is reached. This works best with [constant SWITCH_MODE_AT_END]. diff --git a/doc/classes/AnimationNodeTimeScale.xml b/doc/classes/AnimationNodeTimeScale.xml index 5c2e6cb692..334fdb0b95 100644 --- a/doc/classes/AnimationNodeTimeScale.xml +++ b/doc/classes/AnimationNodeTimeScale.xml @@ -7,7 +7,7 @@ Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeTimeSeek.xml b/doc/classes/AnimationNodeTimeSeek.xml index 0fef106da5..eb5335c792 100644 --- a/doc/classes/AnimationNodeTimeSeek.xml +++ b/doc/classes/AnimationNodeTimeSeek.xml @@ -7,7 +7,7 @@ This node can be used to cause a seek command to happen to any sub-children of the graph. After setting the time, this value returns to -1. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 11250c5b17..8338f0d39a 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -7,7 +7,7 @@ Simple state machine for cases which don't require a more advanced [AnimationNodeStateMachine]. Animations can be connected to the inputs and transition times can be specified. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_input_caption" qualifiers="const"> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 1420b1bf64..ac91272e00 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -9,8 +9,8 @@ Updating the target properties of animations occurs at process time. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> + <link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link> + <link title="Animation tutorial index">https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> </tutorials> <methods> <method name="add_animation"> @@ -235,7 +235,8 @@ The name of the animation to play when the scene loads. </member> <member name="current_animation" type="String" setter="set_current_animation" getter="get_current_animation" default=""""> - The name of the current animation, "" if not playing anything. When being set, does not restart the animation. See also [method play]. + The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [method play] for more information on playing animations. + [b]Note[/b]: while this property appears in the inspector, it's not meant to be edited and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation]. </member> <member name="current_animation_length" type="float" setter="" getter="get_current_animation_length"> The length (in seconds) of the currently being played animation. diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index dd04f4ce3f..cc8e83f509 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -7,8 +7,8 @@ Note: When linked with an [AnimationPlayer], several properties and methods of the corresponding [AnimationPlayer] will not function as expected. Playback and transitions should be handled using only the [AnimationTree] and its constituent [AnimationNode](s). The [AnimationPlayer] node should be used solely for adding, deleting, and editing animations. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> - <link>https://github.com/godotengine/tps-demo</link> + <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> + <link title="Third-person shooter demo code repository">https://github.com/godotengine/tps-demo</link> </tutorials> <methods> <method name="advance"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 4190cbe6b9..e98c0af0d9 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -7,7 +7,7 @@ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link> + <link title="Using Area2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link> </tutorials> <methods> <method name="get_collision_layer_bit" qualifiers="const"> @@ -97,10 +97,10 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> - The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. + The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans to determine collision detection. + The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="98.0"> The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index a94cecd879..ad9eff3a64 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -96,10 +96,10 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> - The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. + The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans to determine collision detection. + The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="9.8"> The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 61df5e092e..87b7443a8a 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -6,20 +6,38 @@ <description> Generic array which can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.). [b]Example:[/b] - [codeblock] + [codeblocks] + [gdscript] var array = ["One", 2, 3, "Four"] print(array[0]) # One. print(array[2]) # 3. print(array[-1]) # Four. array[2] = "Three" print(array[-2]) # Three. - [/codeblock] + [/gdscript] + [csharp] + var array = new Godot.Collections.Array{"One", 2, 3, "Four"}; + GD.Print(array[0]); // One. + GD.Print(array[2]); // 3. + GD.Print(array[array.Count - 1]); // Four. + array[2] = "Three"; + GD.Print(array[array.Count - 2]); // Three. + [/csharp] + [/codeblocks] Arrays can be concatenated using the [code]+[/code] operator: - [codeblock] + [codeblocks] + [gdscript] var array1 = ["One", 2] var array2 = [3, "Four"] print(array1 + array2) # ["One", 2, 3, "Four"] - [/codeblock] + [/gdscript] + [csharp] + // Array concatenation is not possible with C# arrays, but is with Godot.Collections.Array. + var array1 = new Godot.Collections.Array("One", 2); + var array2 = new Godot.Collections.Array(3, "Four"); + GD.Print(array1 + array2); // Prints [One, 2, 3, Four] + [/csharp] + [/codeblocks] [b]Note:[/b] Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use [method duplicate]. </description> <tutorials> @@ -119,7 +137,8 @@ <return type="Variant"> </return> <description> - Returns the last element of the array. Throws an error and returns [code]null[/code] if the array is empty. + Returns the last element of the array. Prints an error and returns [code]null[/code] if the array is empty. + [b]Note:[/b] Calling this function is not the same as writing [code]array[-1][/code]. If the array is empty, accessing by index will pause project execution when running from the editor. </description> </method> <method name="bsearch"> @@ -216,7 +235,8 @@ <return type="Variant"> </return> <description> - Returns the first element of the array. Throws an error and returns [code]null[/code] if the array is empty. + Returns the first element of the array. Prints an error and returns [code]null[/code] if the array is empty. + [b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor. </description> </method> <method name="has"> @@ -226,18 +246,39 @@ </argument> <description> Returns [code]true[/code] if the array contains the given value. - [codeblock] + [codeblocks] + [gdscript] print(["inside", 7].has("inside")) # True print(["inside", 7].has("outside")) # False print(["inside", 7].has(7)) # True print(["inside", 7].has("7")) # False - [/codeblock] + [/gdscript] + [csharp] + var arr = new Godot.Collections.Array{"inside", 7}; + // has is renamed to Contains + GD.Print(arr.Contains("inside")); // True + GD.Print(arr.Contains("outside")); // False + GD.Print(arr.Contains(7)); // True + GD.Print(arr.Contains("7")); // False + [/csharp] + [/codeblocks] + [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows: - [codeblock] + [codeblocks] + [gdscript] # Will evaluate to `true`. if 2 in [2, 4, 6, 8]: - pass - [/codeblock] + print("Containes!") + [/gdscript] + [csharp] + // As there is no "in" keyword in C#, you have to use Contains + var array = new Godot.Collections.Array{2, 4, 6, 8}; + if (array.Contains(2)) + { + GD.Print("Containes!"); + } + [/csharp] + [/codeblocks] </description> </method> <method name="hash"> @@ -283,14 +324,14 @@ <return type="Variant"> </return> <description> - Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. + Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty, without printing an error message. </description> </method> <method name="pop_front"> <return type="Variant"> </return> <description> - Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. + Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, without printing an error message. </description> </method> <method name="push_back"> @@ -317,7 +358,7 @@ <argument index="0" name="position" type="int"> </argument> <description> - Removes an element from the array by index. + Removes an element from the array by index. If the index does not exist in the array, nothing happens. </description> </method> <method name="resize"> @@ -375,11 +416,16 @@ <description> Sorts the array. [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: - [codeblock] + [codeblocks] + [gdscript] var strings = ["string1", "string2", "string10", "string11"] strings.sort() print(strings) # Prints [string1, string10, string11, string2] - [/codeblock] + [/gdscript] + [csharp] + // There is no sort support for Godot.Collections.Array + [/csharp] + [/codeblocks] </description> </method> <method name="sort_custom"> @@ -392,7 +438,8 @@ <description> Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either [code]true[/code] or [code]false[/code]. [b]Note:[/b] you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. - [codeblock] + [codeblocks] + [gdscript] class MyCustomSorter: static func sort_ascending(a, b): if a[0] < b[0]: @@ -402,7 +449,11 @@ var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]] my_items.sort_custom(MyCustomSorter, "sort_ascending") print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]]. - [/codeblock] + [/gdscript] + [csharp] + // There is no custom sort support for Godot.Collections.Array + [/csharp] + [/codeblocks] </description> </method> </methods> diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index b45716544a..4edf69ccb2 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -6,27 +6,48 @@ <description> The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays. The most basic example is the creation of a single triangle: - [codeblock] + [codeblocks] + [gdscript] var vertices = PackedVector3Array() vertices.push_back(Vector3(0, 1, 0)) vertices.push_back(Vector3(1, 0, 0)) vertices.push_back(Vector3(0, 0, 1)) + # Initialize the ArrayMesh. var arr_mesh = ArrayMesh.new() var arrays = [] arrays.resize(ArrayMesh.ARRAY_MAX) arrays[ArrayMesh.ARRAY_VERTEX] = vertices + # Create the Mesh. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) var m = MeshInstance3D.new() m.mesh = arr_mesh - [/codeblock] + [/gdscript] + [csharp] + var vertices = new Godot.Collections.Array<Vector3>(); + vertices.Add(new Vector3(0, 1, 0)); + vertices.Add(new Vector3(1, 0, 0)); + vertices.Add(new Vector3(0, 0, 1)); + + // Initialize the ArrayMesh. + var arrMesh = new ArrayMesh(); + var arrays = new Godot.Collections.Array(); + arrays.Resize((int)ArrayMesh.ArrayType.Max); + arrays[(int)ArrayMesh.ArrayType.Vertex] = vertices; + + // Create the Mesh. + arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays); + var m = new MeshInstance(); + m.Mesh = arrMesh; + [/csharp] + [/codeblocks] The [MeshInstance3D] is ready to be added to the [SceneTree] to be shown. See also [ImmediateGeometry3D], [MeshDataTool] and [SurfaceTool] for procedural geometry generation. [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link> + <link title="Procedural geometry using the ArrayMesh">https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link> </tutorials> <methods> <method name="add_blend_shape"> diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml index 3cfeaadb23..24a145b0f3 100644 --- a/doc/classes/AudioEffectDistortion.xml +++ b/doc/classes/AudioEffectDistortion.xml @@ -2,13 +2,14 @@ <class name="AudioEffectDistortion" inherits="AudioEffect" version="4.0"> <brief_description> Adds a distortion audio effect to an Audio bus. - Modify the sound to make it dirty. + Modify the sound to make it distorted. </brief_description> <description> - Modify the sound and make it dirty. Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape. + Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape. By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently. </description> <tutorials> + <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AudioEffectFilter.xml b/doc/classes/AudioEffectFilter.xml index f548fb49cc..293848d204 100644 --- a/doc/classes/AudioEffectFilter.xml +++ b/doc/classes/AudioEffectFilter.xml @@ -7,6 +7,7 @@ Allows frequencies other than the [member cutoff_hz] to pass. </description> <tutorials> + <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <methods> </methods> @@ -20,7 +21,7 @@ Gain amount of the frequencies after the filter. </member> <member name="resonance" type="float" setter="set_resonance" getter="get_resonance" default="0.5"> - Amount of boost in the overtones near the cutoff frequency. + Amount of boost in the frequency range near the cutoff frequency. </member> </members> <constants> diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml index cf620e4417..4ba31f9fc8 100644 --- a/doc/classes/AudioEffectHighShelfFilter.xml +++ b/doc/classes/AudioEffectHighShelfFilter.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" version="4.0"> <brief_description> + Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz]. </brief_description> <description> </description> <tutorials> + <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml index 7cf09b0f05..078e7bf1a1 100644 --- a/doc/classes/AudioEffectLowShelfFilter.xml +++ b/doc/classes/AudioEffectLowShelfFilter.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" version="4.0"> <brief_description> + Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz]. </brief_description> <description> </description> <tutorials> + <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AudioEffectRecord.xml b/doc/classes/AudioEffectRecord.xml index a217342d98..6617d16290 100644 --- a/doc/classes/AudioEffectRecord.xml +++ b/doc/classes/AudioEffectRecord.xml @@ -7,7 +7,7 @@ Allows the user to record sound from a microphone. It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link> + <link title="Recording with microphone">https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link> </tutorials> <methods> <method name="get_recording" qualifiers="const"> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 49c6f5bb34..d5fd5d8f00 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -7,7 +7,7 @@ [AudioServer] is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> + <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <methods> <method name="add_bus"> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index d5c8e42515..58768dc008 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -7,7 +7,7 @@ Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via [AudioStreamSample]) and OGG (via [AudioStreamOGGVorbis]) file formats. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> + <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <methods> <method name="get_length" qualifiers="const"> diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml index e93da411cd..51254f9305 100644 --- a/doc/classes/AudioStreamGenerator.xml +++ b/doc/classes/AudioStreamGenerator.xml @@ -5,7 +5,7 @@ <description> </description> <tutorials> - <link>https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link> + <link title="Audio generator demo project">https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index e3e17b8a93..cd8e8735b6 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -5,7 +5,7 @@ <description> </description> <tutorials> - <link>https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link> + <link title="Audio generator demo project">https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link> </tutorials> <methods> <method name="can_push_buffer" qualifiers="const"> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index dbc3d3e21b..86048ca8c1 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -7,7 +7,7 @@ Plays an audio stream non-positionally. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> + <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <methods> <method name="get_playback_position"> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 844e2316ba..d8b9385736 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -7,7 +7,7 @@ Plays audio that dampens with distance from screen center. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> + <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <methods> <method name="get_playback_position"> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index bd90e3bd1a..aadbc865bb 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -5,9 +5,10 @@ </brief_description> <description> Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. + By default, audio is heard from the camera position. This can be changed by adding a [Listener3D] node to the scene and enabling it by calling [method Listener3D.make_current] on it. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> + <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <methods> <method name="get_playback_position"> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 3812b45b13..bf4d9383ac 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -65,8 +65,8 @@ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active). </member> - <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut"> - [ShortCut] associated to the button. + <member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut"> + [Shortcut] associated to the button. </member> <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true"> If [code]true[/code], the button will add information about its shortcut in the tooltip. diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 1da4e23437..cc4568dda6 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -7,7 +7,7 @@ This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link> + <link title="Spatial material">https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link> </tutorials> <methods> <method name="get_feature" qualifiers="const"> @@ -122,6 +122,7 @@ </member> <member name="billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0"> Controls how the object faces the camera. See [enum BillboardMode]. + [b]Note:[/b] Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details. </member> <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="BaseMaterial3D.BlendMode" default="0"> The material's blend mode. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 47433d7adc..c614a281ae 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -10,8 +10,8 @@ For more information, read the "Matrices and transforms" documentation article. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> + <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> + <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> </tutorials> <methods> <method name="Basis"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index de05cfcd13..e0ccda957f 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -6,7 +6,8 @@ <description> Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme]. [b]Example of creating a button and assigning an action when pressed by code:[/b] - [codeblock] + [codeblocks] + [gdscript] func _ready(): var button = Button.new() button.text = "Click me" @@ -15,8 +16,24 @@ func _button_pressed(): print("Hello world!") - [/codeblock] + [/gdscript] + [csharp] + public override void _Ready() + { + var button = new Button(); + button.Text = "Click me"; + button.Connect("pressed", this, nameof(ButtonPressed)); + AddChild(button); + } + + private void ButtonPressed() + { + GD.Print("Hello world!"); + } + [/csharp] + [/codeblocks] Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index df3ef71a2a..7244da56ca 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -8,7 +8,7 @@ See also [GPUParticles2D], which provides the same functionality with hardware acceleration, but may not run on older devices. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link> + <link title="Particle systems (2D)">https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link> </tutorials> <methods> <method name="convert_from_particles"> diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 3cc74beb58..3bbee993ac 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -6,15 +6,32 @@ <description> [Callable] is a first class object which can be held in variables and passed to functions. It represents a given method in an [Object], and is typically used for signal callbacks. [b]Example:[/b] - [codeblock] + [codeblocks] + [gdscript] var callable = Callable(self, "print_args") func print_args(arg1, arg2, arg3 = ""): prints(arg1, arg2, arg3) + func test(): callable.call("hello", "world") # Prints "hello world". callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args". callable.call("invalid") # Invalid call, should have at least 2 arguments. - [/codeblock] + [/gdscript] + [csharp] + Callable callable = new Callable(this, "print_args"); + public void PrintArgs(object arg1, object arg2, object arg3 = "") + { + GD.PrintS(arg1, arg2, arg3); + } + + public void Test() + { + callable.Call("hello", "world"); // Prints "hello world". + callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.gd)::print_args". + callable.Call("invalid"); // Invalid call, should have at least 2 arguments. + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 899988022f..946c4f8988 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -12,8 +12,8 @@ [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> + <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <methods> <method name="_draw" qualifiers="virtual"> @@ -318,13 +318,22 @@ <description> Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. [b]Example using the default project font:[/b] - [codeblock] + [codeblocks] + [gdscript] # If using this method in a script that redraws constantly, move the # `default_font` declaration to a member variable assigned in `_ready()` # so the Control is only created once. var default_font = Control.new().get_font("font") draw_string(default_font, Vector2(64, 64), "Hello world") - [/codeblock] + [/gdscript] + [csharp] + // If using this method in a script that redraws constantly, move the + // `default_font` declaration to a member variable assigned in `_ready()` + // so the Control is only created once. + Font defaultFont = new Control().GetFont("font"); + DrawString(defaultFont, new Vector2(64, 64), "Hello world"); + [/csharp] + [/codeblocks] See also [method Font.draw]. </description> </method> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index 8202a29d44..89cd28b617 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -7,8 +7,8 @@ Canvas drawing layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link> + <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link title="Canvas layers">https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link> </tutorials> <methods> <method name="get_canvas" qualifiers="const"> diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index c16e448498..d1759adf30 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -7,8 +7,8 @@ By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> - <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> + <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> </methods> @@ -18,11 +18,18 @@ </member> <member name="character" type="int" setter="set_character" getter="get_character" default="0"> The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks: - [codeblock] + [codeblocks] + [gdscript] # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. # See the RichTextEffect documentation for details. char_fx.character = ord("*") - [/codeblock] + [/gdscript] + [csharp] + // `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. + // See the RichTextEffect documentation for details. + charFx.Character = char.GetNumericValue('*'); + [/csharp] + [/codeblocks] </member> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> The color the character will be drawn with. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 9c42091eb8..f912bb98c9 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -5,6 +5,7 @@ </brief_description> <description> A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index 514ff9a691..b4f91cf3a8 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -5,6 +5,7 @@ </brief_description> <description> CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/ClippedCamera3D.xml b/doc/classes/ClippedCamera3D.xml index 58ecec828d..de90247536 100644 --- a/doc/classes/ClippedCamera3D.xml +++ b/doc/classes/ClippedCamera3D.xml @@ -90,7 +90,7 @@ If [code]true[/code], the camera stops on contact with [PhysicsBody3D]s. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. + The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The camera's collision margin. The camera can't get closer than this distance to a colliding object. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml new file mode 100644 index 0000000000..f6bc9e2cca --- /dev/null +++ b/doc/classes/CodeEdit.xml @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CodeEdit" inherits="TextEdit" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="clear_bookmarked_lines"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="clear_breakpointed_lines"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="clear_executing_lines"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="get_bookmarked_lines" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="get_breakpointed_lines" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="get_executing_lines" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="is_line_bookmarked" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_line_breakpointed" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_line_executing" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_line_as_bookmarked"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="bookmarked" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_line_as_breakpoint"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="breakpointed" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_line_as_executing"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="executing" type="bool"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="draw_bookmarks" type="bool" setter="set_draw_bookmarks_gutter" getter="is_drawing_bookmarks_gutter" default="false"> + </member> + <member name="draw_breakpoints_gutter" type="bool" setter="set_draw_breakpoints_gutter" getter="is_drawing_breakpoints_gutter" default="false"> + </member> + <member name="draw_executing_lines" type="bool" setter="set_draw_executing_lines_gutter" getter="is_drawing_executing_lines_gutter" default="false"> + </member> + <member name="draw_fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false"> + </member> + <member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false"> + </member> + <member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false"> + </member> + </members> + <signals> + <signal name="breakpoint_toggled"> + <argument index="0" name="line" type="int"> + </argument> + <description> + </description> + </signal> + </signals> + <constants> + </constants> + <theme_items> + <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> + </theme_item> + <theme_item name="bookmark" type="Texture2D"> + </theme_item> + <theme_item name="bookmark_color" type="Color" default="Color( 0.5, 0.64, 1, 0.8 )"> + </theme_item> + <theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )"> + </theme_item> + <theme_item name="breakpoint" type="Texture2D"> + </theme_item> + <theme_item name="breakpoint_color" type="Color" default="Color( 0.9, 0.29, 0.3, 1 )"> + </theme_item> + <theme_item name="can_fold" type="Texture2D"> + </theme_item> + <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )"> + </theme_item> + <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + </theme_item> + <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )"> + </theme_item> + <theme_item name="completion" type="StyleBox"> + </theme_item> + <theme_item name="completion_background_color" type="Color" default="Color( 0.17, 0.16, 0.2, 1 )"> + </theme_item> + <theme_item name="completion_existing_color" type="Color" default="Color( 0.87, 0.87, 0.87, 0.13 )"> + </theme_item> + <theme_item name="completion_font_color" type="Color" default="Color( 0.67, 0.67, 0.67, 1 )"> + </theme_item> + <theme_item name="completion_lines" type="int" default="7"> + </theme_item> + <theme_item name="completion_max_width" type="int" default="50"> + </theme_item> + <theme_item name="completion_scroll_color" type="Color" default="Color( 1, 1, 1, 1 )"> + </theme_item> + <theme_item name="completion_scroll_width" type="int" default="3"> + </theme_item> + <theme_item name="completion_selected_color" type="Color" default="Color( 0.26, 0.26, 0.27, 1 )"> + </theme_item> + <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> + </theme_item> + <theme_item name="executing_line" type="Texture2D"> + </theme_item> + <theme_item name="executing_line_color" type="Color" default="Color( 0.98, 0.89, 0.27, 1 )"> + </theme_item> + <theme_item name="focus" type="StyleBox"> + </theme_item> + <theme_item name="folded" type="Texture2D"> + </theme_item> + <theme_item name="font" type="Font"> + </theme_item> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + </theme_item> + <theme_item name="font_color_readonly" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> + </theme_item> + <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )"> + </theme_item> + <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )"> + </theme_item> + <theme_item name="line_spacing" type="int" default="4"> + </theme_item> + <theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )"> + </theme_item> + <theme_item name="normal" type="StyleBox"> + </theme_item> + <theme_item name="read_only" type="StyleBox"> + </theme_item> + <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )"> + </theme_item> + <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> + </theme_item> + <theme_item name="space" type="Texture2D"> + </theme_item> + <theme_item name="tab" type="Texture2D"> + </theme_item> + <theme_item name="word_highlighted_color" type="Color" default="Color( 0.8, 0.9, 0.9, 0.15 )"> + </theme_item> + </theme_items> +</class> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index e32ce9c9f9..b4fcf9cd88 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -7,13 +7,13 @@ Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> </methods> <members> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false"> - A disabled collision shape has no effect in the world. + A disabled collision shape has no effect in the world. This property should be changed with [method Object.set_deferred]. </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false"> Sets whether this collision shape should only detect collision on one side (top or bottom). diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml index 76515a65a7..177900dd4f 100644 --- a/doc/classes/CollisionShape3D.xml +++ b/doc/classes/CollisionShape3D.xml @@ -7,10 +7,10 @@ Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area3D] to give it a detection shape, or add it to a [PhysicsBody3D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject3D.shape_owner_get_shape] to get the actual shape. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> - <method name="make_convex_from_brothers"> + <method name="make_convex_from_siblings"> <return type="void"> </return> <description> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 240e70db9f..1d249a253c 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -8,6 +8,7 @@ You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8]. [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. + [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url] </description> <tutorials> </tutorials> @@ -18,14 +19,40 @@ <argument index="0" name="from" type="String"> </argument> <description> - Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [method @GDScript.ColorN]. - [codeblock] + 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 c1 = Color("#ffb2d90a") # ARGB format with "#". - var c2 = Color("ffb2d90a") # ARGB format. var c3 = Color("#b2d90a") # RGB format with "#". var c4 = Color("b2d90a") # RGB format. - [/codeblock] + 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] </description> </method> <method name="Color"> @@ -35,9 +62,14 @@ </argument> <description> Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile). - [codeblock] + [codeblocks] + [gdscript] var c = Color(274) # Equivalent to RGBA(0, 0, 1, 18) - [/codeblock] + [/gdscript] + [csharp] + var c = new Color(274); // Equivalent to RGBA(0, 0, 1, 18) + [/csharp] + [/codeblocks] </description> </method> <method name="Color"> @@ -49,9 +81,14 @@ </argument> <description> Constructs a color from an existing color, but with a custom alpha value. - [codeblock] + [codeblocks] + [gdscript] var red = Color(Color.red, 0.5) # 50% transparent red. - [/codeblock] + [/gdscript] + [csharp] + var red = new Color(Colors.Red, 0.5f); // 50% transparent red. + [/csharp] + [/codeblocks] </description> </method> <method name="Color"> @@ -65,9 +102,14 @@ </argument> <description> Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1. - [codeblock] - var c = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255) - [/codeblock] + [codeblocks] + [gdscript] + 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); // Equivalent to RGBA(51, 255, 178, 255) + [/csharp] + [/codeblocks] </description> </method> <method name="Color"> @@ -83,9 +125,14 @@ </argument> <description> Constructs a color from an RGBA profile using values between 0 and 1. - [codeblock] - var c = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204) - [/codeblock] + [codeblocks] + [gdscript] + 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, 0.8f); // Equivalent to RGBA(51, 255, 178, 255, 204) + [/csharp] + [/codeblocks] </description> </method> <method name="blend"> @@ -95,11 +142,18 @@ </argument> <description> Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values. - [codeblock] + [codeblocks] + [gdscript] var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50% var blended_color = bg.blend(fg) # Brown with alpha of 75% - [/codeblock] + [/gdscript] + [csharp] + var bg = new Color(0.0f, 1.0f, 0.0f, 0.5f); // Green with alpha of 50% + var fg = new Color(1.0f, 0.0f, 0.0f, 0.5f); // Red with alpha of 50% + Color blendedColor = bg.Blend(fg); // Brown with alpha of 75% + [/csharp] + [/codeblocks] </description> </method> <method name="contrasted"> @@ -107,10 +161,16 @@ </return> <description> Returns the most contrasting color. - [codeblock] - var c = Color(0.3, 0.4, 0.9) - var contrasted_color = c.contrasted() # Equivalent to RGBA(204, 229, 102, 255) - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(0.3, 0.4, 0.9) + var contrasted_color = color.contrasted() # Equivalent to RGBA(204, 229, 102, 255) + [/gdscript] + [csharp] + var color = new Color(0.3f, 0.4f, 0.9f); + Color contrastedColor = color.Contrasted(); // Equivalent to RGBA(204, 229, 102, 255) + [/csharp] + [/codeblocks] </description> </method> <method name="darkened"> @@ -120,10 +180,16 @@ </argument> <description> Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1). - [codeblock] + [codeblocks] + [gdscript] var green = Color(0.0, 1.0, 0.0) var darkgreen = green.darkened(0.2) # 20% darker than regular green - [/codeblock] + [/gdscript] + [csharp] + var green = new Color(0.0f, 1.0f, 0.0f); + Color darkgreen = green.Darkened(0.2f); // 20% darker than regular green + [/csharp] + [/codeblocks] </description> </method> <method name="from_hsv"> @@ -139,9 +205,14 @@ </argument> <description> Constructs a color from an HSV profile. [code]h[/code], [code]s[/code], and [code]v[/code] are values between 0 and 1. - [codeblock] - var c = 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) - [/codeblock] + [codeblocks] + [gdscript] + var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) + [/gdscript] + [csharp] + Color color = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); // Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) + [/csharp] + [/codeblocks] </description> </method> <method name="inverted"> @@ -149,10 +220,16 @@ </return> <description> Returns the inverted color [code](1 - r, 1 - g, 1 - b, a)[/code]. - [codeblock] - var c = Color(0.3, 0.4, 0.9) - var inverted_color = c.inverted() # A color of an RGBA(178, 153, 26, 255) - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(0.3, 0.4, 0.9) + var inverted_color = color.inverted() # A color of an RGBA(178, 153, 26, 255) + [/gdscript] + [csharp] + var color = new Color(0.3f, 0.4f, 0.9f); + Color invertedColor = color.Inverted(); // A color of an RGBA(178, 153, 26, 255) + [/csharp] + [/codeblocks] </description> </method> <method name="is_equal_approx"> @@ -173,11 +250,18 @@ </argument> <description> Returns the linear interpolation with another color. The interpolation factor [code]t[/code] is between 0 and 1. - [codeblock] + [codeblocks] + [gdscript] var c1 = Color(1.0, 0.0, 0.0) var c2 = Color(0.0, 1.0, 0.0) - var li_c = c1.lerp(c2, 0.5) # A color of an RGBA(128, 128, 0, 255) - [/codeblock] + var lerp_color = c1.lerp(c2, 0.5) # A color of an RGBA(128, 128, 0, 255) + [/gdscript] + [csharp] + var c1 = new Color(1.0f, 0.0f, 0.0f); + var c2 = new Color(0.0f, 1.0f, 0.0f); + Color lerpColor = c1.Lerp(c2, 0.5f); // A color of an RGBA(128, 128, 0, 255) + [/csharp] + [/codeblocks] </description> </method> <method name="lightened"> @@ -187,10 +271,16 @@ </argument> <description> Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1). - [codeblock] + [codeblocks] + [gdscript] var green = Color(0.0, 1.0, 0.0) var lightgreen = green.lightened(0.2) # 20% lighter than regular green - [/codeblock] + [/gdscript] + [csharp] + var green = new Color(0.0f, 1.0f, 0.0f); + Color lightgreen = green.Lightened(0.2f); // 20% lighter than regular green + [/csharp] + [/codeblocks] </description> </method> <method name="to_abgr32"> @@ -198,10 +288,16 @@ </return> <description> Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_abgr32()) # Prints 4281565439 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_abgr32()) # Prints 4281565439 + [/gdscript] + [csharp] + var color = new Color(1.0f, 0.5f, 0.2f); + GD.Print(color.ToAbgr32()); // Prints 4281565439 + [/csharp] + [/codeblocks] </description> </method> <method name="to_abgr64"> @@ -209,10 +305,16 @@ </return> <description> Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_abgr64()) # Prints -225178692812801 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_abgr64()) # Prints -225178692812801 + [/gdscript] + [csharp] + var color = new Color(1.0f, 0.5f, 0.2f); + GD.Print(color.ToAbgr64()); // Prints -225178692812801 + [/csharp] + [/codeblocks] </description> </method> <method name="to_argb32"> @@ -220,10 +322,16 @@ </return> <description> Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_argb32()) # Prints 4294934323 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_argb32()) # Prints 4294934323 + [/gdscript] + [csharp] + var color = new Color(1.0f, 0.5f, 0.2f); + GD.Print(color.ToArgb32()); // Prints 4294934323 + [/csharp] + [/codeblocks] </description> </method> <method name="to_argb64"> @@ -231,10 +339,16 @@ </return> <description> Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_argb64()) # Prints -2147470541 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_argb64()) # Prints -2147470541 + [/gdscript] + [csharp] + var color = new Color(1.0f, 0.5f, 0.2f); + GD.Print(color.ToArgb64()); // Prints -2147470541 + [/csharp] + [/codeblocks] </description> </method> <method name="to_html"> @@ -243,13 +357,20 @@ <argument index="0" name="with_alpha" type="bool" default="true"> </argument> <description> - Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]). - Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string. - [codeblock] - var c = Color(1, 1, 1, 0.5) - var s1 = c.to_html() # Returns "7fffffff" - var s2 = c.to_html(false) # Returns "ffffff" - [/codeblock] + Returns the color's HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]). + Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string (and uses RGB instead of RGBA format). + [codeblocks] + [gdscript] + var color = Color(1, 1, 1, 0.5) + var with_alpha = color.to_html() # Returns "ffffff7f" + var without_alpha = color.to_html(false) # Returns "ffffff" + [/gdscript] + [csharp] + var color = new Color(1, 1, 1, 0.5f); + String withAlpha = color.ToHtml(); // Returns "ffffff7f" + String withoutAlpha = color.ToHtml(false); // Returns "ffffff" + [/csharp] + [/codeblocks] </description> </method> <method name="to_rgba32"> @@ -257,10 +378,16 @@ </return> <description> Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is Godot's default format. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_rgba32()) # Prints 4286526463 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_rgba32()) # Prints 4286526463 + [/gdscript] + [csharp] + var color = new Color(1, 0.5f, 0.2f); + GD.Print(color.ToRgba32()); // Prints 4286526463 + [/csharp] + [/codeblocks] </description> </method> <method name="to_rgba64"> @@ -268,10 +395,16 @@ </return> <description> Returns the color's 64-bit integer in RGBA format (each word represents a component of the RGBA profile). RGBA is Godot's default format. - [codeblock] - var c = Color(1, 0.5, 0.2) - print(c.to_rgba64()) # Prints -140736629309441 - [/codeblock] + [codeblocks] + [gdscript] + var color = Color(1, 0.5, 0.2) + print(color.to_rgba64()) # Prints -140736629309441 + [/gdscript] + [csharp] + var color = new Color(1, 0.5f, 0.2f); + GD.Print(color.ToRgba64()); // Prints -140736629309441 + [/csharp] + [/codeblocks] </description> </method> </methods> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 67f64c8a66..36f7880060 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -5,6 +5,7 @@ </brief_description> <description> Encapsulates a [ColorPicker] making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker] visibility. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 92f42b6dd3..9bfcf5071d 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -13,9 +13,14 @@ <members> <member name="color" type="Color" setter="set_frame_color" getter="get_frame_color" default="Color( 1, 1, 1, 1 )"> The fill color. - [codeblock] + [codeblocks] + [gdscript] $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red. - [/codeblock] + [/gdscript] + [csharp] + GetNode<ColorRect>("ColorRect").Color = new Color(1, 0, 0, 1); // Set ColorRect's color to red. + [/csharp] + [/codeblocks] </member> </members> <constants> diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index 522d484131..da17d993e3 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -13,7 +13,8 @@ [/codeblock] The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. The following example shows how to parse an INI-style file from the system, read its contents and store new values in it: - [codeblock] + [codeblocks] + [gdscript] var config = ConfigFile.new() var err = config.load("user://settings.cfg") if err == OK: # If not, something went wrong with the file loading @@ -24,7 +25,24 @@ config.set_value("audio", "mute", false) # Save the changes by overwriting the previous file config.save("user://settings.cfg") - [/codeblock] + [/gdscript] + [csharp] + var config = new ConfigFile(); + Error err = config.Load("user://settings.cfg"); + if (err == Error.Ok) // If not, something went wrong with the file loading + { + // Look for the display/width pair, and default to 1024 if missing + int screenWidth = (int)config.GetValue("display", "width", 1024); + // Store a variable if and only if it hasn't been defined yet + if (!config.HasSectionKey("audio", "mute")) + { + config.SetValue("audio", "mute", false); + } + // Save the changes by overwriting the previous file + config.Save("user://settings.cfg"); + } + [/csharp] + [/codeblocks] Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. </description> diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 6d5871508b..a850afdd9f 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -6,9 +6,14 @@ <description> Dialog for confirmation of actions. This dialog inherits from [AcceptDialog], but has by default an OK and Cancel button (in host OS order). To get cancel action, you can use: - [codeblock] + [codeblocks] + [gdscript] get_cancel().connect("pressed", self, "cancelled") - [/codeblock]. + [/gdscript] + [csharp] + GetCancel().Connect("pressed", this, nameof(Cancelled)); + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 1f495bf91a..bb00ac33bf 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -13,10 +13,11 @@ Only one [Control] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the inspector. + [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> + <link title="GUI tutorial index">https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link> + <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <methods> <method name="_clips_input" qualifiers="virtual"> @@ -43,12 +44,27 @@ <description> Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event]. Example: clicking a control. - [codeblock] + [codeblocks] + [gdscript] func _gui_input(event): if event is InputEventMouseButton: if event.button_index == BUTTON_LEFT and event.pressed: print("I've been clicked D:") - [/codeblock] + [/gdscript] + [csharp] + public override void _GuiInput(InputEvent @event) + { + if (@event is InputEventMouseButton) + { + var mb = @event as InputEventMouseButton; + if (mb.ButtonIndex == (int)ButtonList.Left && mb.Pressed) + { + GD.Print("I've been clicked D:"); + } + } + } + [/csharp] + [/codeblocks] The event won't trigger if: * clicking outside the control (see [method has_point]); * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; @@ -67,19 +83,39 @@ The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead. [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value. Example of usage with custom-constructed node: - [codeblock] + [codeblocks] + [gdscript] func _make_custom_tooltip(for_text): var label = Label.new() label.text = for_text return label - [/codeblock] + [/gdscript] + [csharp] + public override Godot.Object _MakeCustomTooltip(String forText) + { + var label = new Label(); + label.Text = forText; + return label; + } + [/csharp] + [/codeblocks] Example of usage with custom scene instance: - [codeblock] + [codeblocks] + [gdscript] func _make_custom_tooltip(for_text): var tooltip = preload("SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip - [/codeblock] + [/gdscript] + [csharp] + public override Godot.Object _MakeCustomTooltip(String forText) + { + Node tooltip = ResourceLoader.Load<PackedScene>("SomeTooltipScene.tscn").Instance(); + tooltip.GetNode<Label>("Label").Text = forText; + return tooltip; + } + [/csharp] + [/codeblocks] </description> </method> <method name="accept_event"> @@ -97,7 +133,25 @@ <argument index="1" name="color" type="Color"> </argument> <description> - Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. If the [code]color[/code] is empty or invalid, the override is cleared and the color from assigned [Theme] is used. + Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. + [b]Note:[/b] Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color. + [b]Example of overriding a label's color and resetting it later:[/b] + [codeblocks] + [gdscript] + # Override the child node "MyLabel"'s font color to orange. + $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0)) + # Reset the color by creating a new node to get the default value: + var default_label_color = Label.new().get_theme_color("font_color") + $MyLabel.add_theme_color_override("font_color", default_label_color) + [/gdscript] + [csharp] + // Override the child node "MyLabel"'s font color to orange. + GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0)); + // Reset the color by creating a new node to get the default value: + var defaultLabelColor = new Label().GetThemeColor("font_color"); + GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", defaultLabelColor); + [/csharp] + [/codeblocks] </description> </method> <method name="add_theme_constant_override"> @@ -108,7 +162,7 @@ <argument index="1" name="constant" type="int"> </argument> <description> - Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is empty or invalid, the override is cleared and the constant from assigned [Theme] is used. + Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is [code]0[/code], the override is cleared and the constant from assigned [Theme] is used. </description> </method> <method name="add_theme_font_override"> @@ -119,7 +173,7 @@ <argument index="1" name="font" type="Font"> </argument> <description> - Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is empty or invalid, the override is cleared and the font from assigned [Theme] is used. + Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used. </description> </method> <method name="add_theme_icon_override"> @@ -130,7 +184,7 @@ <argument index="1" name="texture" type="Texture2D"> </argument> <description> - Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is empty or invalid, the override is cleared and the icon from assigned [Theme] is used. + Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used. </description> </method> <method name="add_theme_shader_override"> @@ -141,7 +195,7 @@ <argument index="1" name="shader" type="Shader"> </argument> <description> - Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is empty or invalid, the override is cleared and the shader from assigned [Theme] is used. + Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is [code]null[/code] or invalid, the override is cleared and the shader from assigned [Theme] is used. </description> </method> <method name="add_theme_stylebox_override"> @@ -153,6 +207,31 @@ </argument> <description> Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used. + [b]Example of modifying a property in a StyleBox by duplicating it:[/b] + [codeblocks] + [gdscript] + # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. + # Resources are shared across instances, so we need to duplicate it + # to avoid modifying the appearance of all other buttons. + var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate() + new_stylebox_normal.border_width_top = 3 + new_stylebox_normal.border_color = Color(0, 1, 0.5) + $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal) + # Remove the stylebox override: + $MyButton.add_theme_stylebox_override("normal", null) + [/gdscript] + [csharp] + // The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. + // Resources are shared across instances, so we need to duplicate it + // to avoid modifying the appearance of all other buttons. + StyleBoxFlat newStyleboxNormal = GetNode<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat; + newStyleboxNormal.BorderWidthTop = 3; + newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f); + GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal); + // Remove the stylebox override: + GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", null); + [/csharp] + [/codeblocks] </description> </method> <method name="can_drop_data" qualifiers="virtual"> @@ -165,12 +244,22 @@ <description> Godot calls this method to test if [code]data[/code] from a control's [method get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. This method should only be used to test the data. Process the data in [method drop_data]. - [codeblock] + [codeblocks] + [gdscript] func can_drop_data(position, data): # Check position if it is relevant to you # Otherwise, just check data return typeof(data) == TYPE_DICTIONARY and data.has("expected") - [/codeblock] + [/gdscript] + [csharp] + public override bool CanDropData(Vector2 position, object data) + { + // Check position if it is relevant to you + // Otherwise, just check data + return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("expected"); + } + [/csharp] + [/codeblocks] </description> </method> <method name="drop_data" qualifiers="virtual"> @@ -182,13 +271,24 @@ </argument> <description> Godot calls this method to pass you the [code]data[/code] from a control's [method get_drag_data] result. Godot first calls [method can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. - [codeblock] + [codeblocks] + [gdscript] func can_drop_data(position, data): return typeof(data) == TYPE_DICTIONARY and data.has("color") - func drop_data(position, data): - color = data["color"] - [/codeblock] + var color = data["color"] + [/gdscript] + [csharp] + public override bool CanDropData(Vector2 position, object data) + { + return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("color"); + } + public override void DropData(Vector2 position, object data) + { + Color color = (Color)(data as Godot.Collections.Dictionary)["color"]; + } + [/csharp] + [/codeblocks] </description> </method> <method name="force_drag"> @@ -243,12 +343,22 @@ <description> Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method can_drop_data] and [method drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. - [codeblock] + [codeblocks] + [gdscript] func get_drag_data(position): - var mydata = make_data() - set_drag_preview(make_preview(mydata)) + var mydata = make_data() # This is your custom method generating the drag data. + set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data. return mydata - [/codeblock] + [/gdscript] + [csharp] + public override object GetDragData(Vector2 position) + { + object mydata = MakeData(); // This is your custom method generating the drag data. + SetDragPreview(MakePreview(mydata)); // This is your custom method generating the preview of the drag data. + return mydata; + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_end" qualifiers="const"> @@ -334,10 +444,18 @@ </argument> <description> Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. - [codeblock] + [codeblocks] + [gdscript] func _ready(): modulate = get_theme_color("font_color", "Button") #get the color defined for button fonts - [/codeblock] + [/gdscript] + [csharp] + public override void _Ready() + { + Modulate = GetThemeColor("font_color", "Button"); //get the color defined for button fonts + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_theme_constant" qualifiers="const"> @@ -398,10 +516,18 @@ </return> <description> Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus. - [codeblock] + [codeblocks] + [gdscript] func _process(delta): grab_click_focus() #when clicking another Control node, this node will be clicked instead - [/codeblock] + [/gdscript] + [csharp] + public override void _Process(float delta) + { + GrabClickFocus(); //when clicking another Control node, this node will be clicked instead + } + [/csharp] + [/codeblocks] </description> </method> <method name="grab_focus"> @@ -628,24 +754,61 @@ Forwarding can be implemented in the target control similar to the methods [method get_drag_data], [method can_drop_data], and [method drop_data] but with two differences: 1. The function name must be suffixed with [b]_fw[/b] 2. The function must take an extra argument that is the control doing the forwarding - [codeblock] + [codeblocks] + [gdscript] # ThisControl.gd extends Control + export(Control) var target_control + func _ready(): set_drag_forwarding(target_control) # TargetControl.gd extends Control + func can_drop_data_fw(position, data, from_control): return true func drop_data_fw(position, data, from_control): - my_handle_data(data) + my_handle_data(data) # Your handler method. func get_drag_data_fw(position, from_control): set_drag_preview(my_preview) return my_data() - [/codeblock] + [/gdscript] + [csharp] + // ThisControl.cs + public class ThisControl : Control + { + [Export] + public Control TargetControl { get; set; } + public override void _Ready() + { + SetDragForwarding(TargetControl); + } + } + + // TargetControl.cs + public class TargetControl : Control + { + public void CanDropDataFw(Vector2 position, object data, Control fromControl) + { + return true; + } + + public void DropDataFw(Vector2 position, object data, Control fromControl) + { + MyHandleData(data); // Your handler method. + } + + public void GetDragDataFw(Vector2 position, Control fromControl) + { + SetDragPreview(MyPreview); + return MyData(); + } + } + [/csharp] + [/codeblocks] </description> </method> <method name="set_drag_preview"> @@ -655,7 +818,8 @@ </argument> <description> Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. - [codeblock] + [codeblocks] + [gdscript] export (Color, RGBA) var color = Color(1, 0, 0, 1) func get_drag_data(position): @@ -665,7 +829,22 @@ cpb.rect_size = Vector2(50, 50) set_drag_preview(cpb) return color - [/codeblock] + [/gdscript] + [csharp] + [Export] + public Color Color = new Color(1, 0, 0, 1); + + public override object GetDragData(Vector2 position) + { + // Use a control that is not in the tree + var cpb = new ColorPickerButton(); + cpb.Color = Color; + cpb.RectSize = new Vector2(50, 50); + SetDragPreview(cpb); + return Color; + } + [/csharp] + [/codeblocks] </description> </method> <method name="set_end"> diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index 4edb3eda0a..b3bbbae94f 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -6,13 +6,12 @@ <description> The Crypto class allows you to access some more advanced cryptographic functionalities in Godot. For now, this includes generating cryptographically secure random bytes, RSA keys and self-signed X509 certificates generation, asymmetric key encryption/decryption, and signing/verification. - [codeblock] + [codeblocks] + [gdscript] extends Node - var crypto = Crypto.new() var key = CryptoKey.new() var cert = X509Certificate.new() - func _ready(): # Generate new RSA key. key = crypto.generate_rsa(4096) @@ -33,7 +32,42 @@ # Checks assert(verified) assert(data.to_utf8() == decrypted) - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + using System.Diagnostics; + + public class CryptoNode : Node + { + public Crypto Crypto = new Crypto(); + public CryptoKey Key = new CryptoKey(); + public X509Certificate Cert = new X509Certificate(); + public override void _Ready() + { + // Generate new RSA key. + Key = Crypto.GenerateRsa(4096); + // Generate new self-signed certificate with the given key. + Cert = Crypto.GenerateSelfSignedCertificate(Key, "CN=mydomain.com,O=My Game Company,C=IT"); + // Save key and certificate in the user folder. + Key.Save("user://generated.key"); + Cert.Save("user://generated.crt"); + // Encryption + string data = "Some data"; + byte[] encrypted = Crypto.Encrypt(Key, data.ToUTF8()); + // Decryption + byte[] decrypted = Crypto.Decrypt(Key, encrypted); + // Signing + byte[] signature = Crypto.Sign(HashingContext.HashType.Sha256, Data.SHA256Buffer(), Key); + // Verifying + bool verified = Crypto.Verify(HashingContext.HashType.Sha256, Data.SHA256Buffer(), signature, Key); + // Checks + Debug.Assert(verified); + Debug.Assert(data.ToUTF8() == decrypted); + } + } + [/csharp] + [/codeblocks] [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> @@ -95,13 +129,22 @@ <description> Generates a self-signed [X509Certificate] from the given [CryptoKey] and [code]issuer_name[/code]. The certificate validity will be defined by [code]not_before[/code] and [code]not_after[/code] (first valid date and last valid date). The [code]issuer_name[/code] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in). A small example to generate an RSA key and a X509 self-signed certificate. - [codeblock] + [codeblocks] + [gdscript] var crypto = Crypto.new() # Generate 4096 bits RSA key. var key = crypto.generate_rsa(4096) # Generate self-signed certificate using the given key. var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT") - [/codeblock] + [/gdscript] + [csharp] + var crypto = new Crypto(); + // Generate 4096 bits RSA key. + CryptoKey key = crypto.GenerateRsa(4096); + // Generate self-signed certificate using the given key. + X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game Company,C=IT"); + [/csharp] + [/codeblocks] </description> </method> <method name="sign"> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 5413fa33c6..7123deb206 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -73,7 +73,7 @@ [/codeblock] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link> + <link title="GDScript basics: Dictionary">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link> </tutorials> <methods> <method name="clear"> diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index fc7ce94a2b..afd85a9cb7 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -7,7 +7,7 @@ A directional light is a type of [Light3D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight3D transform (origin) is ignored. Only the basis is used to determine light direction. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> + <link title="Lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index a86dbfedde..bcdadcd970 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -24,7 +24,7 @@ [/codeblock] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> + <link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> </tutorials> <methods> <method name="change_dir"> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 814c232668..28194587ab 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -901,6 +901,30 @@ <description> </description> </method> + <method name="window_set_mouse_passthrough"> + <return type="void"> + </return> + <argument index="0" name="region" type="PackedVector2Array"> + </argument> + <argument index="1" name="window_id" type="int" default="0"> + </argument> + <description> + Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. + Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). + [codeblock] + # Set region, using Path2D node. + DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points()) + + # Set region, using Polygon2D node. + DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon) + + # Reset region to default. + DisplayServer.window_set_mouse_passthrough([]) + [/codeblock] + [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> <method name="window_set_position"> <return type="void"> </return> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index 5d8ae29175..b0635892be 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -4,7 +4,7 @@ DynamicFont renders vector font files at runtime. </brief_description> <description> - DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallbacks fonts, which will be used when displaying a character not supported by the main font. + DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font. DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization. [codeblock] var dynamic_font = DynamicFont.new() diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml new file mode 100644 index 0000000000..b97933e582 --- /dev/null +++ b/doc/classes/EditorDebuggerPlugin.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EditorDebuggerPlugin" inherits="Control" version="4.0"> + <brief_description> + A base class to implement debugger plugins. + </brief_description> + <description> + All debugger plugin scripts must extend [EditorDebuggerPlugin]. It provides functions related to editor side of debugger. + You don't need to instantiate this class. That is handled by the debugger itself. [Control] nodes can be added as child nodes to provide a GUI front-end for the plugin. + Do not queue_free/reparent it's instance otherwise the instance becomes unusable. + </description> + <tutorials> + </tutorials> + <methods> + <method name="has_capture"> + <return type="bool"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Returns [code]true[/code] if a message capture with given name is present otherwise [code]false[/code]. + </description> + </method> + <method name="is_breaked"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the game is in break state otherwise [code]false[/code]. + </description> + </method> + <method name="is_debuggable"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the game can be debugged otherwise [code]false[/code]. + </description> + </method> + <method name="is_session_active"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if there is an instance of the game running with the attached debugger otherwise [code]false[/code]. + </description> + </method> + <method name="register_message_capture"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <argument index="1" name="callable" type="Callable"> + </argument> + <description> + Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable. + Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code]. + </description> + </method> + <method name="send_message"> + <return type="void"> + </return> + <argument index="0" name="message" type="String"> + </argument> + <argument index="1" name="data" type="Array"> + </argument> + <description> + Sends a message with given [code]message[/code] and [code]data[/code] array. + </description> + </method> + <method name="unregister_message_capture"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Unregisters the message capture with given name. + </description> + </method> + </methods> + <signals> + <signal name="breaked"> + <argument index="0" name="can_debug" type="bool"> + </argument> + <description> + Emitted when the game enters a break state. + </description> + </signal> + <signal name="continued"> + <description> + Emitted when the game exists a break state. + </description> + </signal> + <signal name="started"> + <description> + Emitted when the debugging starts. + </description> + </signal> + <signal name="stopped"> + <description> + Emitted when the debugging stops. + </description> + </signal> + </signals> + <constants> + </constants> +</class> diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index 6bcaabc39e..9ef2bd21cc 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -70,24 +70,24 @@ <description> </description> </method> - <method name="add_ios_framework"> + <method name="add_ios_embedded_framework"> <return type="void"> </return> <argument index="0" name="path" type="String"> </argument> <description> - Adds a static library (*.a) or dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project. + Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. + [b]Note:[/b] For static libraries (*.a) works in same way as [code]add_ios_framework[/code]. + This method should not be used for System libraries as they are already present on the device. </description> </method> - <method name="add_ios_embedded_framework"> + <method name="add_ios_framework"> <return type="void"> </return> <argument index="0" name="path" type="String"> </argument> <description> - Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. - [b]Note:[/b] For static libraries (*.a) works in same way as [code]add_ios_framework[/code]. - This method should not be used for System libraries as they are already present on the device. + Adds a static library (*.a) or dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project. </description> </method> <method name="add_ios_linker_flags"> diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml index eb03d3010f..e05a685dd7 100644 --- a/doc/classes/EditorFeatureProfile.xml +++ b/doc/classes/EditorFeatureProfile.xml @@ -135,15 +135,15 @@ <constant name="FEATURE_SCENE_TREE" value="3" enum="Feature"> Scene tree editing. If this feature is disabled, the Scene tree dock will still be visible but will be read-only. </constant> - <constant name="FEATURE_IMPORT_DOCK" value="4" enum="Feature"> - The Import dock. If this feature is disabled, the Import dock won't be visible. - </constant> - <constant name="FEATURE_NODE_DOCK" value="5" enum="Feature"> + <constant name="FEATURE_NODE_DOCK" value="4" enum="Feature"> The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor. </constant> - <constant name="FEATURE_FILESYSTEM_DOCK" value="6" enum="Feature"> + <constant name="FEATURE_FILESYSTEM_DOCK" value="5" enum="Feature"> The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible. </constant> + <constant name="FEATURE_IMPORT_DOCK" value="6" enum="Feature"> + The Import dock. If this feature is disabled, the Import dock won't be visible. + </constant> <constant name="FEATURE_MAX" value="7" enum="Feature"> Represents the size of the [enum Feature] enum. </constant> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index ea2dfae9a5..2a7f27ef55 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -5,7 +5,7 @@ </brief_description> <description> EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin]. - EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].import[/code] directory. + EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory. Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec": [codeblock] tool @@ -49,7 +49,7 @@ [/codeblock] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> + <link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> </tutorials> <methods> <method name="get_import_options" qualifiers="virtual"> @@ -136,7 +136,7 @@ <return type="String"> </return> <description> - Gets the extension used to save this resource in the [code].import[/code] directory. + Gets the extension used to save this resource in the [code].godot/imported[/code] directory. </description> </method> <method name="get_visible_name" qualifiers="virtual"> diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index b81281b5b6..8865939eb1 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -7,7 +7,7 @@ EditorNode3DGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link> + <link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link> </tutorials> <methods> <method name="add_material"> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 99fe9b4bb5..6a64a7aa55 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -7,7 +7,7 @@ Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also [EditorScript] to add functions to the editor. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link> + <link title="Editor plugins tutorial index">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link> </tutorials> <methods> <method name="add_autoload_singleton"> @@ -76,6 +76,15 @@ During run-time, this will be a simple object with a script so this function does not need to be called then. </description> </method> + <method name="add_debugger_plugin"> + <return type="void"> + </return> + <argument index="0" name="script" type="Script"> + </argument> + <description> + Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. + </description> + </method> <method name="add_export_plugin"> <return type="void"> </return> @@ -424,6 +433,15 @@ Removes a custom type added by [method add_custom_type]. </description> </method> + <method name="remove_debugger_plugin"> + <return type="void"> + </return> + <argument index="0" name="script" type="Script"> + </argument> + <description> + Removes the debugger plugin with given script fromm the Debugger. + </description> + </method> <method name="remove_export_plugin"> <return type="void"> </return> diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index 56fc0e3d1a..cb1f5d2e77 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -26,7 +26,7 @@ [/codeblock] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link> + <link title="Importing 3D scenes: Custom script">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link> </tutorials> <methods> <method name="get_source_file" qualifiers="const"> diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index d40fc558de..f5204e7bab 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -5,30 +5,41 @@ </brief_description> <description> Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method parse_file] method in script. + Add the extracted strings to argument [code]msgids[/code] or [code]msgids_context_plural[/code] if context or plural is used. + When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples. The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu. - Below shows an example of a custom parser that extracts strings in a CSV file to write into a POT. + Below shows an example of a custom parser that extracts strings from a CSV file to write into a POT. [codeblock] tool extends EditorTranslationParserPlugin - func parse_file(path, extracted_strings): + func parse_file(path, msgids, msgids_context_plural): var file = File.new() file.open(path, File.READ) var text = file.get_as_text() var split_strs = text.split(",", false, 0) for s in split_strs: - extracted_strings.append(s) + msgids.append(s) #print("Extracted string: " + s) func get_recognized_extensions(): return ["csv"] [/codeblock] + To add a translatable string associated with context or plural, add it to [code]msgids_context_plural[/code]: + [codeblock] + # This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". + msgids_context_plural.append(["Test 1", "context", "test 1 plurals"]) + # This will add a message with msgid "A test without context" and msgid_plural "plurals". + msgids_context_plural.append(["A test without context", "", "plurals"]) + # This will add a message with msgid "Only with context" and msgctxt "a friendly context". + msgids_context_plural.append(["Only with context", "a friendly context", ""]) + [/codeblock] [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [File] type. For example: [codeblock] - func parse_file(path, extracted_strings): + func parse_file(path, msgids, msgids_context_plural): var res = ResourceLoader.load(path, "Script") var text = res.get_source_code() # Parsing logic. @@ -53,7 +64,9 @@ </return> <argument index="0" name="path" type="String"> </argument> - <argument index="1" name="extracted_strings" type="Array"> + <argument index="1" name="msgids" type="Array"> + </argument> + <argument index="2" name="msgids_context_plural" type="Array"> </argument> <description> Override this method to define a custom parsing logic to extract the translatable strings. diff --git a/doc/classes/EngineDebugger.xml b/doc/classes/EngineDebugger.xml new file mode 100644 index 0000000000..7db36b89d0 --- /dev/null +++ b/doc/classes/EngineDebugger.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EngineDebugger" inherits="Object" version="4.0"> + <brief_description> + Exposes the internal debugger. + </brief_description> + <description> + [EngineDebugger] handles the communication between the editor and the running game. It is active in the running game. Messages can be sent/received through it. It also manages the profilers. + </description> + <tutorials> + </tutorials> + <methods> + <method name="has_capture"> + <return type="bool"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Returns [code]true[/code] if a capture with the given name is present otherwise [code]false[/code]. + </description> + </method> + <method name="has_profiler"> + <return type="bool"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Returns [code]true[/code] if a profiler with the given name is present otherwise [code]false[/code]. + </description> + </method> + <method name="is_active"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the debugger is active otherwise [code]false[/code]. + </description> + </method> + <method name="is_profiling"> + <return type="bool"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Returns [code]true[/code] if a profiler with the given name is present and active otherwise [code]false[/code]. + </description> + </method> + <method name="profiler_add_frame_data"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <argument index="1" name="data" type="Array"> + </argument> + <description> + Calls the [code]add[/code] callable of the profiler with given [code]name[/code] and [code]data[/code]. + </description> + </method> + <method name="profiler_enable"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <argument index="2" name="arguments" type="Array" default="[ ]"> + </argument> + <description> + Calls the [code]toggle[/code] callable of the profiler with given [code]name[/code] and [code]arguments[/code]. Enables/Disables the same profiler depending on [code]enable[/code] argument. + </description> + </method> + <method name="register_message_capture"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <argument index="1" name="callable" type="Callable"> + </argument> + <description> + Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable. + Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code]. + </description> + </method> + <method name="register_profiler"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <argument index="1" name="toggle" type="Callable"> + </argument> + <argument index="2" name="add" type="Callable"> + </argument> + <argument index="3" name="tick" type="Callable"> + </argument> + <description> + Registers a profiler with the given [code]name[/code]. + [code]toggle[/code] callable is called when the profiler is enabled/disabled. It must take an argument array as an argument. + [code]add[/code] callable is called when data is added to profiler using [method EngineDebugger.profiler_add_frame_data]. It must take a data array as argument. + [code]tick[/code] callable is called at every active profiler iteration. It must take frame time, idle time, physics time, and physics idle time as arguments. + </description> + </method> + <method name="send_message"> + <return type="void"> + </return> + <argument index="0" name="message" type="String"> + </argument> + <argument index="1" name="data" type="Array"> + </argument> + <description> + Sends a message with given [code]message[/code] and [code]data[/code] array. + </description> + </method> + <method name="unregister_message_capture"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Unregisters the message capture with given [code]name[/code]. + </description> + </method> + <method name="unregister_profiler"> + <return type="void"> + </return> + <argument index="0" name="name" type="StringName"> + </argument> + <description> + Unregisters a profiler with given [code]name[/code]. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index bbab0bf8cf..caee6a0c07 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -11,8 +11,8 @@ - Adjustments </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link> + <link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> + <link title="Light transport in game engines">https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link> </tutorials> <methods> <method name="is_glow_level_enabled" qualifiers="const"> @@ -95,47 +95,20 @@ <member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0"> The background mode. See [enum BGMode] for possible values. </member> - <member name="fog_color" type="Color" setter="set_fog_color" getter="get_fog_color" default="Color( 0.5, 0.6, 0.7, 1 )"> - The fog's [Color]. - </member> - <member name="fog_depth_begin" type="float" setter="set_fog_depth_begin" getter="get_fog_depth_begin" default="10.0"> - The fog's depth starting distance from the camera. - </member> - <member name="fog_depth_curve" type="float" setter="set_fog_depth_curve" getter="get_fog_depth_curve" default="1.0"> - The fog depth's intensity curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve. - </member> - <member name="fog_depth_enabled" type="bool" setter="set_fog_depth_enabled" getter="is_fog_depth_enabled" default="true"> - If [code]true[/code], the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera). - </member> - <member name="fog_depth_end" type="float" setter="set_fog_depth_end" getter="get_fog_depth_end" default="100.0"> - The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's [member Camera3D.far] value. + <member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.001"> </member> <member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" default="false"> - If [code]true[/code], fog effects are enabled. [member fog_height_enabled] and/or [member fog_depth_enabled] must be set to [code]true[/code] to actually display fog. - </member> - <member name="fog_height_curve" type="float" setter="set_fog_height_curve" getter="get_fog_height_curve" default="1.0"> - The height fog's intensity. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve. + If [code]true[/code], fog effects are enabled. </member> - <member name="fog_height_enabled" type="bool" setter="set_fog_height_enabled" getter="is_fog_height_enabled" default="false"> - If [code]true[/code], the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader. + <member name="fog_height" type="float" setter="set_fog_height" getter="get_fog_height" default="0.0"> </member> - <member name="fog_height_max" type="float" setter="set_fog_height_max" getter="get_fog_height_max" default="0.0"> - The Y coordinate where the height fog will be the most intense. If this value is greater than [member fog_height_min], fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom. + <member name="fog_height_density" type="float" setter="set_fog_height_density" getter="get_fog_height_density" default="0.0"> </member> - <member name="fog_height_min" type="float" setter="set_fog_height_min" getter="get_fog_height_min" default="10.0"> - The Y coordinate where the height fog will be the least intense. If this value is greater than [member fog_height_max], fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top. + <member name="fog_light_color" type="Color" setter="set_fog_light_color" getter="get_fog_light_color" default="Color( 0.5, 0.6, 0.7, 1 )"> </member> - <member name="fog_sun_amount" type="float" setter="set_fog_sun_amount" getter="get_fog_sun_amount" default="0.0"> - The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight3D node in the scene. + <member name="fog_light_energy" type="float" setter="set_fog_light_energy" getter="get_fog_light_energy" default="1.0"> </member> - <member name="fog_sun_color" type="Color" setter="set_fog_sun_color" getter="get_fog_sun_color" default="Color( 1, 0.9, 0.7, 1 )"> - The depth fog's [Color] when looking towards the sun. - </member> - <member name="fog_transmit_curve" type="float" setter="set_fog_transmit_curve" getter="get_fog_transmit_curve" default="1.0"> - The intensity of the fog light transmittance effect. Amount of light that the fog transmits. - </member> - <member name="fog_transmit_enabled" type="bool" setter="set_fog_transmit_enabled" getter="is_fog_transmit_enabled" default="false"> - Enables fog's light transmission effect. If [code]true[/code], light will be more visible in the fog to simulate light scattering as in real life. + <member name="fog_sun_scatter" type="float" setter="set_fog_sun_scatter" getter="get_fog_sun_scatter" default="0.0"> </member> <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment.GlowBlendMode" default="2"> The glow blending mode. @@ -265,6 +238,22 @@ <member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="1.0"> The white reference value for tonemapping. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR]. </member> + <member name="volumetric_fog_density" type="float" setter="set_volumetric_fog_density" getter="get_volumetric_fog_density" default="0.01"> + </member> + <member name="volumetric_fog_detail_spread" type="float" setter="set_volumetric_fog_detail_spread" getter="get_volumetric_fog_detail_spread" default="2.0"> + </member> + <member name="volumetric_fog_enabled" type="bool" setter="set_volumetric_fog_enabled" getter="is_volumetric_fog_enabled" default="false"> + </member> + <member name="volumetric_fog_gi_inject" type="float" setter="set_volumetric_fog_gi_inject" getter="get_volumetric_fog_gi_inject" default="0.0"> + </member> + <member name="volumetric_fog_length" type="float" setter="set_volumetric_fog_length" getter="get_volumetric_fog_length" default="64.0"> + </member> + <member name="volumetric_fog_light" type="Color" setter="set_volumetric_fog_light" getter="get_volumetric_fog_light" default="Color( 0, 0, 0, 1 )"> + </member> + <member name="volumetric_fog_light_energy" type="float" setter="set_volumetric_fog_light_energy" getter="get_volumetric_fog_light_energy" default="1.0"> + </member> + <member name="volumetric_fog_shadow_filter" type="int" setter="set_volumetric_fog_shadow_filter" getter="get_volumetric_fog_shadow_filter" enum="Environment.VolumetricFogShadowFilter" default="1"> + </member> </members> <constants> <constant name="BG_CLEAR_COLOR" value="0" enum="BGMode"> @@ -360,5 +349,13 @@ </constant> <constant name="SDFGI_Y_SCALE_50_PERCENT" value="2" enum="SDFGIYScale"> </constant> + <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_DISABLED" value="0" enum="VolumetricFogShadowFilter"> + </constant> + <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_LOW" value="1" enum="VolumetricFogShadowFilter"> + </constant> + <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_MEDIUM" value="2" enum="VolumetricFogShadowFilter"> + </constant> + <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_HIGH" value="3" enum="VolumetricFogShadowFilter"> + </constant> </constants> </class> diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index fcd1aa43c0..f2611dc850 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -5,7 +5,7 @@ </brief_description> <description> An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. - An example expression text using the built-in math functions could be [code]sqrt(pow(3,2) + pow(4,2))[/code]. + An example expression text using the built-in math functions could be [code]sqrt(pow(3, 2) + pow(4, 2))[/code]. In the following example we use a [LineEdit] node to write our expression and show the result. [codeblock] onready var expression = Expression.new() diff --git a/doc/classes/File.xml b/doc/classes/File.xml index d91203d91f..f1b9106d35 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -21,9 +21,10 @@ return content [/codeblock] In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation. + [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> + <link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> </tutorials> <methods> <method name="close"> @@ -48,7 +49,7 @@ </argument> <description> Returns [code]true[/code] if the file exists in the given path. - [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the [code]res://.import[/code] folder). To check for the existence of such resources while taking into account the remapping to their imported location, use [method ResourceLoader.exists]. Typically, using [code]File.file_exists[/code] on an imported resource would work while you are developing in the editor (the source asset is present in [code]res://[/code], but fail when exported). + [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. </description> </method> <method name="get_16" qualifiers="const"> @@ -451,16 +452,16 @@ </members> <constants> <constant name="READ" value="1" enum="ModeFlags"> - Opens the file for read operations. + Opens the file for read operations. The cursor is positioned at the beginning of the file. </constant> <constant name="WRITE" value="2" enum="ModeFlags"> - Opens the file for write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for write operations. The file is created if it does not exist, and truncated if it does. </constant> <constant name="READ_WRITE" value="3" enum="ModeFlags"> - Opens the file for read and write operations. Does not truncate the file. + Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. </constant> <constant name="WRITE_READ" value="7" enum="ModeFlags"> - Opens the file for read and write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. </constant> <constant name="COMPRESSION_FASTLZ" value="0" enum="CompressionMode"> Uses the [url=http://fastlz.org/]FastLZ[/url] compression method. diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index eaaccbd0dd..b4afee7610 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -57,6 +57,7 @@ <members> <member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access" default="0"> The file system access scope. See enum [code]Access[/code] constants. + [b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url]. </member> <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://""> The current working directory of the file dialog. diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index ce6a25e191..f49fbf0d2a 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -5,6 +5,8 @@ </brief_description> <description> Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. + [b]Note:[/b] If a DynamicFont doesn't contain a character used in a string, the character in question will be replaced with codepoint [code]0xfffd[/code] if it's available in the DynamicFont. If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string. + [b]Note:[/b] If a BitmapFont doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string. </description> <tutorials> </tutorials> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 8885f360a3..9199468ab3 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -8,7 +8,7 @@ Having [GIProbe]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/quality/gi_probes/quality]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link> + <link title="GI probes">https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link> </tutorials> <methods> <method name="bake"> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index ee67b5052c..244bdcf2f3 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -8,7 +8,7 @@ Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link> + <link title="Particle systems (2D)">https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link> </tutorials> <methods> <method name="capture_rect" qualifiers="const"> @@ -33,7 +33,7 @@ <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="GPUParticles2D.DrawOrder" default="0"> Particle draw order. Uses [enum DrawOrder] values. </member> - <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="false"> + <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true"> If [code]true[/code], particles are being emitted. </member> <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0"> diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index add8f28bf8..8444610f49 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -8,7 +8,7 @@ Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link> + <link title="Controlling thousands of fish with Particles">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link> </tutorials> <methods> <method name="capture_aabb" qualifiers="const"> @@ -18,6 +18,22 @@ Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. </description> </method> + <method name="emit_particle"> + <return type="void"> + </return> + <argument index="0" name="xform" type="Transform"> + </argument> + <argument index="1" name="velocity" type="Vector3"> + </argument> + <argument index="2" name="color" type="Color"> + </argument> + <argument index="3" name="custom" type="Color"> + </argument> + <argument index="4" name="flags" type="int"> + </argument> + <description> + </description> + </method> <method name="get_draw_pass_mesh" qualifiers="const"> <return type="Mesh"> </return> @@ -68,7 +84,7 @@ <member name="draw_passes" type="int" setter="set_draw_passes" getter="get_draw_passes" default="1"> The number of draw passes when rendering particles. </member> - <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="false"> + <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true"> If [code]true[/code], particles are being emitted. </member> <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0"> @@ -101,6 +117,8 @@ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> Speed scaling ratio. A value of [code]0[/code] can be used to pause the particles. </member> + <member name="sub_emitter" type="NodePath" setter="set_sub_emitter" getter="get_sub_emitter" default="NodePath("")"> + </member> <member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB( -4, -4, -4, 8, 8, 8 )"> The [AABB] that determines the area of the world part of which needs to be visible on screen for the particle system to be active. </member> @@ -115,6 +133,16 @@ <constant name="DRAW_ORDER_VIEW_DEPTH" value="2" enum="DrawOrder"> Particles are drawn in order of depth. </constant> + <constant name="EMIT_FLAG_POSITION" value="1" enum="EmitFlags"> + </constant> + <constant name="EMIT_FLAG_ROTATION_SCALE" value="2" enum="EmitFlags"> + </constant> + <constant name="EMIT_FLAG_VELOCITY" value="4" enum="EmitFlags"> + </constant> + <constant name="EMIT_FLAG_COLOR" value="8" enum="EmitFlags"> + </constant> + <constant name="EMIT_FLAG_CUSTOM" value="16" enum="EmitFlags"> + </constant> <constant name="MAX_DRAW_PASSES" value="4"> Maximum number of draw passes supported. </constant> diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index e13dc43104..6ee794c5c4 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GridContainer" inherits="Container" version="4.0"> <brief_description> - Grid container used to arrange elements in a grid like layout. + Grid container used to arrange Control-derived children in a grid like layout. </brief_description> <description> - Grid container will arrange its children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. + GridContainer will arrange its Control-derived children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically. + [b]Note:[/b] GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. </description> <tutorials> </tutorials> @@ -13,7 +14,7 @@ </methods> <members> <member name="columns" type="int" setter="set_columns" getter="get_columns" default="1"> - The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its children to accommodate the new layout. + The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its Control-derived children to accommodate the new layout. </member> </members> <constants> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 7e8f0807ac..9dc38b018a 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="HTTPClient" inherits="Reference" version="4.0"> <brief_description> - Hyper-text transfer protocol client. + Low-level hyper-text transfer protocol client. </brief_description> <description> - Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. See [HTTPRequest] for an higher-level alternative. + Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. [b]See the [HTTPRequest] node for an higher-level alternative.[/b] [b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started. A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> + <link title="HTTP client class">https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link> + <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <methods> <method name="close"> @@ -152,6 +152,7 @@ var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())] var result = http_client.request(http_client.METHOD_POST, "index.php", headers, query_string) [/codeblock] + [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example. </description> </method> <method name="request_raw"> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 61e0d2e2b9..8cc7ecfbe3 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -64,11 +64,16 @@ add_child(texture_rect) texture_rect.texture = texture [/codeblock] + + [b]Gzipped response bodies[/b] + HttpRequest will automatically handle decompression of response bodies. + A "Accept-Encoding" header will be automatically added to each of your requests, unless one is already specified. + Any response with a "Content-Encoding: gzip" header will automatically be decompressed and delivered to you as a uncompressed bytes. [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> + <link title="Making HTTP requests">https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link> + <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <methods> <method name="cancel_request"> @@ -116,12 +121,37 @@ <description> Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request]. Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. + [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example. + </description> + </method> + <method name="request_raw"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="url" type="String"> + </argument> + <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )"> + </argument> + <argument index="2" name="ssl_validate_domain" type="bool" default="true"> + </argument> + <argument index="3" name="method" type="int" enum="HTTPClient.Method" default="0"> + </argument> + <argument index="4" name="request_data_raw" type="PackedByteArray" default="PackedByteArray( )"> + </argument> + <description> + Creates request on the underlying [HTTPClient] using a raw array of bytes for the request body. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request]. + Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. </description> </method> </methods> <members> + <member name="accept_gzip" type="bool" setter="set_accept_gzip" getter="is_accepting_gzip" default="true"> + If [code]true[/code], this header will be added to each request: [code]Accept-Encoding: gzip, deflate[/code] telling servers that it's okay to compress response bodies. + Any Response body declaring a [code]Content-Encoding[/code] of either [code]gzip[/code] or [code]deflate[/code] will then be automatically decompressed, and the uncompressed bytes will be delivered via [code]request_completed[/code]. + If the user has specified their own [code]Accept-Encoding[/code] header, then no header will be added regaurdless of [code]accept_gzip[/code]. + If [code]false[/code] no header will be added, and no decompression will be performed on response bodies. The raw bytes of the response body will be returned via [code]request_completed[/code]. + </member> <member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" default="-1"> - Maximum allowed size for response bodies. + Maximum allowed size for response bodies. If the response body is compressed, this will be used as the maximum allowed size for the decompressed body. </member> <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="4096"> The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size]. @@ -178,19 +208,21 @@ <constant name="RESULT_BODY_SIZE_LIMIT_EXCEEDED" value="7" enum="Result"> Request exceeded its maximum size limit, see [member body_size_limit]. </constant> - <constant name="RESULT_REQUEST_FAILED" value="8" enum="Result"> + <constant name="RESULT_BODY_DECOMPRESS_FAILED" value="8" enum="Result"> + </constant> + <constant name="RESULT_REQUEST_FAILED" value="9" enum="Result"> Request failed (currently unused). </constant> - <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="9" enum="Result"> + <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="10" enum="Result"> HTTPRequest couldn't open the download file. </constant> - <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="10" enum="Result"> + <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="11" enum="Result"> HTTPRequest couldn't write to the download file. </constant> - <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="11" enum="Result"> + <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="12" enum="Result"> Request reached its maximum redirect limit, see [member max_redirects]. </constant> - <constant name="RESULT_TIMEOUT" value="12" enum="Result"> + <constant name="RESULT_TIMEOUT" value="13" enum="Result"> </constant> </constants> </class> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 5aa5de1dae..20be20db34 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -233,7 +233,7 @@ <return type="PackedByteArray"> </return> <description> - Returns the image's raw data. + Returns a copy of the image's raw data. </description> </method> <method name="get_format" qualifiers="const"> diff --git a/doc/classes/ImageTexture3D.xml b/doc/classes/ImageTexture3D.xml new file mode 100644 index 0000000000..d05082487d --- /dev/null +++ b/doc/classes/ImageTexture3D.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ImageTexture3D" inherits="Texture3D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="create"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="format" type="int" enum="Image.Format"> + </argument> + <argument index="1" name="width" type="int"> + </argument> + <argument index="2" name="height" type="int"> + </argument> + <argument index="3" name="depth" type="int"> + </argument> + <argument index="4" name="use_mipmaps" type="bool"> + </argument> + <argument index="5" name="data" type="Image[]"> + </argument> + <description> + </description> + </method> + <method name="update"> + <return type="void"> + </return> + <argument index="0" name="data" type="Image[]"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index fc3c3776ce..b05ab5b4d6 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -7,7 +7,7 @@ A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or with the [InputMap] class. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link> + <link title="Inputs tutorial index">https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link> </tutorials> <methods> <method name="action_press"> @@ -47,8 +47,9 @@ <return type="Vector3"> </return> <description> - If the device has an accelerometer, this will return the acceleration. Otherwise, it returns an empty [Vector3]. + Returns the acceleration of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. + [b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO]. </description> </method> <method name="get_action_strength" qualifiers="const"> @@ -78,14 +79,16 @@ <return type="Vector3"> </return> <description> - If the device has an accelerometer, this will return the gravity. Otherwise, it returns an empty [Vector3]. + Returns the gravity of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. </description> </method> <method name="get_gyroscope" qualifiers="const"> <return type="Vector3"> </return> <description> - If the device has a gyroscope, this will return the rate of rotation in rad/s around a device's X, Y, and Z axes. Otherwise, it returns an empty [Vector3]. + Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android. On other platforms, it always returns [constant Vector3.ZERO]. </description> </method> <method name="get_joy_axis" qualifiers="const"> @@ -182,7 +185,8 @@ <return type="Vector3"> </return> <description> - If the device has a magnetometer, this will return the magnetic field strength in micro-Tesla for all axes. + Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android and UWP. On other platforms, it always returns [constant Vector3.ZERO]. </description> </method> <method name="get_mouse_button_mask" qualifiers="const"> @@ -417,7 +421,8 @@ Makes the mouse cursor hidden if it is visible. </constant> <constant name="MOUSE_MODE_CAPTURED" value="2" enum="MouseMode"> - Captures the mouse. The mouse will be hidden and unable to leave the game window, but it will still register movement and mouse button presses. On Windows and Linux, the mouse will use raw input mode, which means the reported movement will be unaffected by the OS' mouse acceleration settings. + Captures the mouse. The mouse will be hidden and its position locked at the center of the screen. + [b]Note:[/b] If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative]. </constant> <constant name="MOUSE_MODE_CONFINED" value="3" enum="MouseMode"> Makes the mouse cursor visible but confines it to the game window. diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 413e217b45..3663ee98cc 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -7,8 +7,8 @@ Base class of all sort of input event. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> </tutorials> <methods> <method name="accumulate"> diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml index 1c38ff8e8f..e0d3e47219 100644 --- a/doc/classes/InputEventAction.xml +++ b/doc/classes/InputEventAction.xml @@ -7,7 +7,7 @@ Contains a generic action which can be targeted from several types of inputs. Actions can be created from the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b] menu. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link> + <link title="InputEvent: Actions">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml index 7876bace75..6ab4942f85 100644 --- a/doc/classes/InputEventJoypadButton.xml +++ b/doc/classes/InputEventJoypadButton.xml @@ -7,7 +7,7 @@ Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see [InputEventJoypadMotion]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventJoypadMotion.xml b/doc/classes/InputEventJoypadMotion.xml index bfd961ce1f..2d7787b568 100644 --- a/doc/classes/InputEventJoypadMotion.xml +++ b/doc/classes/InputEventJoypadMotion.xml @@ -7,7 +7,7 @@ Stores information about joystick motions. One [InputEventJoypadMotion] represents one axis at a time. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml index 767e67c615..fe91b9c13e 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -7,7 +7,7 @@ Stores key presses on the keyboard. Supports key presses, key releases and [member echo] events. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> <method name="get_keycode_with_modifiers" qualifiers="const"> diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index e3c9d688d2..31e82bbaed 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -7,7 +7,7 @@ Stores general mouse events information. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml index b83588a877..d7b64a9a2d 100644 --- a/doc/classes/InputEventMouseButton.xml +++ b/doc/classes/InputEventMouseButton.xml @@ -7,7 +7,7 @@ Contains mouse click information. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> + <link title="Mouse and input coordinates">https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index c36089fe9b..3e64fd63ab 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -8,7 +8,7 @@ [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, call [method Input.set_use_accumulated_input] with [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> + <link title="Mouse and input coordinates">https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventScreenDrag.xml b/doc/classes/InputEventScreenDrag.xml index a315e4ddfb..d69f175be8 100644 --- a/doc/classes/InputEventScreenDrag.xml +++ b/doc/classes/InputEventScreenDrag.xml @@ -7,7 +7,7 @@ Contains screen drag information. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml index 16a3cf8353..f497f2fecc 100644 --- a/doc/classes/InputEventScreenTouch.xml +++ b/doc/classes/InputEventScreenTouch.xml @@ -8,7 +8,7 @@ Stores multi-touch press/release information. Supports touch press, touch release and [member index] for multi-touch count and order. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml index cc7de2ca32..667879a922 100644 --- a/doc/classes/InputEventWithModifiers.xml +++ b/doc/classes/InputEventWithModifiers.xml @@ -7,7 +7,7 @@ Contains keys events information with modifiers support like [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 03212538c9..062ac3869d 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -7,7 +7,7 @@ Manages all [InputEventAction] which can be created/modified from the project settings menu [b]Project > Project Settings > Input Map[/b] or in code with [method add_action] and [method action_add_event]. See [method Node._input]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link> + <link title="InputEvent: InputMap">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link> </tutorials> <methods> <method name="action_add_event"> diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml index 68f6c32a53..c707a72ee8 100644 --- a/doc/classes/JavaScript.xml +++ b/doc/classes/JavaScript.xml @@ -5,9 +5,10 @@ </brief_description> <description> The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. + [b]Note:[/b] This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See [url=https://docs.godotengine.org/en/latest/development/compiling/compiling_for_web.html]Compiling for the Web[/url] in the documentation for more information. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link> + <link title="Exporting for the Web: Calling JavaScript from script">https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link> </tutorials> <methods> <method name="eval"> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 455fdad771..5a1b4630d0 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -10,7 +10,7 @@ </description> <tutorials> <link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link> + <link title="Using KinematicBody2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link> </tutorials> <methods> <method name="get_floor_normal" qualifiers="const"> diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml index 01cce907f9..5d9c7fd896 100644 --- a/doc/classes/KinematicBody3D.xml +++ b/doc/classes/KinematicBody3D.xml @@ -9,7 +9,7 @@ [b]Kinematic characters:[/b] KinematicBody3D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> + <link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> </tutorials> <methods> <method name="get_axis_lock" qualifiers="const"> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 2862190d4d..c5f0c2df8c 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -8,7 +8,7 @@ [b]Note:[/b] Light2D can also be used as a mask. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> + <link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 6979efa569..c022e56a39 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -7,7 +7,7 @@ Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> + <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <methods> <method name="get_param" qualifiers="const"> @@ -77,6 +77,8 @@ <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false"> If [code]true[/code], the light will cast shadows. </member> + <member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="1.0"> + </member> <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0"> Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. </member> @@ -138,10 +140,12 @@ <constant name="PARAM_SHADOW_BLUR" value="16" enum="Param"> Constant for accessing [member shadow_blur]. </constant> - <constant name="PARAM_TRANSMITTANCE_BIAS" value="17" enum="Param"> + <constant name="PARAM_SHADOW_VOLUMETRIC_FOG_FADE" value="17" enum="Param"> + </constant> + <constant name="PARAM_TRANSMITTANCE_BIAS" value="18" enum="Param"> Constant for accessing [member shadow_transmittance_bias]. </constant> - <constant name="PARAM_MAX" value="18" enum="Param"> + <constant name="PARAM_MAX" value="19" enum="Param"> Represents the size of the [enum Param] enum. </constant> <constant name="BAKE_DISABLED" value="0" enum="BakeMode"> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index a02f7a0f75..9f128e5942 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -7,7 +7,7 @@ Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> + <link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index cfd23b28bd..22fe4f6194 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -85,7 +85,7 @@ The style for the points between the start and the end. </member> <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array( )"> - The points that form the lines. The line is drawn between every point set in this array. + The points that form the lines. The line is drawn between every point set in this array. Points are interpreted as local vectors. </member> <member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision" default="8"> The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 13d3355da5..fed936cc2f 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -5,6 +5,7 @@ </brief_description> <description> This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page). + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 316315f777..cf1fdb5ba6 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -6,6 +6,7 @@ <description> Special button that brings up a [PopupMenu] when clicked. New items can be created inside this [PopupMenu] using [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from the editor. To do so, select the [MenuButton] node, then in the toolbar at the top of the 2D editor, click [b]Items[/b] then click [b]Add[/b] in the popup. You will be able to give each items new properties. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 367099e455..1efa72a2b2 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -44,7 +44,7 @@ <return type="AABB"> </return> <description> - Returns the smallest [AABB] enclosing this mesh. Not affected by [code]custom_aabb[/code]. + Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. See also [method VisualInstance3D.get_transformed_aabb]. [b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh]. </description> </method> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index 689f8d83e1..59b312f69a 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -7,7 +7,7 @@ Node used for displaying a [Mesh] in 2D. Can be constructed from an existing [Sprite2D] via a tool in the editor toolbar. Select "Sprite2D" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link> + <link title="2D meshes">https://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 0f56ab4b95..e1b3ffa2e4 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -10,15 +10,15 @@ Since instances may have any behavior, the AABB used for visibility must be provided by the user. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link> + <link title="Animating thousands of fish with MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> + <link title="Optimization using MultiMeshes">https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link> </tutorials> <methods> <method name="get_aabb" qualifiers="const"> <return type="AABB"> </return> <description> - Returns the visibility axis-aligned bounding box. + Returns the visibility axis-aligned bounding box in local space. See also [method VisualInstance3D.get_transformed_aabb]. </description> </method> <method name="get_instance_color" qualifiers="const"> diff --git a/doc/classes/MultiMeshInstance3D.xml b/doc/classes/MultiMeshInstance3D.xml index cab17c952e..7d8035ba77 100644 --- a/doc/classes/MultiMeshInstance3D.xml +++ b/doc/classes/MultiMeshInstance3D.xml @@ -8,9 +8,9 @@ This is useful to optimize the rendering of a high amount of instances of a given mesh (for example trees in a forest or grass strands). </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link> + <link title="Animating thousands of fish with MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> + <link title="Using MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link> + <link title="Optimization using MultiMeshes">https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml index 2de1f71867..f5f6308401 100644 --- a/doc/classes/Mutex.xml +++ b/doc/classes/Mutex.xml @@ -7,7 +7,7 @@ A synchronization mutex (mutual exclusion). This is used to synchronize multiple [Thread]s, and is equivalent to a binary [Semaphore]. It guarantees that only one thread can ever acquire the lock at a time. A mutex can be used to protect a critical section; however, be careful to avoid deadlocks. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> + <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> </tutorials> <methods> <method name="lock"> diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 6deca4394f..a2fa31bf65 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -80,14 +80,17 @@ <member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="2.0"> </member> <member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.9"> + The maximum height difference between two areas for navigation to be generated between them. </member> <member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0"> + The maximum angle a slope can be at for navigation to be generated on it. </member> <member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.6"> </member> <member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.2"> </member> <member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3"> + The size of cells in the [NavigationMesh]. </member> <member name="detail/sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0"> </member> @@ -104,18 +107,25 @@ <member name="filter/low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false"> </member> <member name="geometry/collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask"> + The physics layers used to generate the [NavigationMesh]. </member> <member name="geometry/parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" default="0"> + What kind of geomerty is used to generate the [NavigationMesh]. </member> <member name="geometry/source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" default="0"> + Which geometry is used to generate the [NavigationMesh]. </member> <member name="geometry/source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name"> + The name of the group that is used to generate the [NavigationMesh]. </member> <member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0"> + The number of vertices to use per polygon. Higher values will improve performance at the cost of lower precision. </member> <member name="region/merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0"> + If two adjacent regions' edges are separated by a distance lower than this value, the regions will be merged together. </member> <member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="8.0"> + The minimum size of a region for it to be created. </member> <member name="sample_partition_type/sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" default="0"> </member> diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml index ff97ea926d..7e2a9af59f 100644 --- a/doc/classes/NetworkedMultiplayerPeer.xml +++ b/doc/classes/NetworkedMultiplayerPeer.xml @@ -7,7 +7,7 @@ Manages the connection to network peers. Assigns unique IDs to each client connected to the server. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link> + <link title="High-level multiplayer">https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link> </tutorials> <methods> <method name="get_connection_status" qualifiers="const"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 8f66c9df38..1548800901 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -17,7 +17,7 @@ [b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link> + <link title="Scenes and nodes">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link> </tutorials> <methods> <method name="_enter_tree" qualifiers="virtual"> @@ -194,6 +194,7 @@ Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). [b]Note:[/b] It does not match against the full path, just against individual node names. If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. + [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] instead. To avoid using [method find_node] too often, consider caching the node reference into a variable. </description> </method> <method name="find_parent" qualifiers="const"> @@ -204,6 +205,7 @@ <description> Finds the first parent of the current node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). [b]Note:[/b] It does not match against the full path, just against individual node names. + [b]Note:[/b] As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using [method get_node] instead. To avoid using [method find_parent] too often, consider caching the node reference into a variable. </description> </method> <method name="get_child" qualifiers="const"> @@ -213,6 +215,7 @@ </argument> <description> Returns a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node. + Negative indices access the children from the last one. To access a child node via its name, use [method get_node]. </description> </method> @@ -522,7 +525,7 @@ ┠╴Menu ┃ ┠╴Label ┃ ┖╴Camera2D - ┖-SplashScreen + ┖╴SplashScreen ┖╴Camera2D [/codeblock] </description> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index d29c556216..987a18f367 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -7,7 +7,7 @@ A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> + <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <methods> <method name="apply_scale"> diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 02b319fb5a..1ef875f606 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -9,7 +9,7 @@ [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link> + <link title="Introduction to 3D">https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link> </tutorials> <methods> <method name="force_update_transform"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 26110df335..a1f12e1a31 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -234,13 +234,6 @@ Returns the number of threads available on the host machine. </description> </method> - <method name="get_splash_tick_msec" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the amount of time in milliseconds it took for the boot logo to appear. - </description> - </method> <method name="get_static_memory_peak_usage" qualifiers="const"> <return type="int"> </return> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index ca6b624359..50d91c7943 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -395,7 +395,7 @@ <argument index="0" name="name" type="String"> </argument> <description> - Removes a given entry from the object's metadata. + Removes a given entry from the object's metadata. See also [method set_meta]. </description> </method> <method name="set"> @@ -464,7 +464,8 @@ <argument index="1" name="value" type="Variant"> </argument> <description> - Adds or changes a given entry in the object's metadata. Metadata are serialized, and can take any [Variant] value. + Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any [Variant] value. + To remove a given entry from the object's metadata, use [method remove_meta]. Metadata is also removed if its value is set to [code]null[/code]. This means you can also use [code]set_meta("name", null)[/code] to remove metadata for [code]"name"[/code]. </description> </method> <method name="set_script"> @@ -486,13 +487,35 @@ </description> </method> <method name="tr" qualifiers="const"> - <return type="StringName"> + <return type="String"> </return> <argument index="0" name="message" type="StringName"> </argument> + <argument index="1" name="context" type="StringName" default=""""> + </argument> <description> - Translates a message using translation catalogs configured in the Project Settings. + Translates a message using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context. Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] unchanged. See [method set_message_translation]. + See [url=https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url] for examples of the usage of this method. + </description> + </method> + <method name="tr_n" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="message" type="StringName"> + </argument> + <argument index="1" name="plural_message" type="StringName"> + </argument> + <argument index="2" name="n" type="int"> + </argument> + <argument index="3" name="context" type="StringName" default=""""> + </argument> + <description> + Translates a message involving plurals using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context. + Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] or [code]plural_message[/code] unchanged. See [method set_message_translation]. + The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. + [b]Note:[/b] Negative and floating-point values usually represent physical entities for which singular and plural don't clearly apply. In such cases, use [method tr]. + See [url=https://docs.godotengine.org/en/latest/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url] for examples of the usage of this method. </description> </method> </methods> diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml index 000d67e691..dfcb19a287 100644 --- a/doc/classes/OmniLight3D.xml +++ b/doc/classes/OmniLight3D.xml @@ -7,7 +7,7 @@ An Omnidirectional light is a type of [Light3D] that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> + <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 39d974ec47..510f952fea 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -5,6 +5,7 @@ </brief_description> <description> OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> @@ -217,7 +218,7 @@ <argument index="0" name="index" type="int"> </argument> <description> - Emitted the when user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument. + Emitted when the user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument. </description> </signal> <signal name="item_selected"> diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml index 314869be49..6b500d5ac3 100644 --- a/doc/classes/PCKPacker.xml +++ b/doc/classes/PCKPacker.xml @@ -23,6 +23,8 @@ </argument> <argument index="1" name="source_path" type="String"> </argument> + <argument index="2" name="encrypt" type="bool" default="false"> + </argument> <description> Adds the [code]source_path[/code] file to the current PCK package at the [code]pck_path[/code] internal path (should start with [code]res://[/code]). </description> @@ -43,6 +45,10 @@ </argument> <argument index="1" name="alignment" type="int" default="0"> </argument> + <argument index="2" name="key" type="String" default=""""> + </argument> + <argument index="3" name="encrypt_directory" type="bool" default="false"> + </argument> <description> Creates a new PCK file with the name [code]pck_name[/code]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [code]pck_name[/code] (even though it's not required). </description> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 08f8558881..0b43522bce 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -57,6 +57,19 @@ Returns a new [PackedByteArray] with the data decompressed. Set [code]buffer_size[/code] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> + <method name="decompress_dynamic"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="max_output_size" type="int"> + </argument> + <argument index="1" name="compression_mode" type="int" default="0"> + </argument> + <description> + Returns a new [PackedByteArray] with the data decompressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. [b]This method only accepts gzip and deflate compression modes.[/b] + This method is potentially slower than [code]decompress[/code], as it may have to re-allocate it's output buffer multiple times while decompressing, where as [code]decompress[/code] knows it's output buffer size from the beginning. + GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via [code]max_output_size[/code]. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned. + </description> + </method> <method name="empty"> <return type="bool"> </return> @@ -68,14 +81,28 @@ <return type="String"> </return> <description> - Returns a copy of the array's contents as [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. + Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. + </description> + </method> + <method name="get_string_from_utf16"> + <return type="String"> + </return> + <description> + Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string. + </description> + </method> + <method name="get_string_from_utf32"> + <return type="String"> + </return> + <description> + Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string. </description> </method> <method name="get_string_from_utf8"> <return type="String"> </return> <description> - Returns a copy of the array's contents as [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. + Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. </description> </method> <method name="has"> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index d04ac5bdce..f6fa3cf38b 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -243,6 +243,14 @@ <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0"> Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes. </member> + <member name="sub_emitter_amount_at_end" type="int" setter="set_sub_emitter_amount_at_end" getter="get_sub_emitter_amount_at_end"> + </member> + <member name="sub_emitter_frequency" type="float" setter="set_sub_emitter_frequency" getter="get_sub_emitter_frequency"> + </member> + <member name="sub_emitter_keep_velocity" type="bool" setter="set_sub_emitter_keep_velocity" getter="get_sub_emitter_keep_velocity" default="false"> + </member> + <member name="sub_emitter_mode" type="int" setter="set_sub_emitter_mode" getter="get_sub_emitter_mode" enum="ParticlesMaterial.SubEmitterMode" default="0"> + </member> <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> @@ -252,15 +260,6 @@ <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Tangential acceleration randomness ratio. </member> - <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier"> - Trail particles' color will vary along this [GradientTexture]. - </member> - <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" default="1"> - Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s). - </member> - <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier"> - Trail particles' size will vary along this [CurveTexture]. - </member> </members> <constants> <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter"> @@ -332,5 +331,15 @@ <constant name="EMISSION_SHAPE_MAX" value="5" enum="EmissionShape"> Represents the size of the [enum EmissionShape] enum. </constant> + <constant name="SUB_EMITTER_DISABLED" value="0" enum="SubEmitterMode"> + </constant> + <constant name="SUB_EMITTER_CONSTANT" value="1" enum="SubEmitterMode"> + </constant> + <constant name="SUB_EMITTER_AT_END" value="2" enum="SubEmitterMode"> + </constant> + <constant name="SUB_EMITTER_AT_COLLISION" value="3" enum="SubEmitterMode"> + </constant> + <constant name="SUB_EMITTER_MAX" value="4" enum="SubEmitterMode"> + </constant> </constants> </class> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index 6afbd1ee8e..ca42f5801a 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -7,7 +7,7 @@ PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> <method name="add_collision_exception_with"> @@ -80,10 +80,10 @@ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans for collisions. + The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" override="true" default="false" /> <member name="layers" type="int" setter="_set_layers" getter="_get_layers"> diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml index 2301a07a5c..7de65603f9 100644 --- a/doc/classes/PhysicsBody3D.xml +++ b/doc/classes/PhysicsBody3D.xml @@ -7,7 +7,7 @@ PhysicsBody3D is an abstract base class for implementing a physics body. All *Body types inherit from it. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> <method name="add_collision_exception_with"> @@ -80,10 +80,10 @@ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans for collisions. + The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> </members> <constants> diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index 30519e11be..dfc0ab909a 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -7,7 +7,7 @@ Provides direct access to a physics body in the [PhysicsServer2D], allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [method RigidBody2D._integrate_forces]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_central_force"> diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml index d85d7794dd..676e33601a 100644 --- a/doc/classes/PhysicsDirectSpaceState2D.xml +++ b/doc/classes/PhysicsDirectSpaceState2D.xml @@ -7,7 +7,7 @@ Direct access object to a space in the [PhysicsServer2D]. It's used mainly to do queries against objects and areas residing in a given space. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-Casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="cast_motion"> diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml index ea094dcd90..789e8cc731 100644 --- a/doc/classes/PhysicsDirectSpaceState3D.xml +++ b/doc/classes/PhysicsDirectSpaceState3D.xml @@ -7,7 +7,7 @@ Direct access object to a space in the [PhysicsServer3D]. It's used mainly to do queries against objects and areas residing in a given space. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="cast_motion"> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index b2904c6538..6a1508b0e3 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -804,6 +804,7 @@ </argument> <description> Sets a body state using one of the [enum BodyState] constants. + Note that the method doesn't take effect immediately. The state will change on the next physics frame. </description> </method> <method name="body_test_motion"> diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml index 63e13954ab..93ca684b95 100644 --- a/doc/classes/PhysicsShapeQueryParameters2D.xml +++ b/doc/classes/PhysicsShapeQueryParameters2D.xml @@ -18,7 +18,7 @@ If [code]true[/code], the query will take [PhysicsBody2D]s into account. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="2147483647"> - The physics layer(s) the query will take into account (as a bitmask). + The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]"> The list of objects or object [RID]s that will be excluded from collisions. diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml index f4191d4862..167fb31bb3 100644 --- a/doc/classes/PhysicsShapeQueryParameters3D.xml +++ b/doc/classes/PhysicsShapeQueryParameters3D.xml @@ -18,7 +18,7 @@ If [code]true[/code], the query will take [PhysicsBody3D]s into account. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647"> - The physics layer(s) the query will take into account (as a bitmask). + The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]"> The list of objects or object [RID]s that will be excluded from collisions. diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index ce0680523c..d420e6ccdc 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -7,7 +7,7 @@ Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Plane"> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index ce55c90c68..b1ec9a222a 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -5,6 +5,8 @@ </brief_description> <description> [PopupMenu] is a [Control] that displays a list of options. They are popular in toolbars or context menus. + The size of a [PopupMenu] can be limited by using [member Window.max_size]. If the height of the list of items is larger than the maximum height of the [PopupMenu], a [ScrollContainer] within the popup will allow the user to scroll the contents. + If no maximum size is set, or if it is set to 0, the [PopupMenu] height will be limited by its parent rect. </description> <tutorials> </tutorials> @@ -27,14 +29,14 @@ <method name="add_check_shortcut"> <return type="void"> </return> - <argument index="0" name="shortcut" type="ShortCut"> + <argument index="0" name="shortcut" type="Shortcut"> </argument> <argument index="1" name="id" type="int" default="-1"> </argument> <argument index="2" name="global" type="bool" default="false"> </argument> <description> - Adds a new checkable item and assigns the specified [ShortCut] to it. Sets the label of the checkbox to the [ShortCut]'s name. + Adds a new checkable item and assigns the specified [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index. [b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. </description> @@ -61,14 +63,14 @@ </return> <argument index="0" name="texture" type="Texture2D"> </argument> - <argument index="1" name="shortcut" type="ShortCut"> + <argument index="1" name="shortcut" type="Shortcut"> </argument> <argument index="2" name="id" type="int" default="-1"> </argument> <argument index="3" name="global" type="bool" default="false"> </argument> <description> - Adds a new checkable item and assigns the specified [ShortCut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [ShortCut]'s name. + Adds a new checkable item and assigns the specified [Shortcut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [Shortcut]'s name. An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index. [b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. </description> @@ -109,7 +111,7 @@ </return> <argument index="0" name="texture" type="Texture2D"> </argument> - <argument index="1" name="shortcut" type="ShortCut"> + <argument index="1" name="shortcut" type="Shortcut"> </argument> <argument index="2" name="id" type="int" default="-1"> </argument> @@ -124,14 +126,14 @@ </return> <argument index="0" name="texture" type="Texture2D"> </argument> - <argument index="1" name="shortcut" type="ShortCut"> + <argument index="1" name="shortcut" type="Shortcut"> </argument> <argument index="2" name="id" type="int" default="-1"> </argument> <argument index="3" name="global" type="bool" default="false"> </argument> <description> - Adds a new item and assigns the specified [ShortCut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [ShortCut]'s name. + Adds a new item and assigns the specified [Shortcut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [Shortcut]'s name. An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index. </description> </method> @@ -186,14 +188,14 @@ <method name="add_radio_check_shortcut"> <return type="void"> </return> - <argument index="0" name="shortcut" type="ShortCut"> + <argument index="0" name="shortcut" type="Shortcut"> </argument> <argument index="1" name="id" type="int" default="-1"> </argument> <argument index="2" name="global" type="bool" default="false"> </argument> <description> - Adds a new radio check button and assigns a [ShortCut] to it. Sets the label of the checkbox to the [ShortCut]'s name. + Adds a new radio check button and assigns a [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index. [b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. </description> @@ -210,14 +212,14 @@ <method name="add_shortcut"> <return type="void"> </return> - <argument index="0" name="shortcut" type="ShortCut"> + <argument index="0" name="shortcut" type="Shortcut"> </argument> <argument index="1" name="id" type="int" default="-1"> </argument> <argument index="2" name="global" type="bool" default="false"> </argument> <description> - Adds a [ShortCut]. + Adds a [Shortcut]. An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index. </description> </method> @@ -301,12 +303,12 @@ </description> </method> <method name="get_item_shortcut" qualifiers="const"> - <return type="ShortCut"> + <return type="Shortcut"> </return> <argument index="0" name="idx" type="int"> </argument> <description> - Returns the [ShortCut] associated with the specified [code]idx[/code] item. + Returns the [Shortcut] associated with the specified [code]idx[/code] item. </description> </method> <method name="get_item_submenu" qualifiers="const"> @@ -519,12 +521,12 @@ </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="shortcut" type="ShortCut"> + <argument index="1" name="shortcut" type="Shortcut"> </argument> <argument index="2" name="global" type="bool" default="false"> </argument> <description> - Sets a [ShortCut] for the specified item [code]idx[/code]. + Sets a [Shortcut] for the specified item [code]idx[/code]. </description> </method> <method name="set_item_shortcut_disabled"> @@ -535,7 +537,7 @@ <argument index="1" name="disabled" type="bool"> </argument> <description> - Disables the [ShortCut] of the specified index [code]idx[/code]. + Disables the [Shortcut] of the specified index [code]idx[/code]. </description> </method> <method name="set_item_submenu"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 793249afc5..ed8eddda07 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -92,9 +92,12 @@ </argument> <argument index="1" name="replace_files" type="bool" default="true"> </argument> + <argument index="2" name="offset" type="int" default="0"> + </argument> <description> Loads the contents of the .pck or .zip file specified by [code]pack[/code] into the resource filesystem ([code]res://[/code]). Returns [code]true[/code] on success. [b]Note:[/b] If a file from [code]pack[/code] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [code]pack[/code] unless [code]replace_files[/code] is set to [code]false[/code]. + [b]Note:[/b] The optional [code]offset[/code] parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. </description> </method> <method name="localize_path" qualifiers="const"> @@ -205,7 +208,8 @@ Icon set in [code].icns[/code] format used on macOS to set the game's icon. This is done automatically on start by calling [method DisplayServer.set_native_icon]. </member> <member name="application/config/name" type="String" setter="" getter="" default=""""> - The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. + The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. The window title will be set to match the project name automatically on startup. + [b]Note:[/b] Changing this value will also change the user data folder's path if [member application/config/use_custom_user_dir] is [code]false[/code]. After renaming the project, you will no longer be able to access existing data in [code]user://[/code] unless you rename the old folder to match the new project name. See [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] in the documentation for more information. </member> <member name="application/config/project_settings_override" type="String" setter="" getter="" default=""""> Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. @@ -869,7 +873,7 @@ Size of the hash table used for the broad-phase 2D hash grid algorithm. </member> <member name="physics/2d/cell_size" type="int" setter="" getter="" default="128"> - Cell size used for the broad-phase 2D hash grid algorithm. + Cell size used for the broad-phase 2D hash grid algorithm (in pixels). </member> <member name="physics/2d/default_angular_damp" type="float" setter="" getter="" default="1.0"> The default angular damp in 2D. @@ -1038,6 +1042,9 @@ <member name="rendering/quality/glow/upscale_mode.mobile" type="int" setter="" getter="" default="0"> Lower-end override for [member rendering/quality/glow/upscale_mode] on mobile devices, due to performance concerns or driver support. </member> + <member name="rendering/quality/glow/use_high_quality" type="bool" setter="" getter="" default="false"> + Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. + </member> <member name="rendering/quality/intended_usage/framebuffer_allocation" type="int" setter="" getter="" default="2"> Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects will not be available in the [Environment]. </member> @@ -1158,6 +1165,16 @@ <member name="rendering/threads/thread_model" type="int" setter="" getter="" default="1"> Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. </member> + <member name="rendering/volumetric_fog/directional_shadow_shrink" type="int" setter="" getter="" default="512"> + </member> + <member name="rendering/volumetric_fog/positional_shadow_shrink" type="int" setter="" getter="" default="512"> + </member> + <member name="rendering/volumetric_fog/use_filter" type="int" setter="" getter="" default="0"> + </member> + <member name="rendering/volumetric_fog/volume_depth" type="int" setter="" getter="" default="128"> + </member> + <member name="rendering/volumetric_fog/volume_size" type="int" setter="" getter="" default="64"> + </member> <member name="rendering/vram_compression/import_bptc" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the BPTC algorithm. This texture compression algorithm is only supported on desktop platforms, and only when using the Vulkan renderer. </member> @@ -1182,7 +1199,7 @@ <member name="rendering/vulkan/staging_buffer/texture_upload_region_size_px" type="int" setter="" getter="" default="64"> </member> <member name="world/2d/cell_size" type="int" setter="" getter="" default="100"> - Cell size used for the 2D hash grid that [VisibilityNotifier2D] uses. + Cell size used for the 2D hash grid that [VisibilityNotifier2D] uses (in pixels). </member> </members> <constants> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 730edb00d9..2218852dae 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -9,7 +9,7 @@ Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> + <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> </tutorials> <methods> <method name="Quat"> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 6a11630c0e..e30d7df63f 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -4,14 +4,14 @@ Query the closest object intersecting a ray. </brief_description> <description> - A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 2D space in order to find the closest object along the path of the ray. - RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. + A RayCast represents a line from its origin to its destination position, [member target_position]. It is used to query the 2D space in order to find the closest object along the path of the ray. + RayCast2D can ignore some objects by adding them to the exception list via [method add_exception], by setting proper filtering with collision layers, or by filtering object types with type masks. RayCast2D can be configured to report collisions with [Area2D]s ([member collide_with_areas]) and/or [PhysicsBody2D]s ([member collide_with_bodies]). Only enabled raycasts will be able to query the space and report collisions. RayCast2D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> @@ -123,9 +123,6 @@ </method> </methods> <members> - <member name="cast_to" type="Vector2" setter="set_cast_to" getter="get_cast_to" default="Vector2( 0, 50 )"> - The ray's destination point, relative to the RayCast's [code]position[/code]. - </member> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> If [code]true[/code], collision with [Area2D]s will be reported. </member> @@ -133,7 +130,7 @@ If [code]true[/code], collision with [PhysicsBody2D]s will be reported. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. + The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> If [code]true[/code], collisions will be reported. @@ -141,6 +138,9 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], the parent node will be excluded from collision detection. </member> + <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2( 0, 50 )"> + The ray's destination point, relative to the RayCast's [code]position[/code]. + </member> </members> <constants> </constants> diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml index e7ee1d284f..1d8edf0adb 100644 --- a/doc/classes/RayCast3D.xml +++ b/doc/classes/RayCast3D.xml @@ -4,14 +4,14 @@ Query the closest object intersecting a ray. </brief_description> <description> - A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 3D space in order to find the closest object along the path of the ray. - RayCast3D can ignore some objects by adding them to the exception list via [code]add_exception[/code] or by setting proper filtering with collision layers and masks. + A RayCast represents a line from its origin to its destination position, [member target_position]. It is used to query the 3D space in order to find the closest object along the path of the ray. + RayCast3D can ignore some objects by adding them to the exception list via [method add_exception] or by setting proper filtering with collision layers and masks. RayCast3D can be configured to report collisions with [Area3D]s ([member collide_with_areas]) and/or [PhysicsBody3D]s ([member collide_with_bodies]). Only enabled raycasts will be able to query the space and report collisions. RayCast3D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> @@ -126,9 +126,6 @@ </method> </methods> <members> - <member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" default="Vector3( 0, -1, 0 )"> - The ray's destination point, relative to the RayCast's [code]position[/code]. - </member> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> If [code]true[/code], collision with [Area3D]s will be reported. </member> @@ -136,7 +133,7 @@ If [code]true[/code], collision with [PhysicsBody3D]s will be reported. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. + The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> If [code]true[/code], collisions will be reported. @@ -144,6 +141,9 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent. </member> + <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3( 0, -1, 0 )"> + The ray's destination point, relative to the RayCast's [code]position[/code]. + </member> </members> <constants> </constants> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 8599aad95e..2d1685871d 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -5,10 +5,11 @@ </brief_description> <description> [Rect2] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. - It uses floating point coordinates. + It uses floating-point coordinates. If you need integer coordinates, use [Rect2i] instead. + The 3D counterpart to [Rect2] is [AABB]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Rect2"> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 7362580c02..809f385f6e 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -5,10 +5,10 @@ </brief_description> <description> [Rect2i] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. - It uses integer coordinates. + It uses integer coordinates. If you need floating-point coordinates, use [Rect2] instead. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Rect2i"> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 07d7b646a1..5458b496da 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -8,7 +8,7 @@ The [ReflectionProbe] is used to create high-quality reflections at the cost of performance. It can be combined with [GIProbe]s and Screen Space Reflections to achieve high quality reflections. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link> + <link title="Reflection probes">https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 85eaac454f..9c8c964967 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -15,7 +15,7 @@ In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html</link> + <link title="Optimization using Servers">https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html</link> </tutorials> <methods> <method name="black_bars_set_images"> @@ -690,52 +690,19 @@ </argument> <argument index="1" name="enable" type="bool"> </argument> - <argument index="2" name="color" type="Color"> - </argument> - <argument index="3" name="sun_color" type="Color"> - </argument> - <argument index="4" name="sun_amount" type="float"> - </argument> - <description> - Sets the variables to be used with the scene fog. See [Environment] for more details. - </description> - </method> - <method name="environment_set_fog_depth"> - <return type="void"> - </return> - <argument index="0" name="env" type="RID"> - </argument> - <argument index="1" name="enable" type="bool"> + <argument index="2" name="light_color" type="Color"> </argument> - <argument index="2" name="depth_begin" type="float"> + <argument index="3" name="light_energy" type="float"> </argument> - <argument index="3" name="depth_end" type="float"> - </argument> - <argument index="4" name="depth_curve" type="float"> - </argument> - <argument index="5" name="transmit" type="bool"> - </argument> - <argument index="6" name="transmit_curve" type="float"> - </argument> - <description> - Sets the variables to be used with the fog depth effect. See [Environment] for more details. - </description> - </method> - <method name="environment_set_fog_height"> - <return type="void"> - </return> - <argument index="0" name="env" type="RID"> - </argument> - <argument index="1" name="enable" type="bool"> + <argument index="4" name="sun_scatter" type="float"> </argument> - <argument index="2" name="min_height" type="float"> + <argument index="5" name="density" type="float"> </argument> - <argument index="3" name="max_height" type="float"> + <argument index="6" name="height" type="float"> </argument> - <argument index="4" name="height_curve" type="float"> + <argument index="7" name="height_density" type="float"> </argument> <description> - Sets the variables to be used with the fog height effect. See [Environment] for more details. </description> </method> <method name="environment_set_glow"> @@ -3252,9 +3219,9 @@ <constant name="LIGHT_PARAM_SHADOW_BLUR" value="16" enum="LightParam"> Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. </constant> - <constant name="LIGHT_PARAM_TRANSMITTANCE_BIAS" value="17" enum="LightParam"> + <constant name="LIGHT_PARAM_TRANSMITTANCE_BIAS" value="18" enum="LightParam"> </constant> - <constant name="LIGHT_PARAM_MAX" value="18" enum="LightParam"> + <constant name="LIGHT_PARAM_MAX" value="19" enum="LightParam"> Represents the size of the [enum LightParam] enum. </constant> <constant name="LIGHT_BAKE_DISABLED" value="0" enum="LightBakeMode"> diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml index 34431c5153..726b26fbc7 100644 --- a/doc/classes/RichTextEffect.xml +++ b/doc/classes/RichTextEffect.xml @@ -13,8 +13,8 @@ [b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> - <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> + <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> <method name="_process_custom_fx" qualifiers="virtual"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index a1c4fcc53c..050f1aab25 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -9,7 +9,7 @@ [b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> </tutorials> <methods> <method name="add_image"> @@ -44,6 +44,7 @@ </argument> <description> Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful. + [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_bbcode] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member bbcode_text] instead of using [method append_bbcode]. </description> </method> <method name="clear"> @@ -289,7 +290,7 @@ </member> <member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" default=""""> The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. - [b]Note:[/b] It is unadvised to use [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead. + [b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. </member> <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[ ]"> The currently installed custom effects. This is an array of [RichTextEffect]s. diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index a7efba518c..f3d43b193e 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -9,6 +9,7 @@ [b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator]. + The center of mass is always located at the node's origin without taking into account the [CollisionShape2D] centroid offsets. </description> <tutorials> </tutorials> @@ -128,6 +129,7 @@ </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. + [b]Note:[/b] A RigidBody2D will never enter sleep mode automatically if its [member mode] is [constant MODE_CHARACTER]. It can still be put to sleep manually by setting its [member sleeping] property to [code]true[/code]. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported]. diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index 933885ba77..e9ebf33aa7 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -8,9 +8,10 @@ A RigidBody3D has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic. [b]Note:[/b] Don't change a RigidBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator]. + With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> <method name="_integrate_forces" qualifiers="virtual"> @@ -155,6 +156,7 @@ </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. + [b]Note:[/b] A RigidBody3D will never enter sleep mode automatically if its [member mode] is [constant MODE_CHARACTER]. It can still be put to sleep manually by setting its [member sleeping] property to [code]true[/code]. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. See also [member contacts_reported]. diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index 00ca5c6e9f..4ea457047f 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -9,8 +9,8 @@ [SceneTree] is the default [MainLoop] implementation used by scenes, and is thus in charge of the game loop. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html</link> + <link title="SceneTree">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link> + <link title="Multiple resolutions">https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html</link> </tutorials> <methods> <method name="call_group" qualifiers="vararg"> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 0d94453e52..56272760bd 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -8,7 +8,7 @@ The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link> + <link title="Scripting">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link> </tutorials> <methods> <method name="can_instance" qualifiers="const"> diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml index 20b0750431..d5a32dd20c 100644 --- a/doc/classes/ScriptEditor.xml +++ b/doc/classes/ScriptEditor.xml @@ -86,6 +86,7 @@ <argument index="1" name="base_path" type="String"> </argument> <description> + Opens the script create dialog. The script will extend [code]base_name[/code]. The file extension can be omitted from [code]base_path[/code]. It will be added based on the selected scripting language. </description> </method> <method name="register_syntax_highlighter"> diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml index c9745acfcd..f311e1c72f 100644 --- a/doc/classes/Semaphore.xml +++ b/doc/classes/Semaphore.xml @@ -7,7 +7,7 @@ A synchronization semaphore which can be used to synchronize multiple [Thread]s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see [Mutex]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> + <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> </tutorials> <methods> <method name="post"> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 109c500a63..a717eba438 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -7,8 +7,8 @@ This class allows you to define a custom shader program that can be used by a [ShaderMaterial]. Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/shading/your_first_shader/what_are_shaders.html</link> + <link title="Shading tutorial index">https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> + <link title="What are shaders?">https://docs.godotengine.org/en/latest/tutorials/shading/your_first_shader/what_are_shaders.html</link> </tutorials> <methods> <method name="get_default_texture_param" qualifiers="const"> diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 7e0e1ce831..b1748703ff 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -7,7 +7,7 @@ A material that uses a custom [Shader] program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> + <link title="Shading tutorial index">https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> </tutorials> <methods> <method name="get_shader_param" qualifiers="const"> diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 5f41d05816..65a37314f6 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -7,7 +7,7 @@ Base class for all 2D shapes. All 2D shape types inherit from this. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> <method name="collide"> diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml index 1af6550dc5..2d8bb5d051 100644 --- a/doc/classes/Shape3D.xml +++ b/doc/classes/Shape3D.xml @@ -7,7 +7,7 @@ Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a [PhysicsBody3D] or [Area3D] objects. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> + <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/ShortCut.xml b/doc/classes/Shortcut.xml index 9a2a761969..55bbb083c9 100644 --- a/doc/classes/ShortCut.xml +++ b/doc/classes/Shortcut.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ShortCut" inherits="Resource" version="4.0"> +<class name="Shortcut" inherits="Resource" version="4.0"> <brief_description> A shortcut for binding input. </brief_description> diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml index e1b7d60763..0ddbac9ba4 100644 --- a/doc/classes/Skeleton2D.xml +++ b/doc/classes/Skeleton2D.xml @@ -7,7 +7,7 @@ Skeleton2D parents a hierarchy of [Bone2D] objects. It is a requirement of [Bone2D]. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link> + <link title="2D skeletons">https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link> </tutorials> <methods> <method name="get_bone"> diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml index 24d6609900..d3ab955570 100644 --- a/doc/classes/SoftBody3D.xml +++ b/doc/classes/SoftBody3D.xml @@ -7,7 +7,7 @@ A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link> + <link title="SoftBody">https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link> </tutorials> <methods> <method name="add_collision_exception_with"> @@ -82,10 +82,10 @@ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> The physics layers this SoftBody3D is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this SoftBody3D scans for collisions. + The physics layers this SoftBody3D scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01"> </member> diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index 423633e583..fc849baa8d 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -7,7 +7,7 @@ A Spotlight is a type of [Light3D] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of [Light3D]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> + <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/SpringArm3D.xml b/doc/classes/SpringArm3D.xml index 15caff9eeb..3ffdbebae8 100644 --- a/doc/classes/SpringArm3D.xml +++ b/doc/classes/SpringArm3D.xml @@ -47,7 +47,7 @@ </methods> <members> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The layers against which the collision check shall be done. + The layers against which the collision check shall be done. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01"> When the collision check is made, a candidate length for the SpringArm3D is given. diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 92f561d7b5..f218631038 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -44,10 +44,10 @@ If [code]true[/code], texture is flipped vertically. </member> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> - Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1. + Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. </member> <member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )"> - Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1. + Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index f59d5130c9..f9b947fa3d 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -4,8 +4,7 @@ 2D sprite node in a 3D world. </brief_description> <description> - A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. - [b]Note:[/b] There are [url=https://github.com/godotengine/godot/issues/20855]known performance issues[/url] when using [Sprite3D]. Consider using a [MeshInstance3D] with a [QuadMesh] as the mesh instead. You can still have billboarding by enabling billboard properties in the QuadMesh's [StandardMaterial3D]. + A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. See also [SpriteBase3D] where properties such as the billboard mode are defined. </description> <tutorials> </tutorials> @@ -13,10 +12,10 @@ </methods> <members> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> - Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1. + Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. </member> <member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )"> - Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1. + Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index 479dc5f94c..44b08408c1 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -4,7 +4,7 @@ 2D sprite node in 3D environment. </brief_description> <description> - A node that displays 2D texture information in a 3D environment. + A node that displays 2D texture information in a 3D environment. See also [Sprite3D] where many other properties are defined. </description> <tutorials> </tutorials> @@ -13,6 +13,7 @@ <return type="TriangleMesh"> </return> <description> + Returns a [TriangleMesh] with the sprite's vertices following its current configuration (such as its [member axis] and [member pixel_size]). </description> </method> <method name="get_draw_flag" qualifiers="const"> @@ -39,17 +40,19 @@ <argument index="1" name="enabled" type="bool"> </argument> <description> - If [code]true[/code], the specified flag will be enabled. + If [code]true[/code], the specified flag will be enabled. See [enum SpriteBase3D.DrawFlags] for a list of flags. </description> </method> </methods> <members> <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="0"> + The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values. </member> <member name="axis" type="int" setter="set_axis" getter="get_axis" enum="Vector3.Axis" default="2"> The direction in which the front of the texture faces. </member> <member name="billboard" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0"> + The billboard mode to use for the sprite. See [enum BaseMaterial3D.BillboardMode] for possible values. </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true"> If [code]true[/code], texture will be centered. @@ -90,16 +93,19 @@ If set, lights in the environment affect the sprite. </constant> <constant name="FLAG_DOUBLE_SIDED" value="2" enum="DrawFlags"> - If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind. + If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind. </constant> <constant name="FLAG_MAX" value="3" enum="DrawFlags"> Represents the size of the [enum DrawFlags] enum. </constant> <constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode"> + This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. </constant> <constant name="ALPHA_CUT_DISCARD" value="1" enum="AlphaCutMode"> + This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/quality/screen_filters/screen_space_aa]). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i]. </constant> <constant name="ALPHA_CUT_OPAQUE_PREPASS" value="2" enum="AlphaCutMode"> + This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. </constant> </constants> </class> diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index 6e1e1688f4..1c7d84c5a2 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -5,6 +5,7 @@ </brief_description> <description> Sprite frame library for [AnimatedSprite2D]. Contains frames and animation data for playback. + [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps. </description> <tutorials> </tutorials> @@ -53,7 +54,7 @@ <argument index="0" name="anim" type="StringName"> </argument> <description> - If [code]true[/code], the given animation will loop. + Returns [code]true[/code] if the given animation is configured to loop when it finishes playing. Otherwise, returns [code]false[/code]. </description> </method> <method name="get_animation_names" qualifiers="const"> diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml index 69e8f67a5e..6a06c0b3f4 100644 --- a/doc/classes/StreamPeerSSL.xml +++ b/doc/classes/StreamPeerSSL.xml @@ -7,7 +7,7 @@ SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> + <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <methods> <method name="accept_stream"> diff --git a/doc/classes/StreamTexture3D.xml b/doc/classes/StreamTexture3D.xml new file mode 100644 index 0000000000..7054a4ee99 --- /dev/null +++ b/doc/classes/StreamTexture3D.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="StreamTexture3D" inherits="Texture3D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="load"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index ded64761d0..40fff25fc4 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -7,7 +7,7 @@ This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference-counted and use a copy-on-write approach, so passing them around is cheap in resources. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link> + <link title="GDScript format strings">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link> </tutorials> <methods> <method name="String"> @@ -654,6 +654,17 @@ Returns the string's amount of characters. </description> </method> + <method name="lpad"> + <return type="String"> + </return> + <argument index="0" name="min_length" type="int"> + </argument> + <argument index="1" name="character" type="String" default="" ""> + </argument> + <description> + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the left of the string. + </description> + </method> <method name="lstrip"> <return type="String"> </return> @@ -695,6 +706,15 @@ Returns the MD5 hash of the string as a string. </description> </method> + <method name="naturalnocasecmp_to"> + <return type="int"> + </return> + <argument index="0" name="to" type="String"> + </argument> + <description> + Performs a case-insensitive natural order comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal. + </description> + </method> <method name="nocasecmp_to"> <return type="int"> </return> @@ -816,6 +836,17 @@ Returns the right side of the string from a given position. </description> </method> + <method name="rpad"> + <return type="String"> + </return> + <argument index="0" name="min_length" type="int"> + </argument> + <argument index="1" name="character" type="String" default="" ""> + </argument> + <description> + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the right of the string. + </description> + </method> <method name="rsplit"> <return type="PackedStringArray"> </return> @@ -953,7 +984,7 @@ <return type="PackedByteArray"> </return> <description> - Converts the String (which is a character array) to [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 characters. + 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. </description> </method> <method name="to_float"> @@ -984,11 +1015,25 @@ Returns the string converted to uppercase. </description> </method> + <method name="to_utf16"> + <return type="PackedByteArray"> + </return> + <description> + Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes). + </description> + </method> + <method name="to_utf32"> + <return type="PackedByteArray"> + </return> + <description> + Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes). + </description> + </method> <method name="to_utf8"> <return type="PackedByteArray"> </return> <description> - Converts the String (which is an array of characters) to [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], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. </description> </method> <method name="trim_prefix"> diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml index 6014762e3d..c9c7589631 100644 --- a/doc/classes/SubViewport.xml +++ b/doc/classes/SubViewport.xml @@ -11,6 +11,7 @@ <members> <member name="render_target_clear_mode" type="int" setter="set_clear_mode" getter="get_clear_mode" enum="SubViewport.ClearMode" default="0"> The clear mode when the sub-viewport is used as a render target. + [b]Note:[/b] This property is intended for 2D usage. </member> <member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="SubViewport.UpdateMode" default="2"> The update mode when the sub-viewport is used as a render target. diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 3fc1db9dc6..ef1f370185 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -36,6 +36,13 @@ Returns [code]true[/code] if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible. </description> </method> + <method name="get_previous_tab" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the previously active tab index. + </description> + </method> <method name="get_select_with_rmb" qualifiers="const"> <return type="bool"> </return> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index d4abac15c0..a23a4936f8 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -9,6 +9,14 @@ <tutorials> </tutorials> <methods> + <method name="add_gutter"> + <return type="void"> + </return> + <argument index="0" name="at" type="int" default="-1"> + </argument> + <description> + </description> + </method> <method name="can_fold" qualifiers="const"> <return type="bool"> </return> @@ -112,11 +120,34 @@ Folds the given line, if possible (see [method can_fold]). </description> </method> - <method name="get_breakpoints" qualifiers="const"> - <return type="Array"> + <method name="get_gutter_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_gutter_name" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_gutter_type" qualifiers="const"> + <return type="int" enum="TextEdit.GutterType"> </return> + <argument index="0" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_gutter_width" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> <description> - Returns an array containing the line number of each breakpoint. </description> </method> <method name="get_line" qualifiers="const"> @@ -135,6 +166,46 @@ Returns the amount of total lines in the text. </description> </method> + <method name="get_line_gutter_icon" qualifiers="const"> + <return type="Texture2D"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_line_gutter_item_color"> + <return type="Color"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_line_gutter_metadata" qualifiers="const"> + <return type="Variant"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_line_gutter_text" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <description> + </description> + </method> <method name="get_menu" qualifiers="const"> <return type="PopupMenu"> </return> @@ -202,6 +273,40 @@ Returns whether the line at the specified index is folded or not. </description> </method> + <method name="is_gutter_clickable" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_gutter_drawn" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_gutter_overwritable" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_line_gutter_clickable" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <description> + </description> + </method> <method name="is_line_hidden" qualifiers="const"> <return type="bool"> </return> @@ -241,11 +346,12 @@ Perform redo operation. </description> </method> - <method name="remove_breakpoints"> + <method name="remove_gutter"> <return type="void"> </return> + <argument index="0" name="gutter" type="int"> + </argument> <description> - Removes all the breakpoints. This will not fire the [signal breakpoint_toggled] signal. </description> </method> <method name="search" qualifiers="const"> @@ -295,6 +401,78 @@ If [member selecting_enabled] is [code]false[/code], no selection will occur. </description> </method> + <method name="set_gutter_clickable"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="clickable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_custom_draw"> + <return type="void"> + </return> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="object" type="Object"> + </argument> + <argument index="2" name="callback" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_draw"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="draw" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_name"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_overwritable"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="overwritable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_type"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="type" type="int" enum="TextEdit.GutterType"> + </argument> + <description> + </description> + </method> + <method name="set_gutter_width"> + <return type="void"> + </return> + <argument index="0" name="gutter" type="int"> + </argument> + <argument index="1" name="width" type="int"> + </argument> + <description> + </description> + </method> <method name="set_line"> <return type="void"> </return> @@ -317,6 +495,66 @@ If [code]true[/code], hides the line of the specified index. </description> </method> + <method name="set_line_gutter_clickable"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <argument index="2" name="clickable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_line_gutter_icon"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <argument index="2" name="icon" type="Texture2D"> + </argument> + <description> + </description> + </method> + <method name="set_line_gutter_item_color"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <argument index="2" name="color" type="Color"> + </argument> + <description> + </description> + </method> + <method name="set_line_gutter_metadata"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <argument index="2" name="metadata" type="Variant"> + </argument> + <description> + </description> + </method> + <method name="set_line_gutter_text"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <argument index="1" name="gutter" type="int"> + </argument> + <argument index="2" name="text" type="String"> + </argument> + <description> + </description> + </method> <method name="toggle_fold_line"> <return type="void"> </return> @@ -351,9 +589,6 @@ </method> </methods> <members> - <member name="breakpoint_gutter" type="bool" setter="set_breakpoint_gutter_enabled" getter="is_breakpoint_gutter_enabled" default="false"> - If [code]true[/code], the breakpoint gutter is visible. - </member> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false"> If [code]true[/code], the caret (visual cursor) blinks. </member> @@ -378,9 +613,6 @@ If [code]true[/code], the "tab" character will have a visible representation. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> - <member name="fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false"> - If [code]true[/code], the fold gutter is visible. This enables folding groups of indented lines. - </member> <member name="hiding_enabled" type="bool" setter="set_hiding_enabled" getter="is_hiding_enabled" default="false"> If [code]true[/code], all lines that have been set to hidden by [method set_line_as_hidden], will not be visible. </member> @@ -404,10 +636,10 @@ If [code]true[/code], read-only mode is enabled. Existing text cannot be modified and new text cannot be added. </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> - The current horizontal scroll value. + If there is a horizontal scrollbar this determines the current horizontal scroll value in pixels. </member> <member name="scroll_vertical" type="float" setter="set_v_scroll" getter="get_v_scroll" default="0.0"> - The current vertical scroll value. + If there is a vertical scrollbar this determines the current vertical scroll value in line numbers, starting at 0 for the top line. </member> <member name="selecting_enabled" type="bool" setter="set_selecting_enabled" getter="is_selecting_enabled" default="true"> If [code]true[/code], text can be selected. @@ -416,9 +648,6 @@ <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled. </member> - <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled" default="false"> - If [code]true[/code], line numbers are displayed to the left of the text. - </member> <member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false"> If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling. </member> @@ -438,29 +667,31 @@ </member> </members> <signals> - <signal name="breakpoint_toggled"> - <argument index="0" name="row" type="int"> - </argument> + <signal name="cursor_changed"> <description> - Emitted when a breakpoint is placed via the breakpoint gutter. + Emitted when the cursor changes. </description> </signal> - <signal name="cursor_changed"> + <signal name="gutter_added"> <description> - Emitted when the cursor changes. </description> </signal> - <signal name="info_clicked"> - <argument index="0" name="row" type="int"> + <signal name="gutter_clicked"> + <argument index="0" name="line" type="int"> </argument> - <argument index="1" name="info" type="String"> + <argument index="1" name="gutter" type="int"> </argument> <description> - Emitted when the info icon is clicked. </description> </signal> - <signal name="line_edited_from"> - <argument index="0" name="line" type="int"> + <signal name="gutter_removed"> + <description> + </description> + </signal> + <signal name="lines_edited_from"> + <argument index="0" name="from_line" type="int"> + </argument> + <argument index="1" name="to_line" type="int"> </argument> <description> </description> @@ -501,6 +732,12 @@ <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags"> Search from end to beginning. </constant> + <constant name="GUTTER_TYPE_STRING" value="0" enum="GutterType"> + </constant> + <constant name="GUTTER_TPYE_ICON" value="1" enum="GutterType"> + </constant> + <constant name="GUTTER_TPYE_CUSTOM" value="2" enum="GutterType"> + </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> Cuts (copies and clears) the selected text. </constant> @@ -530,14 +767,8 @@ <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled. </theme_item> - <theme_item name="bookmark_color" type="Color" default="Color( 0.08, 0.49, 0.98, 1 )"> - Sets the [Color] of the bookmark marker. [member syntax_highlighting] has to be enabled. - </theme_item> <theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )"> </theme_item> - <theme_item name="breakpoint_color" type="Color" default="Color( 0.8, 0.8, 0.4, 0.2 )"> - Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. - </theme_item> <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )"> </theme_item> <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> @@ -565,14 +796,8 @@ <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. </theme_item> - <theme_item name="executing_line_color" type="Color" default="Color( 0.2, 0.8, 0.2, 0.4 )"> - </theme_item> <theme_item name="focus" type="StyleBox"> </theme_item> - <theme_item name="fold" type="Texture2D"> - </theme_item> - <theme_item name="folded" type="Texture2D"> - </theme_item> <theme_item name="font" type="Font"> Sets the default [Font]. </theme_item> @@ -584,9 +809,6 @@ <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )"> Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. </theme_item> - <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )"> - Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled. - </theme_item> <theme_item name="line_spacing" type="int" default="4"> Sets the spacing between the lines. </theme_item> @@ -599,8 +821,6 @@ <theme_item name="read_only" type="StyleBox"> Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled. </theme_item> - <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )"> - </theme_item> <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> Sets the highlight [Color] of text selections. </theme_item> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index ffe806cef7..f283efdc3d 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -96,7 +96,7 @@ <return type="Image"> </return> <description> - Returns an [Image] with the data from this [Texture2D]. [Image]s can be accessed and manipulated directly. + Returns an [Image] that is a copy of data from this [Texture2D]. [Image]s can be accessed and manipulated directly. </description> </method> <method name="get_height" qualifiers="const"> diff --git a/doc/classes/Texture3D.xml b/doc/classes/Texture3D.xml new file mode 100644 index 0000000000..85e940716d --- /dev/null +++ b/doc/classes/Texture3D.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Texture3D" inherits="Texture" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_data" qualifiers="const"> + <return type="Image[]"> + </return> + <description> + </description> + </method> + <method name="get_depth" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_format" qualifiers="const"> + <return type="int" enum="Image.Format"> + </return> + <description> + </description> + </method> + <method name="get_height" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_width" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="has_mipmaps" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index a5172586fe..46b008c018 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -6,6 +6,7 @@ <description> [TextureButton] has the same functionality as [Button], except it uses sprites instead of Godot's [Theme] resource. It is faster to create, but it doesn't support localization like more complex [Control]s. The "normal" state must contain a texture ([member texture_normal]); other textures are optional. + See also [BaseButton] which contains common properties and methods associated with this node. </description> <tutorials> </tutorials> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 70a4eda867..2824159f0e 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -8,7 +8,7 @@ Theme resources can alternatively be loaded by writing them in a [code].theme[/code] file, see the documentation for more information. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/gui/gui_skinning.html</link> + <link title="GUI skinning">https://docs.godotengine.org/en/latest/tutorials/gui/gui_skinning.html</link> </tutorials> <methods> <method name="clear"> diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index 5c63d01322..46377ecf20 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -5,6 +5,7 @@ </brief_description> <description> A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex] or [Semaphore] is advised if working with shared objects. + [b]Note:[/b] Breakpoints won't break on code if it's running in a thread. This is a current limitation of the GDScript debugger. </description> <tutorials> <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> @@ -15,7 +16,7 @@ <return type="String"> </return> <description> - Returns the current [Thread]'s ID, uniquely identifying it among all threads. + Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] is not running this returns an empty string. </description> </method> <method name="is_active" qualifiers="const"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 9df2b656f4..2780545f55 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -7,7 +7,7 @@ Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link> + <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link> </tutorials> <methods> <method name="clear"> @@ -166,7 +166,7 @@ If you need these to be immediately updated, you can call [method update_dirty_quadrants]. Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: [codeblock] - func set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) + func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()) # Write your custom logic here. # To call the default method: .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) @@ -287,10 +287,10 @@ Friction value for static body collisions (see [code]collision_use_kinematic[/code]). </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> - The collision layer(s) for all colliders in the TileMap. + The collision layer(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The collision mask(s) for all colliders in the TileMap. + The collision mask(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" default="false"> If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body. diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index c7f886b3f2..355804f2a3 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TouchScreenButton" inherits="Node2D" version="4.0"> <brief_description> - Button for touch screen devices. + Button for touch screen devices for gameplay use. </brief_description> <description> - Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices. + TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. + This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. + You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. </description> <tutorials> </tutorials> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 26c190bfa9..09dfe56f8f 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -8,9 +8,9 @@ For more information, read the "Matrices and transforms" documentation article. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> + <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> </tutorials> <methods> <method name="Transform"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index f630df7afe..5da88892fe 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -8,7 +8,7 @@ For more information, read the "Matrices and transforms" documentation article. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> + <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link> </tutorials> <methods> <method name="Transform2D"> diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index 11245195bf..d286c6cf0c 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -7,8 +7,8 @@ Translations are resources that can be loaded and unloaded on demand. They map a string to another string. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link> + <link title="Internationalizing games">https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link> + <link title="Locales">https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link> </tutorials> <methods> <method name="add_message"> @@ -18,8 +18,25 @@ </argument> <argument index="1" name="xlated_message" type="StringName"> </argument> + <argument index="2" name="context" type="StringName" default=""""> + </argument> <description> Adds a message if nonexistent, followed by its translation. + An additional context could be used to specify the translation context or differentiate polysemic words. + </description> + </method> + <method name="add_plural_message"> + <return type="void"> + </return> + <argument index="0" name="src_message" type="StringName"> + </argument> + <argument index="1" name="xlated_messages" type="PackedStringArray"> + </argument> + <argument index="2" name="context" type="StringName" default=""""> + </argument> + <description> + Adds a message involving plural translation if nonexistent, followed by its translation. + An additional context could be used to specify the translation context or differentiate polysemic words. </description> </method> <method name="erase_message"> @@ -27,6 +44,8 @@ </return> <argument index="0" name="src_message" type="StringName"> </argument> + <argument index="1" name="context" type="StringName" default=""""> + </argument> <description> Erases a message. </description> @@ -36,6 +55,8 @@ </return> <argument index="0" name="src_message" type="StringName"> </argument> + <argument index="1" name="context" type="StringName" default=""""> + </argument> <description> Returns a message's translation. </description> @@ -54,6 +75,22 @@ Returns all the messages (keys). </description> </method> + <method name="get_plural_message" qualifiers="const"> + <return type="StringName"> + </return> + <argument index="0" name="src_message" type="StringName"> + </argument> + <argument index="1" name="src_plural_message" type="StringName"> + </argument> + <argument index="2" name="n" type="int"> + </argument> + <argument index="3" name="context" type="StringName" default=""""> + </argument> + <description> + Returns a message's translation involving plurals. + The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. + </description> + </method> </methods> <members> <member name="locale" type="String" setter="set_locale" getter="get_locale" default=""en""> diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index aaf7a4d160..664cb3e2e3 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -7,8 +7,8 @@ Server that manages all translations. Translations can be set to it and removed from it. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link> + <link title="Internationalizing games">https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link> + <link title="Locales">https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link> </tutorials> <methods> <method name="add_translation"> @@ -50,6 +50,16 @@ Returns a locale's language and its variant (e.g. [code]"en_US"[/code] would return [code]"English (United States)"[/code]). </description> </method> + <method name="get_translation_object"> + <return type="Translation"> + </return> + <argument index="0" name="locale" type="String"> + </argument> + <description> + Returns the [Translation] instance based on the [code]locale[/code] passed in. + It will return a [code]nullptr[/code] if there is no [Translation] instance that matches the [code]locale[/code]. + </description> + </method> <method name="remove_translation"> <return type="void"> </return> @@ -73,8 +83,26 @@ </return> <argument index="0" name="message" type="StringName"> </argument> + <argument index="1" name="context" type="StringName" default=""""> + </argument> + <description> + Returns the current locale's translation for the given message (key) and context. + </description> + </method> + <method name="translate_plural" qualifiers="const"> + <return type="StringName"> + </return> + <argument index="0" name="message" type="StringName"> + </argument> + <argument index="1" name="plural_message" type="StringName"> + </argument> + <argument index="2" name="n" type="int"> + </argument> + <argument index="3" name="context" type="StringName" default=""""> + </argument> <description> - Returns the current locale's translation for the given message (key). + Returns the current locale's translation for the given message (key), plural_message and context. + The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. </description> </method> </methods> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index 042c8d8e67..cd76689ffe 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -50,7 +50,7 @@ Modifications to a container will modify all references to it. A [Mutex] should be created to lock it if multi-threaded access is desired. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link> + <link title="Variant class">https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 11716f511b..44398cabbf 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -9,7 +9,7 @@ [b]Note:[/b] In a boolean context, a Vector2 will evaluate to [code]false[/code] if it's equal to [code]Vector2(0, 0)[/code]. Otherwise, a Vector2 will always evaluate to [code]true[/code]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Vector2"> @@ -182,7 +182,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the vector is normalized, and false otherwise. + Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise. </description> </method> <method name="length"> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index d03db712fc..3ad926210b 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -9,7 +9,7 @@ [b]Note:[/b] In a boolean context, a Vector2i will evaluate to [code]false[/code] if it's equal to [code]Vector2i(0, 0)[/code]. Otherwise, a Vector2i will always evaluate to [code]true[/code]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Vector2i"> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 776dfd929e..df5d4f150e 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -9,7 +9,7 @@ [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Vector3"> @@ -157,7 +157,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the vector is normalized, and false otherwise. + Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise. </description> </method> <method name="length"> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 94551e1c2f..bd7c354241 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -9,7 +9,7 @@ [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <methods> <method name="Vector3i"> diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index 91c8ad0a77..60f0a40159 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -5,7 +5,7 @@ </brief_description> <description> Control node for playing video streams using [VideoStream] resources. - Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative]. + Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([code].webm[/code], [VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative]. </description> <tutorials> </tutorials> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 3294ab4cc7..e42c4021ab 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -12,8 +12,8 @@ Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link> + <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link title="Viewports tutorial index">https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link> </tutorials> <methods> <method name="find_world_2d" qualifiers="const"> diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index 6451b3f330..01d569d9c8 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -13,7 +13,7 @@ <return type="AABB"> </return> <description> - Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. + Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. See also [method get_transformed_aabb]. </description> </method> <method name="get_base" qualifiers="const"> @@ -44,7 +44,7 @@ </return> <description> Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance3D]. - Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Node3D]'s [Transform]. + Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Node3D]'s [Transform]. See also [method get_aabb]. </description> </method> <method name="set_base"> diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml index 40b0f52469..f03550bd5e 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -193,7 +193,6 @@ </method> </methods> <members> - <member name="code" type="String" setter="set_code" getter="get_code" override="true" default=""shader_type spatial;void vertex() {// Output:0}void fragment() {// Output:0}void light() {// Output:0}"" /> <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2( 0, 0 )"> The offset vector of the whole graph. </member> @@ -210,7 +209,13 @@ <constant name="TYPE_LIGHT" value="2" enum="Type"> A shader for light calculations. </constant> - <constant name="TYPE_MAX" value="3" enum="Type"> + <constant name="TYPE_EMIT" value="3" enum="Type"> + </constant> + <constant name="TYPE_PROCESS" value="4" enum="Type"> + </constant> + <constant name="TYPE_END" value="5" enum="Type"> + </constant> + <constant name="TYPE_MAX" value="6" enum="Type"> Represents the size of the [enum Type] enum. </constant> <constant name="NODE_ID_INVALID" value="-1"> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index 28d13a7d32..3bb527f3d4 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -6,7 +6,7 @@ <description> </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link> + <link title="VisualShaders">https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link> </tutorials> <methods> <method name="get_default_input_values" qualifiers="const"> @@ -57,6 +57,12 @@ Emitted when the node requests an editor refresh. Currently called only in setter of [member VisualShaderNodeTexture.source], [VisualShaderNodeTexture], and [VisualShaderNodeCubemap] (and their derivatives). </description> </signal> + <signal name="show_port_preview"> + <argument index="0" name="port_id" type="int"> + </argument> + <description> + </description> + </signal> </signals> <constants> <constant name="PORT_TYPE_SCALAR" value="0" enum="PortType"> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 5bd8ec38ed..59b501660a 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -5,15 +5,15 @@ </brief_description> <description> By inheriting this class you can create a custom [VisualShader] script addon which will be automatically added to the Visual Shader Editor. The [VisualShaderNode]'s behavior is defined by overriding the provided virtual methods. - In order for the node to be registered as an editor addon, you must use the [code]tool[/code] keyword and provide a [code]class_name[/code] for your custom script. For example: + In order for the node to be registered as an editor addon, you must use the [code]@tool[/code] annotation and provide a [code]class_name[/code] for your custom script. For example: [codeblock] - tool + @tool extends VisualShaderNodeCustom class_name VisualShaderNodeNoise [/codeblock] </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link> + <link title="Visual Shader plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link> </tutorials> <methods> <method name="_get_category" qualifiers="virtual"> diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml index 9261d0088d..8e819b011c 100644 --- a/doc/classes/VisualShaderNodeInput.xml +++ b/doc/classes/VisualShaderNodeInput.xml @@ -7,7 +7,7 @@ Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check [code]Tutorials[/code] section for link). </description> <tutorials> - <link>https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/index.html</link> + <link title="Shading reference index">https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/index.html</link> </tutorials> <methods> <method name="get_input_real_name" qualifiers="const"> diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml index 8e389e0b40..0c83ffffe4 100644 --- a/doc/classes/VisualShaderNodeTexture.xml +++ b/doc/classes/VisualShaderNodeTexture.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeTexture" inherits="VisualShaderNode" version="4.0"> <brief_description> - Performs a texture lookup within the visual shader graph. + Performs a 2D texture lookup within the visual shader graph. </brief_description> <description> Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. diff --git a/doc/classes/VisualShaderNodeTexture3D.xml b/doc/classes/VisualShaderNodeTexture3D.xml new file mode 100644 index 0000000000..17929e823e --- /dev/null +++ b/doc/classes/VisualShaderNodeTexture3D.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTexture3D" inherits="VisualShaderNodeSample3D" version="4.0"> + <brief_description> + Performs a 3D texture lookup within the visual shader graph. + </brief_description> + <description> + Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture"> + A source texture. Used if [member VisualShaderNodeSample3D.source] is set to [constant VisualShaderNodeSample3D.SOURCE_TEXTURE]. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeTexture3DUniform.xml b/doc/classes/VisualShaderNodeTexture3DUniform.xml new file mode 100644 index 0000000000..d9e9acf117 --- /dev/null +++ b/doc/classes/VisualShaderNodeTexture3DUniform.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTexture3DUniform" inherits="VisualShaderNodeTextureUniform" version="4.0"> + <brief_description> + Provides a 3D texture uniform within the visual shader graph. + </brief_description> + <description> + Translated to [code]uniform sampler3D[/code] in the shader language. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml index e66f21a0e7..b0bfd7f418 100644 --- a/doc/classes/World2D.xml +++ b/doc/classes/World2D.xml @@ -7,7 +7,7 @@ Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/World3D.xml b/doc/classes/World3D.xml index 6d3b94794e..d804485d4e 100644 --- a/doc/classes/World3D.xml +++ b/doc/classes/World3D.xml @@ -7,7 +7,7 @@ Class that has everything pertaining to a world. A physics space, a visual scenario and a sound space. Node3D nodes register their resources into the current world. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> + <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index 92b75621c2..f9f0241365 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -9,7 +9,7 @@ The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> + <link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/XRCamera3D.xml b/doc/classes/XRCamera3D.xml index 4d86e24daa..b2682f7a90 100644 --- a/doc/classes/XRCamera3D.xml +++ b/doc/classes/XRCamera3D.xml @@ -8,7 +8,7 @@ The position and orientation of this node is automatically updated by the XR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for rendering as a result. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml index 8e80eb9a32..c0f64d9e27 100644 --- a/doc/classes/XRController3D.xml +++ b/doc/classes/XRController3D.xml @@ -9,7 +9,7 @@ The position of the controller node is automatically updated by the [XRServer]. This makes this node ideal to add child nodes to visualize the controller. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_controller_name" qualifiers="const"> diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index 1985010223..034cb51be3 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -8,7 +8,7 @@ Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through [XRServer]. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_camera_feed_id"> diff --git a/doc/classes/XROrigin3D.xml b/doc/classes/XROrigin3D.xml index 57cf673d30..3e075e99b9 100644 --- a/doc/classes/XROrigin3D.xml +++ b/doc/classes/XROrigin3D.xml @@ -10,7 +10,7 @@ For example, if your character is driving a car, the XROrigin3D node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml index 2f7cc21703..0b57c9478f 100644 --- a/doc/classes/XRPositionalTracker.xml +++ b/doc/classes/XRPositionalTracker.xml @@ -9,7 +9,7 @@ The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_hand" qualifiers="const"> diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index 5e6002aee3..75a05bef17 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -7,7 +7,7 @@ The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> + <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="center_on_hmd"> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index 869fc14d40..ce4d000a9b 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -6,36 +6,87 @@ <description> Boolean is a built-in type. There are two boolean values: [code]true[/code] and [code]false[/code]. You can think of it as an switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like [code]if[/code] statements. Booleans can be directly used in [code]if[/code] statements. The code below demonstrates this on the [code]if can_shoot:[/code] line. You don't need to use [code]== true[/code], you only need [code]if can_shoot:[/code]. Similarly, use [code]if not can_shoot:[/code] rather than [code]== false[/code]. - [codeblock] - var can_shoot = true + [codeblocks] + [gdscript] + var _can_shoot = true func shoot(): - if can_shoot: + if _can_shoot: pass # Perform shooting actions here. - [/codeblock] + [/gdscript] + [csharp] + private bool _canShoot = true; + + public void Shoot() + { + if (_canShoot) + { + // Perform shooting actions here. + } + } + [/csharp] + [/codeblocks] The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if [code]can_shoot[/code] is [code]true[/code]. [b]Note:[/b] [code]Input.is_action_pressed("shoot")[/code] is also a boolean that is [code]true[/code] when "shoot" is pressed and [code]false[/code] when "shoot" isn't pressed. - [codeblock] - var can_shoot = true + [codeblocks] + [gdscript] + var _can_shoot = true func shoot(): - if can_shoot and Input.is_action_pressed("shoot"): + if _can_shoot and Input.is_action_pressed("shoot"): create_bullet() - [/codeblock] + [/gdscript] + [csharp] + private bool _canShoot = true; + + public void Shoot() + { + if (_canShoot && Input.IsActionPressed("shoot")) + { + CreateBullet(); + } + } + [/csharp] + [/codeblocks] The following code will set [code]can_shoot[/code] to [code]false[/code] and start a timer. This will prevent player from shooting until the timer runs out. Next [code]can_shoot[/code] will be set to [code]true[/code] again allowing player to shoot once again. - [codeblock] - var can_shoot = true - onready var cool_down = $CoolDownTimer + [gdscript] + var _can_shoot = true + onready var _cool_down = $CoolDownTimer func shoot(): - if can_shoot and Input.is_action_pressed("shoot"): + if _can_shoot and Input.is_action_pressed("shoot"): create_bullet() - can_shoot = false - cool_down.start() + _can_shoot = false + _cool_down.start() func _on_CoolDownTimer_timeout(): - can_shoot = true - [/codeblock] + _can_shoot = true + [/gdscript] + [csharp] + private bool _canShoot = true; + private Timer _coolDown; + + public override void _Ready() + { + _coolDown = GetNode<Timer>("CoolDownTimer"); + } + + public void Shoot() + { + if (_canShoot && Input.IsActionPressed("shoot")) + { + CreateBullet(); + _canShoot = false; + _coolDown.Start(); + } + } + + public void OnCoolDownTimerTimeout() + { + _canShoot = true; + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> |