summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml212
-rw-r--r--doc/classes/AABB.xml2
-rw-r--r--doc/classes/AStarGrid2D.xml8
-rw-r--r--doc/classes/AnimatedSprite2D.xml102
-rw-r--r--doc/classes/AnimatedSprite3D.xml104
-rw-r--r--doc/classes/AnimationNodeStateMachineTransition.xml2
-rw-r--r--doc/classes/AnimationPlayer.xml29
-rw-r--r--doc/classes/AnimationTree.xml11
-rw-r--r--doc/classes/Array.xml15
-rw-r--r--doc/classes/ArrayMesh.xml1
-rw-r--r--doc/classes/Control.xml13
-rw-r--r--doc/classes/Dictionary.xml14
-rw-r--r--doc/classes/DisplayServer.xml14
-rw-r--r--doc/classes/Image.xml2
-rw-r--r--doc/classes/Input.xml1
-rw-r--r--doc/classes/LineEdit.xml89
-rw-r--r--doc/classes/MultiplayerAPI.xml4
-rw-r--r--doc/classes/Mutex.xml4
-rw-r--r--doc/classes/NavigationAgent2D.xml36
-rw-r--r--doc/classes/NavigationAgent3D.xml36
-rw-r--r--doc/classes/NavigationLink2D.xml10
-rw-r--r--doc/classes/NavigationLink3D.xml10
-rw-r--r--doc/classes/NavigationServer2D.xml22
-rw-r--r--doc/classes/NavigationServer3D.xml22
-rw-r--r--doc/classes/Node.xml2
-rw-r--r--doc/classes/Rect2i.xml6
-rw-r--r--doc/classes/RichTextLabel.xml8
-rw-r--r--doc/classes/Semaphore.xml4
-rw-r--r--doc/classes/String.xml8
-rw-r--r--doc/classes/StringName.xml8
-rw-r--r--doc/classes/StyleBoxTexture.xml1
-rw-r--r--doc/classes/SurfaceTool.xml4
-rw-r--r--doc/classes/SystemFont.xml6
-rw-r--r--doc/classes/TextEdit.xml101
-rw-r--r--doc/classes/TileData.xml2
-rw-r--r--doc/classes/TileMap.xml2
-rw-r--r--doc/classes/TileSet.xml17
-rw-r--r--doc/classes/Viewport.xml3
-rw-r--r--doc/classes/VisualShaderNodeDerivativeFunc.xml15
39 files changed, 707 insertions, 243 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 4fdb7d82c5..485c04da6d 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -442,9 +442,14 @@
<param index="0" name="variable" type="Variant" />
<description>
Returns the integer hash of the passed [param variable].
- [codeblock]
+ [codeblocks]
+ [gdscript]
print(hash("a")) # Prints 177670
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Print(GD.Hash("a")); // Prints 177670
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="instance_from_id">
@@ -452,13 +457,29 @@
<param index="0" name="instance_id" type="int" />
<description>
Returns the [Object] that corresponds to [param instance_id]. All Objects have a unique instance ID. See also [method Object.get_instance_id].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var foo = "bar"
+
func _ready():
var id = get_instance_id()
var inst = instance_from_id(id)
print(inst.foo) # Prints bar
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public partial class MyNode : Node
+ {
+ public string Foo { get; set; } = "bar";
+
+ public override void _Ready()
+ {
+ ulong id = GetInstanceId();
+ var inst = (MyNode)InstanceFromId(Id);
+ GD.Print(inst.Foo); // Prints bar
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="inverse_lerp">
@@ -525,6 +546,31 @@
Returns [code]true[/code] if [param x] is a NaN ("Not a Number" or invalid) value.
</description>
</method>
+ <method name="is_same">
+ <return type="bool" />
+ <param index="0" name="a" type="Variant" />
+ <param index="1" name="b" type="Variant" />
+ <description>
+ Returns [code]true[/code], for value types, if [param a] and [param b] share the same value. Returns [code]true[/code], for reference types, if the references of [param a] and [param b] are the same.
+ [codeblock]
+ # Vector2 is a value type
+ var vec2_a = Vector2(0, 0)
+ var vec2_b = Vector2(0, 0)
+ var vec2_c = Vector2(1, 1)
+ is_same(vec2_a, vec2_a) # true
+ is_same(vec2_a, vec2_b) # true
+ is_same(vec2_a, vec2_c) # false
+
+ # Array is a reference type
+ var arr_a = []
+ var arr_b = []
+ is_same(arr_a, arr_a) # true
+ is_same(arr_a, arr_b) # false
+ [/codeblock]
+ These are [Variant] value types: [code]null[/code], [bool], [int], [float], [String], [StringName], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], [Vector4i], [Rect2], [Rect2i], [Transform2D], [Transform3D], [Plane], [Quaternion], [AABB], [Basis], [Projection], [Color], [NodePath], [RID], [Callable] and [Signal].
+ These are [Variant] reference types: [Object], [Dictionary], [Array], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], [PackedFloat32Array], [PackedFloat64Array], [PackedStringArray], [PackedVector2Array], [PackedVector3Array] and [PackedColorArray].
+ </description>
+ </method>
<method name="is_zero_approx">
<return type="bool" />
<param index="0" name="x" type="float" />
@@ -764,10 +810,16 @@
<method name="print" qualifiers="vararg">
<description>
Converts one or more arguments of any type to string in the best way possible and prints them to the console.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var a = [1, 2, 3]
print("a", "b", a) # Prints ab[1, 2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var a = new Godot.Collections.Array { 1, 2, 3 };
+ GD.Print("a", "b", a); // Prints ab[1, 2, 3]
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
</description>
</method>
@@ -775,9 +827,14 @@
<description>
Converts one or more arguments of any type to string in the best way possible and prints them to the console. The following BBCode tags are supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, fgcolor. Color tags only support named colors such as [code]red[/code], [i]not[/i] hexadecimal color codes. Unsupported tags will be left as-is in standard output.
When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Displaying ANSI escape codes is currently only supported on Linux and macOS. Support for ANSI escape codes may vary across terminal emulators, especially for italic and strikethrough.
- [codeblock]
+ [codeblocks]
+ [gdscript]
print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PrintRich("[code][b]Hello world![/b][/code]"); // Prints out: [b]Hello world![/b]
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
</description>
</method>
@@ -789,53 +846,86 @@
<method name="printerr" qualifiers="vararg">
<description>
Prints one or more arguments to strings in the best way possible to standard error line.
- [codeblock]
+ [codeblocks]
+ [gdscript]
printerr("prints to stderr")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PrintErr("prints to stderr");
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="printraw" qualifiers="vararg">
<description>
Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike [method print], no newline is automatically added at the end.
- [codeblock]
+ [codeblocks]
+ [gdscript]
printraw("A")
printraw("B")
printraw("C")
# Prints ABC to terminal
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PrintRaw("A");
+ GD.PrintRaw("B");
+ GD.PrintRaw("C");
+ // Prints ABC to terminal
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="prints" qualifiers="vararg">
<description>
Prints one or more arguments to the console with a space between each argument.
- [codeblock]
+ [codeblocks]
+ [gdscript]
prints("A", "B", "C") # Prints A B C
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PrintS("A", "B", "C"); // Prints A B C
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="printt" qualifiers="vararg">
<description>
Prints one or more arguments to the console with a tab between each argument.
- [codeblock]
+ [codeblocks]
+ [gdscript]
printt("A", "B", "C") # Prints A B C
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PrintT("A", "B", "C"); // Prints A B C
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="push_error" qualifiers="vararg">
<description>
Pushes an error message to Godot's built-in debugger and to the OS terminal.
- [codeblock]
+ [codeblocks]
+ [gdscript]
push_error("test error") # Prints "test error" to debugger and terminal as error call
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PushError("test error"); // Prints "test error" to debugger and terminal as error call
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] This function does not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead.
</description>
</method>
<method name="push_warning" qualifiers="vararg">
<description>
Pushes a warning message to Godot's built-in debugger and to the OS terminal.
- [codeblock]
+ [codeblocks]
+ [gdscript]
push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.PushWarning("test warning"); // Prints "test warning" to debugger and terminal as warning call
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="rad_to_deg">
@@ -868,9 +958,14 @@
<return type="float" />
<description>
Returns a random floating point value between [code]0.0[/code] and [code]1.0[/code] (inclusive).
- [codeblock]
+ [codeblocks]
+ [gdscript]
randf() # Returns e.g. 0.375671
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Randf(); // Returns e.g. 0.375671
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="randf_range">
@@ -879,10 +974,16 @@
<param index="1" name="to" type="float" />
<description>
Returns a random floating point value between [param from] and [param to] (inclusive).
- [codeblock]
+ [codeblocks]
+ [gdscript]
randf_range(0, 20.5) # Returns e.g. 7.45315
randf_range(-10, 10) # Returns e.g. -3.844535
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.RandRange(0.0, 20.5); // Returns e.g. 7.45315
+ GD.RandRange(-10.0, 10.0); // Returns e.g. -3.844535
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="randfn">
@@ -897,12 +998,20 @@
<return type="int" />
<description>
Returns a random unsigned 32-bit integer. Use remainder to obtain a random value in the interval [code][0, N - 1][/code] (where N is smaller than 2^32).
- [codeblock]
+ [codeblocks]
+ [gdscript]
randi() # Returns random integer between 0 and 2^32 - 1
randi() % 20 # Returns random integer between 0 and 19
randi() % 100 # Returns random integer between 0 and 99
randi() % 100 + 1 # Returns random integer between 1 and 100
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Randi(); // Returns random integer between 0 and 2^32 - 1
+ GD.Randi() % 20; // Returns random integer between 0 and 19
+ GD.Randi() % 100; // Returns random integer between 0 and 99
+ GD.Randi() % 100 + 1; // Returns random integer between 1 and 100
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="randi_range">
@@ -911,10 +1020,16 @@
<param index="1" name="to" type="int" />
<description>
Returns a random signed 32-bit integer between [param from] and [param to] (inclusive). If [param to] is lesser than [param from], they are swapped.
- [codeblock]
+ [codeblocks]
+ [gdscript]
randi_range(0, 1) # Returns either 0 or 1
randi_range(-10, 1000) # Returns random integer between -10 and 1000
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.RandRange(0, 1); // Returns either 0 or 1
+ GD.RandRange(-10, 1000); // Returns random integer between -10 and 1000
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="randomize">
@@ -985,14 +1100,24 @@
<param index="0" name="base" type="int" />
<description>
Sets the seed for the random number generator to [param base]. Setting the seed manually can ensure consistent, repeatable results for most random functions.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var my_seed = "Godot Rocks".hash()
seed(my_seed)
var a = randf() + randi()
seed(my_seed)
var b = randf() + randi()
# a and b are now identical
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ ulong mySeed = (ulong)GD.Hash("Godot Rocks");
+ GD.Seed(mySeed);
+ var a = GD.Randf() + GD.Randi();
+ GD.Seed(mySeed);
+ var b = GD.Randf() + GD.Randi();
+ // a and b are now identical
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="sign">
@@ -1154,11 +1279,18 @@
<param index="0" name="string" type="String" />
<description>
Converts a formatted [param string] that was returned by [method var_to_str] to the original [Variant].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var a = '{ "a": 1, "b": 2 }' # a is a String
var b = str_to_var(a) # b is a Dictionary
print(b["a"]) # Prints 1
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ string a = "{ \"a\": 1, \"b\": 2 }"; // a is a string
+ var b = GD.StrToVar(a).AsGodotDictionary(); // b is a Dictionary
+ GD.Print(b["a"]); // Prints 1
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="tan">
@@ -1218,15 +1350,21 @@
<param index="0" name="variable" type="Variant" />
<description>
Converts a [Variant] [param variable] to a formatted [String] that can then be parsed using [method str_to_var].
- [codeblock]
- a = { "a": 1, "b": 2 }
+ [codeblocks]
+ [gdscript]
+ var a = { "a": 1, "b": 2 }
print(var_to_str(a))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var a = new Godot.Collections.Dictionary { ["a"] = 1, ["b"] = 2 };
+ GD.Print(GD.VarToStr(a));
+ [/csharp]
+ [/codeblocks]
Prints:
[codeblock]
{
- "a": 1,
- "b": 2
+ "a": 1,
+ "b": 2
}
[/codeblock]
</description>
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index ca454cafa3..2c5337eea3 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -66,7 +66,7 @@
[/gdscript]
[csharp]
// position (-3, 2, 0), size (1, 1, 1)
- var box = new AABB(new Vector3(-3, 2, 0), new Vector3(1, 1, 1));
+ var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1));
// position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2)
var box2 = box.Expand(new Vector3(0, -1, 2));
[/csharp]
diff --git a/doc/classes/AStarGrid2D.xml b/doc/classes/AStarGrid2D.xml
index 32599d7f7d..b253a33377 100644
--- a/doc/classes/AStarGrid2D.xml
+++ b/doc/classes/AStarGrid2D.xml
@@ -17,11 +17,11 @@
[/gdscript]
[csharp]
AStarGrid2D astarGrid = new AStarGrid2D();
- astarGrid.Size = new Vector2i(32, 32);
- astarGrid.CellSize = new Vector2i(16, 16);
+ astarGrid.Size = new Vector2I(32, 32);
+ astarGrid.CellSize = new Vector2I(16, 16);
astarGrid.Update();
- GD.Print(astarGrid.GetIdPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
- GD.Print(astarGrid.GetPointPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
+ GD.Print(astarGrid.GetIdPath(Vector2I.Zero, new Vector2I(3, 4))); // prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
+ GD.Print(astarGrid.GetPointPath(Vector2I.Zero, new Vector2I(3, 4))); // prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
[/csharp]
[/codeblocks]
</description>
diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml
index cd9c0cee98..9872c59990 100644
--- a/doc/classes/AnimatedSprite2D.xml
+++ b/doc/classes/AnimatedSprite2D.xml
@@ -5,34 +5,82 @@
</brief_description>
<description>
[AnimatedSprite2D] is similar to the [Sprite2D] node, except it carries multiple textures as animation frames. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel.
- After setting up [member frames], [method play] may be called. It's also possible to select an [member animation] and toggle [member playing], even within the editor.
- To pause the current animation, set [member playing] to [code]false[/code]. Alternatively, setting [member speed_scale] to [code]0[/code] also preserves the current frame's elapsed time.
</description>
<tutorials>
<link title="2D Sprite animation">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link>
<link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
+ <method name="get_playing_speed" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method.
+ Returns a negative value if the current animation is playing backwards.
+ </description>
+ </method>
+ <method name="is_playing" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]).
+ </description>
+ </method>
+ <method name="pause">
+ <return type="void" />
+ <description>
+ Pauses the currently playing animation. The [member frame] and [member frame_progress] will be kept and calling [method play] or [method play_backwards] without arguments will resume the animation from the current playback position.
+ See also [method stop].
+ </description>
+ </method>
<method name="play">
<return type="void" />
- <param index="0" name="anim" type="StringName" default="&amp;&quot;&quot;" />
- <param index="1" name="backwards" type="bool" default="false" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="custom_speed" type="float" default="1.0" />
+ <param index="2" name="from_end" type="bool" default="false" />
+ <description>
+ Plays the animation with key [param name]. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]).
+ If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused.
+ </description>
+ </method>
+ <method name="play_backwards">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <description>
+ Plays the animation with key [param name] in reverse.
+ This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
+ </description>
+ </method>
+ <method name="set_frame_and_progress">
+ <return type="void" />
+ <param index="0" name="frame" type="int" />
+ <param index="1" name="progress" type="float" />
<description>
- Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. If [param backwards] is [code]true[/code], the animation is played in reverse.
- [b]Note:[/b] If [member speed_scale] is negative, the animation direction specified by [param backwards] will be inverted.
+ The setter of [member frame] resets the [member frame_progress] to [code]0.0[/code] implicitly, but this method avoids that.
+ This is useful when you want to carry over the current [member frame_progress] to another [member frame].
+ [b]Example:[/b]
+ [codeblocks]
+ [gdscript]
+ # Change the animation with keeping the frame index and progress.
+ var current_frame = animated_sprite.get_frame()
+ var current_progress = animated_sprite.get_frame_progress()
+ animated_sprite.play("walk_another_skin")
+ animated_sprite.set_frame_and_progress(current_frame, current_progress)
+ [/gdscript]
+ [/codeblocks]
</description>
</method>
<method name="stop">
<return type="void" />
<description>
- Stops the current [member animation] at the current [member frame].
- [b]Note:[/b] This method resets the current frame's elapsed time and removes the [code]backwards[/code] flag from the current [member animation] (if it was previously set by [method play]). If this behavior is undesired, set [member playing] to [code]false[/code] instead.
+ Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause].
</description>
</method>
</methods>
<members>
<member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&amp;&quot;default&quot;">
- The current animation from the [member frames] resource. If this value changes, the [code]frame[/code] counter is reset.
+ The current animation from the [member sprite_frames] resource. If this value is changed, the [member frame] counter and the [member frame_progress] are reset.
+ </member>
+ <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay" default="&quot;&quot;">
+ The key of the animation to play when the scene loads.
</member>
<member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true">
If [code]true[/code], texture will be centered.
@@ -44,32 +92,46 @@
If [code]true[/code], texture is flipped vertically.
</member>
<member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
- The displayed animation frame's index.
+ The displayed animation frame's index. Setting this property also resets [member frame_progress]. If this is not desired, use [method set_frame_and_progress].
</member>
- <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
- The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [SpriteFrames] resource.
+ <member name="frame_progress" type="float" setter="set_frame_progress" getter="get_frame_progress" default="0.0">
+ The progress value between [code]0.0[/code] and [code]1.0[/code] until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from [code]1.0[/code] to [code]0.0[/code].
</member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)">
The texture's drawing offset.
</member>
- <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false">
- If [code]true[/code], the [member animation] is currently playing. Setting this property to [code]false[/code] pauses the current animation. Use [method stop] to stop the animation at the current frame instead.
- [b]Note:[/b] Unlike [method stop], changing this property to [code]false[/code] preserves the current frame's elapsed time and the [code]backwards[/code] flag of the current [member animation] (if it was previously set by [method play]).
- [b]Note:[/b] After a non-looping animation finishes, the property still remains [code]true[/code].
- </member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
- The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation is paused, preserving the current frame's elapsed time.
+ The speed scaling ratio. For example, if this value is [code]1[/code], then the animation plays at normal speed. If it's [code]0.5[/code], then it plays at half speed. If it's [code]2[/code], then it plays at double speed.
+ If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation will not advance.
+ </member>
+ <member name="sprite_frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
+ The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [SpriteFrames] resource.
</member>
</members>
<signals>
+ <signal name="animation_changed">
+ <description>
+ Emitted when [member animation] changes.
+ </description>
+ </signal>
<signal name="animation_finished">
<description>
- Emitted when the animation reaches the end, or the start if it is played in reverse. If the animation is looping, this signal is emitted at the end of each loop.
+ Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback.
+ </description>
+ </signal>
+ <signal name="animation_looped">
+ <description>
+ Emitted when the animation loops.
</description>
</signal>
<signal name="frame_changed">
<description>
- Emitted when [member frame] changed.
+ Emitted when [member frame] changes.
+ </description>
+ </signal>
+ <signal name="sprite_frames_changed">
+ <description>
+ Emitted when [member sprite_frames] changes.
</description>
</signal>
</signals>
diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml
index 4837ae715f..c39bb99827 100644
--- a/doc/classes/AnimatedSprite3D.xml
+++ b/doc/classes/AnimatedSprite3D.xml
@@ -4,59 +4,121 @@
2D sprite node in 3D world, that can use multiple 2D textures for animation.
</brief_description>
<description>
- [AnimatedSprite3D] is similar to the [Sprite3D] node, except it carries multiple textures as animation [member frames]. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel.
- After setting up [member frames], [method play] may be called. It's also possible to select an [member animation] and toggle [member playing], even within the editor.
- To pause the current animation, set [member playing] to [code]false[/code]. Alternatively, setting [member speed_scale] to [code]0[/code] also preserves the current frame's elapsed time.
+ [AnimatedSprite3D] is similar to the [Sprite3D] node, except it carries multiple textures as animation [member sprite_frames]. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel.
</description>
<tutorials>
<link title="2D Sprite animation (also applies to 3D)">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link>
</tutorials>
<methods>
+ <method name="get_playing_speed" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method.
+ Returns a negative value if the current animation is playing backwards.
+ </description>
+ </method>
+ <method name="is_playing" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]).
+ </description>
+ </method>
+ <method name="pause">
+ <return type="void" />
+ <description>
+ Pauses the currently playing animation. The [member frame] and [member frame_progress] will be kept and calling [method play] or [method play_backwards] without arguments will resume the animation from the current playback position.
+ See also [method stop].
+ </description>
+ </method>
<method name="play">
<return type="void" />
- <param index="0" name="anim" type="StringName" default="&amp;&quot;&quot;" />
- <param index="1" name="backwards" type="bool" default="false" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="custom_speed" type="float" default="1.0" />
+ <param index="2" name="from_end" type="bool" default="false" />
+ <description>
+ Plays the animation with key [param name]. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]).
+ If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused.
+ </description>
+ </method>
+ <method name="play_backwards">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <description>
+ Plays the animation with key [param name] in reverse.
+ This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
+ </description>
+ </method>
+ <method name="set_frame_and_progress">
+ <return type="void" />
+ <param index="0" name="frame" type="int" />
+ <param index="1" name="progress" type="float" />
<description>
- Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. If [param backwards] is [code]true[/code], the animation is played in reverse.
- [b]Note:[/b] If [member speed_scale] is negative, the animation direction specified by [param backwards] will be inverted.
+ The setter of [member frame] resets the [member frame_progress] to [code]0.0[/code] implicitly, but this method avoids that.
+ This is useful when you want to carry over the current [member frame_progress] to another [member frame].
+ [b]Example:[/b]
+ [codeblocks]
+ [gdscript]
+ # Change the animation with keeping the frame index and progress.
+ var current_frame = animated_sprite.get_frame()
+ var current_progress = animated_sprite.get_frame_progress()
+ animated_sprite.play("walk_another_skin")
+ animated_sprite.set_frame_and_progress(current_frame, current_progress)
+ [/gdscript]
+ [/codeblocks]
</description>
</method>
<method name="stop">
<return type="void" />
<description>
- Stops the current [member animation] at the current [member frame].
- [b]Note:[/b] This method resets the current frame's elapsed time and removes the [code]backwards[/code] flag from the current [member animation] (if it was previously set by [method play]). If this behavior is undesired, set [member playing] to [code]false[/code] instead.
+ Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause].
</description>
</method>
</methods>
<members>
<member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&amp;&quot;default&quot;">
- The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset.
+ The current animation from the [member sprite_frames] resource. If this value is changed, the [member frame] counter and the [member frame_progress] are reset.
</member>
- <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
- The displayed animation frame's index.
+ <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay" default="&quot;&quot;">
+ The key of the animation to play when the scene loads.
</member>
- <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
- The [SpriteFrames] resource containing the animation(s).
+ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
+ The displayed animation frame's index. Setting this property also resets [member frame_progress]. If this is not desired, use [method set_frame_and_progress].
</member>
- <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false">
- If [code]true[/code], the [member animation] is currently playing. Setting this property to [code]false[/code] pauses the current animation. Use [method stop] to stop the animation at the current frame instead.
- [b]Note:[/b] Unlike [method stop], changing this property to [code]false[/code] preserves the current frame's elapsed time and the [code]backwards[/code] flag of the current [member animation] (if it was previously set by [method play]).
- [b]Note:[/b] After a non-looping animation finishes, the property still remains [code]true[/code].
+ <member name="frame_progress" type="float" setter="set_frame_progress" getter="get_frame_progress" default="0.0">
+ The progress value between [code]0.0[/code] and [code]1.0[/code] until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from [code]1.0[/code] to [code]0.0[/code].
</member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
- The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation is paused, preserving the current frame's elapsed time.
+ The speed scaling ratio. For example, if this value is [code]1[/code], then the animation plays at normal speed. If it's [code]0.5[/code], then it plays at half speed. If it's [code]2[/code], then it plays at double speed.
+ If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation will not advance.
+ </member>
+ <member name="sprite_frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
+ The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [SpriteFrames] resource.
</member>
</members>
<signals>
+ <signal name="animation_changed">
+ <description>
+ Emitted when [member animation] changes.
+ </description>
+ </signal>
<signal name="animation_finished">
<description>
- Emitted when the animation reaches the end, or the start if it is played in reverse. If the animation is looping, this signal is emitted at the end of each loop.
+ Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback.
+ </description>
+ </signal>
+ <signal name="animation_looped">
+ <description>
+ Emitted when the animation loops.
</description>
</signal>
<signal name="frame_changed">
<description>
- Emitted when [member frame] changed.
+ Emitted when [member frame] changes.
+ </description>
+ </signal>
+ <signal name="sprite_frames_changed">
+ <description>
+ Emitted when [member sprite_frames] changes.
</description>
</signal>
</signals>
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml
index eee25fad7c..bccab4613a 100644
--- a/doc/classes/AnimationNodeStateMachineTransition.xml
+++ b/doc/classes/AnimationNodeStateMachineTransition.xml
@@ -15,7 +15,7 @@
$animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
[/gdscript]
[csharp]
- GetNode&lt;AnimationTree&gt;("animation_tree").Set("parameters/conditions/idle", IsOnFloor &amp;&amp; (LinearVelocity.x == 0));
+ GetNode&lt;AnimationTree&gt;("animation_tree").Set("parameters/conditions/idle", IsOnFloor &amp;&amp; (LinearVelocity.X == 0));
[/csharp]
[/codeblocks]
</member>
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 304caeef43..8982eeedb2 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -15,6 +15,17 @@
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
+ <method name="_post_process_key_value" qualifiers="virtual const">
+ <return type="Variant" />
+ <param index="0" name="animation" type="Animation" />
+ <param index="1" name="track" type="int" />
+ <param index="2" name="value" type="Variant" />
+ <param index="3" name="object" type="Object" />
+ <param index="4" name="object_idx" type="int" />
+ <description>
+ A virtual function for processing after key getting during playback.
+ </description>
+ </method>
<method name="add_animation_library">
<return type="int" enum="Error" />
<param index="0" name="name" type="StringName" />
@@ -102,13 +113,14 @@
<param index="0" name="anim_from" type="StringName" />
<param index="1" name="anim_to" type="StringName" />
<description>
- Gets the blend time (in seconds) between two animations, referenced by their keys.
+ Returns the blend time (in seconds) between two animations, referenced by their keys.
</description>
</method>
<method name="get_playing_speed" qualifiers="const">
<return type="float" />
<description>
- Gets the actual playing speed of current animation or 0 if not playing. This speed is the [member playback_speed] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method.
+ Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method.
+ Returns a negative value if the current animation is playing backwards.
</description>
</method>
<method name="get_queue">
@@ -134,7 +146,7 @@
<method name="is_playing" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if playing an animation.
+ Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]).
</description>
</method>
<method name="pause">
@@ -152,7 +164,7 @@
<param index="3" name="from_end" type="bool" default="false" />
<description>
Plays the animation with key [param name]. Custom blend times and speed can be set. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]).
- The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [method stop] for both pause and stop). If the animation was already playing, it will keep playing.
+ The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused.
[b]Note:[/b] The animation will be updated the next time the [AnimationPlayer] is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call [code]advance(0)[/code].
</description>
</method>
@@ -210,7 +222,7 @@
<return type="void" />
<param index="0" name="keep_state" type="bool" default="false" />
<description>
- Stops the currently playing animation. The animation position is reset to [code]0[/code] and the playback speed is reset to [code]1.0[/code]. See also [method pause].
+ Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause].
If [param keep_state] is [code]true[/code], the animation state is not updated visually.
[b]Note:[/b] The method / audio / animation playback tracks will not be processed by this method.
</description>
@@ -249,9 +261,6 @@
<member name="playback_process_mode" type="int" setter="set_process_callback" getter="get_process_callback" enum="AnimationPlayer.AnimationProcessCallback" default="1">
The process notification in which to update animations.
</member>
- <member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
- The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed.
- </member>
<member name="reset_on_save" type="bool" setter="set_reset_on_save_enabled" getter="is_reset_on_save_enabled" default="true">
This is used by the editor. If set to [code]true[/code], the scene will be saved with the effects of the reset animation (the animation with the key [code]"RESET"[/code]) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving.
This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation.
@@ -259,6 +268,10 @@
<member name="root_node" type="NodePath" setter="set_root" getter="get_root" default="NodePath(&quot;..&quot;)">
The node from which node path references will travel.
</member>
+ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
+ The speed scaling ratio. For example, if this value is [code]1[/code], then the animation plays at normal speed. If it's [code]0.5[/code], then it plays at half speed. If it's [code]2[/code], then it plays at double speed.
+ If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation will not advance.
+ </member>
</members>
<signals>
<signal name="animation_changed">
diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml
index 49bc4ee6af..3a3e8bb1fa 100644
--- a/doc/classes/AnimationTree.xml
+++ b/doc/classes/AnimationTree.xml
@@ -12,6 +12,17 @@
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
+ <method name="_post_process_key_value" qualifiers="virtual const">
+ <return type="Variant" />
+ <param index="0" name="animation" type="Animation" />
+ <param index="1" name="track" type="int" />
+ <param index="2" name="value" type="Variant" />
+ <param index="3" name="object" type="Object" />
+ <param index="4" name="object_idx" type="int" />
+ <description>
+ A virtual function for processing after key getting during playback.
+ </description>
+ </method>
<method name="advance">
<return type="void" />
<param index="0" name="delta" type="float" />
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index ce4d7693d8..1ac1c0745e 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -392,7 +392,7 @@
<method name="is_read_only" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the array is read-only. See [method set_read_only]. Arrays are automatically read-only if declared with [code]const[/code] keyword.
+ Returns [code]true[/code] if the array is read-only. See [method make_read_only]. Arrays are automatically read-only if declared with [code]const[/code] keyword.
</description>
</method>
<method name="is_typed" qualifiers="const">
@@ -401,6 +401,12 @@
Returns [code]true[/code] if the array is typed. Typed arrays can only store elements of their associated type and provide type safety for the [code][][/code] operator. Methods of typed array still return [Variant].
</description>
</method>
+ <method name="make_read_only">
+ <return type="void" />
+ <description>
+ Makes the array read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays.
+ </description>
+ </method>
<method name="map" qualifiers="const">
<return type="Array" />
<param index="0" name="method" type="Callable" />
@@ -524,13 +530,6 @@
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
</description>
</method>
- <method name="set_read_only">
- <return type="void" />
- <param index="0" name="enable" type="bool" />
- <description>
- Makes the [Array] read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays.
- </description>
- </method>
<method name="set_typed">
<return type="void" />
<param index="0" name="type" type="int" />
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 7b86afcc4c..6dc66194b8 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -206,6 +206,7 @@
Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
</member>
<member name="shadow_mesh" type="ArrayMesh" setter="set_shadow_mesh" getter="get_shadow_mesh">
+ An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can be used to increase performance of shadow rendering by using a mesh that only contains vertex position data (without normals, UVs, colors, etc.).
</member>
</members>
</class>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 7082eff97d..0d675112b8 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -383,7 +383,9 @@
<method name="get_global_rect" qualifiers="const">
<return type="Rect2" />
<description>
- Returns the position and size of the control relative to the [CanvasLayer]. See [member global_position] and [member size].
+ Returns the position and size of the control relative to the containing canvas. See [member global_position] and [member size].
+ [b]Note:[/b] If the node itself or any parent [CanvasItem] between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.
+ [b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2].
</description>
</method>
<method name="get_minimum_size" qualifiers="const">
@@ -414,7 +416,9 @@
<method name="get_rect" qualifiers="const">
<return type="Rect2" />
<description>
- Returns the position and size of the control relative to the top-left corner of the parent Control. See [member position] and [member size].
+ Returns the position and size of the control in the coordinate system of the containing node. See [member position], [member scale] and [member size].
+ [b]Note:[/b] If [member rotation] is not the default rotation, the resulting size is not meaningful.
+ [b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2].
</description>
</method>
<method name="get_screen_position" qualifiers="const">
@@ -895,6 +899,7 @@
<param index="0" name="position" type="Vector2" />
<description>
Moves the mouse cursor to [param position], relative to [member position] of this [Control].
+ [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
</description>
</method>
</methods>
@@ -991,7 +996,7 @@
By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot. Set this property to [member size] / 2 to pivot around the Control's center.
</member>
<member name="position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)">
- The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset].
+ The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset].
</member>
<member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0">
The node's rotation around its pivot, in radians. See [member pivot_offset] to change the pivot's position.
@@ -1008,7 +1013,7 @@
The [Node] which must be a parent of the focused [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.
</member>
<member name="size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)">
- The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
+ The size of the node's bounding rectangle, in the node's coordinate system. [Container] nodes update this property automatically.
</member>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" enum="Control.SizeFlags" default="1">
Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 5f99ba82b8..ea0bcc5cbb 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -42,7 +42,7 @@
You can access a dictionary's value by referencing its corresponding key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
[codeblocks]
[gdscript]
- @export(String, "White", "Yellow", "Orange") var my_color
+ @export_enum("White", "Yellow", "Orange") var my_color: String
var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
func _ready():
# We can't use dot syntax here as `my_color` is a variable.
@@ -271,12 +271,24 @@
Returns [code]true[/code] if the dictionary is empty (its size is [code]0[/code]). See also [method size].
</description>
</method>
+ <method name="is_read_only" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the dictionary is read-only. See [method make_read_only]. Dictionaries are automatically read-only if declared with [code]const[/code] keyword.
+ </description>
+ </method>
<method name="keys" qualifiers="const">
<return type="Array" />
<description>
Returns the list of keys in the dictionary.
</description>
</method>
+ <method name="make_read_only">
+ <return type="void" />
+ <description>
+ Makes the dictionary read-only, i.e. disabled modifying of the dictionary's contents. Does not apply to nested content, e.g. content of nested dicitonaries.
+ </description>
+ </method>
<method name="merge">
<return type="void" />
<param index="0" name="dictionary" type="Dictionary" />
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index b77ec4c517..6f4a7fc13d 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -190,6 +190,7 @@
<description>
Adds a new checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -211,6 +212,7 @@
<description>
Adds a new checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -232,6 +234,7 @@
<description>
Adds a new item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -254,6 +257,7 @@
Adds a new radio-checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -274,6 +278,7 @@
<description>
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -285,7 +290,7 @@
<method name="global_menu_add_multistate_item">
<return type="int" />
<param index="0" name="menu_root" type="String" />
- <param index="1" name="labe" type="String" />
+ <param index="1" name="label" type="String" />
<param index="2" name="max_states" type="int" />
<param index="3" name="default_state" type="int" />
<param index="4" name="callback" type="Callable" />
@@ -294,10 +299,11 @@
<param index="7" name="accelerator" type="int" enum="Key" default="0" />
<param index="8" name="index" type="int" default="-1" />
<description>
- Adds a new item with text [param labe] to the global menu with ID [param menu_root].
+ Adds a new item with text [param label] to the global menu with ID [param menu_root].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. Each press or activate of the item will increase the state by one. The default value is defined by [param default_state].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] By default, there's no indication of the current item state, it should be changed manually.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -319,6 +325,7 @@
Adds a new radio-checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
+ [b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
@@ -562,6 +569,7 @@
<param index="2" name="callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when an item is pressed.
+ [b]Note:[/b] The [param callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -623,6 +631,7 @@
<param index="2" name="key_callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when its accelerator is activated.
+ [b]Note:[/b] The [param key_callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -1090,6 +1099,7 @@
<param index="0" name="position" type="Vector2i" />
<description>
Sets the mouse cursor position to the given [param position] relative to an origin at the upper left corner of the currently focused game Window Manager window.
+ [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
</description>
</method>
<method name="window_can_draw" qualifiers="const">
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 051e087611..b13564cfef 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -525,7 +525,7 @@
var img = new Image();
img.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
- img.SetPixelv(new Vector2i(1, 2), Colors.Red); // Sets the color at (1, 2) to red.
+ img.SetPixelv(new Vector2I(1, 2), Colors.Red); // Sets the color at (1, 2) to red.
[/csharp]
[/codeblocks]
This is the same as [method set_pixel], but with a [Vector2i] argument instead of two integer arguments.
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index 3b0cfb3825..70e629974d 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -375,6 +375,7 @@
<description>
Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the currently focused Window Manager game window.
Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if [enum MouseMode] is set to [constant MOUSE_MODE_CONFINED] or [constant MOUSE_MODE_CONFINED_HIDDEN].
+ [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
</description>
</method>
</methods>
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index b8383aaed9..8ed8622030 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -61,6 +61,45 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
+ You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example:
+ [codeblocks]
+ [gdscript]
+ func _ready():
+ var menu = get_menu()
+ # Remove all items after "Redo".
+ menu.item_count = menu.get_item_index(MENU_REDO) + 1
+ # Add custom items.
+ menu.add_separator()
+ menu.add_item("Insert Date", MENU_MAX + 1)
+ # Connect callback.
+ menu.id_pressed.connect(_on_item_pressed)
+
+ func _on_item_pressed(id):
+ if id == MENU_MAX + 1:
+ insert_text_at_caret(Time.get_date_string_from_system())
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var menu = GetMenu();
+ // Remove all items after "Redo".
+ menu.ItemCount = menu.GetItemIndex(LineEdit.MenuItems.Redo) + 1;
+ // Add custom items.
+ menu.AddSeparator();
+ menu.AddItem("Insert Date", LineEdit.MenuItems.Max + 1);
+ // Add event handler.
+ menu.IdPressed += OnItemPressed;
+ }
+
+ public void OnItemPressed(int id)
+ {
+ if (id == LineEdit.MenuItems.Max + 1)
+ {
+ InsertTextAtCaret(Time.GetDateStringFromSystem());
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
@@ -296,70 +335,76 @@
<constant name="MENU_REDO" value="6" enum="MenuItems">
Reverse the last undo action.
</constant>
- <constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
+ <constant name="MENU_SUBMENU_TEXT_DIR" value="7" enum="MenuItems">
+ ID of "Text Writing Direction" submenu.
+ </constant>
+ <constant name="MENU_DIR_INHERITED" value="8" enum="MenuItems">
Sets text direction to inherited.
</constant>
- <constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
+ <constant name="MENU_DIR_AUTO" value="9" enum="MenuItems">
Sets text direction to automatic.
</constant>
- <constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
+ <constant name="MENU_DIR_LTR" value="10" enum="MenuItems">
Sets text direction to left-to-right.
</constant>
- <constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
+ <constant name="MENU_DIR_RTL" value="11" enum="MenuItems">
Sets text direction to right-to-left.
</constant>
- <constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
+ <constant name="MENU_DISPLAY_UCC" value="12" enum="MenuItems">
Toggles control character display.
</constant>
- <constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
+ <constant name="MENU_SUBMENU_INSERT_UCC" value="13" enum="MenuItems">
+ ID of "Insert Control Character" submenu.
+ </constant>
+ <constant name="MENU_INSERT_LRM" value="14" enum="MenuItems">
Inserts left-to-right mark (LRM) character.
</constant>
- <constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
+ <constant name="MENU_INSERT_RLM" value="15" enum="MenuItems">
Inserts right-to-left mark (RLM) character.
</constant>
- <constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
+ <constant name="MENU_INSERT_LRE" value="16" enum="MenuItems">
Inserts start of left-to-right embedding (LRE) character.
</constant>
- <constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
+ <constant name="MENU_INSERT_RLE" value="17" enum="MenuItems">
Inserts start of right-to-left embedding (RLE) character.
</constant>
- <constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
+ <constant name="MENU_INSERT_LRO" value="18" enum="MenuItems">
Inserts start of left-to-right override (LRO) character.
</constant>
- <constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
+ <constant name="MENU_INSERT_RLO" value="19" enum="MenuItems">
Inserts start of right-to-left override (RLO) character.
</constant>
- <constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
+ <constant name="MENU_INSERT_PDF" value="20" enum="MenuItems">
Inserts pop direction formatting (PDF) character.
</constant>
- <constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
+ <constant name="MENU_INSERT_ALM" value="21" enum="MenuItems">
Inserts Arabic letter mark (ALM) character.
</constant>
- <constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
+ <constant name="MENU_INSERT_LRI" value="22" enum="MenuItems">
Inserts left-to-right isolate (LRI) character.
</constant>
- <constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
+ <constant name="MENU_INSERT_RLI" value="23" enum="MenuItems">
Inserts right-to-left isolate (RLI) character.
</constant>
- <constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
+ <constant name="MENU_INSERT_FSI" value="24" enum="MenuItems">
Inserts first strong isolate (FSI) character.
</constant>
- <constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
+ <constant name="MENU_INSERT_PDI" value="25" enum="MenuItems">
Inserts pop direction isolate (PDI) character.
</constant>
- <constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
+ <constant name="MENU_INSERT_ZWJ" value="26" enum="MenuItems">
Inserts zero width joiner (ZWJ) character.
</constant>
- <constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
+ <constant name="MENU_INSERT_ZWNJ" value="27" enum="MenuItems">
Inserts zero width non-joiner (ZWNJ) character.
</constant>
- <constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
+ <constant name="MENU_INSERT_WJ" value="28" enum="MenuItems">
Inserts word joiner (WJ) character.
</constant>
- <constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
+ <constant name="MENU_INSERT_SHY" value="29" enum="MenuItems">
Inserts soft hyphen (SHY) character.
</constant>
- <constant name="MENU_MAX" value="28" enum="MenuItems">
+ <constant name="MENU_MAX" value="30" enum="MenuItems">
Represents the size of the [enum MenuItems] enum.
</constant>
<constant name="KEYBOARD_TYPE_DEFAULT" value="0" enum="VirtualKeyboardType">
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 3ce6ce41b4..020ce4f468 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -138,10 +138,10 @@
Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
</constant>
<constant name="RPC_MODE_ANY_PEER" value="1" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
+ Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc("any")[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
</constant>
<constant name="RPC_MODE_AUTHORITY" value="2" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the [code]@rpc(authority)[/code] annotation. See [method Node.set_multiplayer_authority].
+ Used with [method Node.rpc_config] to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the [code]@rpc("authority")[/code] annotation. See [method Node.set_multiplayer_authority].
</constant>
</constants>
</class>
diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml
index 74f29bdc48..78694ce813 100644
--- a/doc/classes/Mutex.xml
+++ b/doc/classes/Mutex.xml
@@ -18,9 +18,9 @@
</description>
</method>
<method name="try_lock">
- <return type="int" enum="Error" />
+ <return type="bool" />
<description>
- Tries locking this [Mutex], but does not block. Returns [constant OK] on success, [constant ERR_BUSY] otherwise.
+ Tries locking this [Mutex], but does not block. Returns [code]true[/code] on success, [code]false[/code] otherwise.
[b]Note:[/b] This function returns [constant OK] if the thread already has ownership of the mutex.
</description>
</method>
diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml
index b561748b30..6ae4dc4177 100644
--- a/doc/classes/NavigationAgent2D.xml
+++ b/doc/classes/NavigationAgent2D.xml
@@ -4,8 +4,8 @@
2D Agent used in navigation for collision avoidance.
</brief_description>
<description>
- 2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe.
- [b]Note:[/b] After setting [member target_location] it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
+ 2D Agent that is used in navigation to reach a position while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe.
+ [b]Note:[/b] After setting [member target_position] it is required to use the [method get_next_path_position] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
</description>
<tutorials>
<link title="Using NavigationAgents">$DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html</link>
@@ -14,13 +14,13 @@
<method name="distance_to_target" qualifiers="const">
<return type="float" />
<description>
- Returns the distance to the target location, using the agent's global position. The user must set [member target_location] in order for this to be accurate.
+ Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate.
</description>
</method>
<method name="get_current_navigation_path" qualifiers="const">
<return type="PackedVector2Array" />
<description>
- Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_location] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
+ Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
</description>
</method>
<method name="get_current_navigation_path_index" qualifiers="const">
@@ -35,10 +35,10 @@
Returns the path query result for the path the agent is currently following.
</description>
</method>
- <method name="get_final_location">
+ <method name="get_final_position">
<return type="Vector2" />
<description>
- Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
+ Returns the reachable final position in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
</description>
</method>
<method name="get_navigation_layer_value" qualifiers="const">
@@ -54,10 +54,10 @@
Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer.
</description>
</method>
- <method name="get_next_location">
+ <method name="get_next_path_position">
<return type="Vector2" />
<description>
- Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
+ Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
</description>
</method>
<method name="get_rid" qualifiers="const">
@@ -69,19 +69,19 @@
<method name="is_navigation_finished">
<return type="bool" />
<description>
- Returns true if the navigation path's final location has been reached.
+ Returns true if the navigation path's final position has been reached.
</description>
</method>
<method name="is_target_reachable">
<return type="bool" />
<description>
- Returns true if [member target_location] is reachable.
+ Returns true if [member target_position] is reachable.
</description>
</method>
<method name="is_target_reached" qualifiers="const">
<return type="bool" />
<description>
- Returns true if [member target_location] is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location].
+ Returns true if [member target_position] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [method get_final_position].
</description>
</method>
<method name="set_navigation_layer_value">
@@ -127,7 +127,7 @@
The distance threshold before a path point is considered to be reached. This will allow an agent to not have to hit a path point on the path exactly, but in the area. If this value is set to high the NavigationAgent will skip points on the path which can lead to leaving the navigation mesh. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the next point on each physics frame update.
</member>
<member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="100.0">
- The maximum distance the agent is allowed away from the ideal path to the final location. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
+ The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
</member>
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters2D.PathMetadataFlags" default="7">
Additional information to return with the navigation path.
@@ -139,8 +139,8 @@
<member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="10.0">
The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update.
</member>
- <member name="target_location" type="Vector2" setter="set_target_location" getter="get_target_location" default="Vector2(0, 0)">
- The user-defined target location. Setting this property will clear the current navigation path.
+ <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 0)">
+ The user-defined target position. Setting this property will clear the current navigation path.
</member>
<member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="1.0">
The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive.
@@ -152,7 +152,7 @@
<description>
Notifies when a navigation link has been reached.
The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]:
- - [code]location[/code]: The start location of the link that was reached.
+ - [code]position[/code]: The start position of the link that was reached.
- [code]type[/code]: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK].
- [code]rid[/code]: The [RID] of the link.
- [code]owner[/code]: The object which manages the link (usually [NavigationLink2D]).
@@ -160,7 +160,7 @@
</signal>
<signal name="navigation_finished">
<description>
- Notifies when the final location is reached.
+ Notifies when the final position is reached.
</description>
</signal>
<signal name="path_changed">
@@ -170,7 +170,7 @@
</signal>
<signal name="target_reached">
<description>
- Notifies when the player-defined [member target_location] is reached.
+ Notifies when the player-defined [member target_position] is reached.
</description>
</signal>
<signal name="velocity_computed">
@@ -184,7 +184,7 @@
<description>
Notifies when a waypoint along the path has been reached.
The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]:
- - [code]location[/code]: The location of the waypoint that was reached.
+ - [code]position[/code]: The position of the waypoint that was reached.
- [code]type[/code]: The type of navigation primitive (region or link) that contains this waypoint.
- [code]rid[/code]: The [RID] of the containing navigation primitive (region or link).
- [code]owner[/code]: The object which manages the containing navigation primitive (region or link).
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index a1b007ee56..a22cd6dd46 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -4,8 +4,8 @@
3D Agent used in navigation for collision avoidance.
</brief_description>
<description>
- 3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe.
- [b]Note:[/b] After setting [member target_location] it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
+ 3D Agent that is used in navigation to reach a position while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe.
+ [b]Note:[/b] After setting [member target_position] it is required to use the [method get_next_path_position] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
</description>
<tutorials>
<link title="Using NavigationAgents">$DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html</link>
@@ -14,13 +14,13 @@
<method name="distance_to_target" qualifiers="const">
<return type="float" />
<description>
- Returns the distance to the target location, using the agent's global position. The user must set [member target_location] in order for this to be accurate.
+ Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate.
</description>
</method>
<method name="get_current_navigation_path" qualifiers="const">
<return type="PackedVector3Array" />
<description>
- Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_location] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
+ Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
</description>
</method>
<method name="get_current_navigation_path_index" qualifiers="const">
@@ -35,10 +35,10 @@
Returns the path query result for the path the agent is currently following.
</description>
</method>
- <method name="get_final_location">
+ <method name="get_final_position">
<return type="Vector3" />
<description>
- Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
+ Returns the reachable final position in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
</description>
</method>
<method name="get_navigation_layer_value" qualifiers="const">
@@ -54,10 +54,10 @@
Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer.
</description>
</method>
- <method name="get_next_location">
+ <method name="get_next_path_position">
<return type="Vector3" />
<description>
- Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
+ Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
</description>
</method>
<method name="get_rid" qualifiers="const">
@@ -69,19 +69,19 @@
<method name="is_navigation_finished">
<return type="bool" />
<description>
- Returns true if the navigation path's final location has been reached.
+ Returns true if the navigation path's final position has been reached.
</description>
</method>
<method name="is_target_reachable">
<return type="bool" />
<description>
- Returns true if [member target_location] is reachable.
+ Returns true if [member target_position] is reachable.
</description>
</method>
<method name="is_target_reached" qualifiers="const">
<return type="bool" />
<description>
- Returns true if [member target_location] is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location].
+ Returns true if [member target_position] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [method get_final_position].
</description>
</method>
<method name="set_navigation_layer_value">
@@ -133,7 +133,7 @@
The distance threshold before a path point is considered to be reached. This will allow an agent to not have to hit a path point on the path exactly, but in the area. If this value is set to high the NavigationAgent will skip points on the path which can lead to leaving the navigation mesh. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the next point on each physics frame update.
</member>
<member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="3.0">
- The maximum distance the agent is allowed away from the ideal path to the final location. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
+ The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
</member>
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" default="7">
Additional information to return with the navigation path.
@@ -145,8 +145,8 @@
<member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0">
The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update.
</member>
- <member name="target_location" type="Vector3" setter="set_target_location" getter="get_target_location" default="Vector3(0, 0, 0)">
- The user-defined target location. Setting this property will clear the current navigation path.
+ <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, 0, 0)">
+ The user-defined target position. Setting this property will clear the current navigation path.
</member>
<member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="5.0">
The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive.
@@ -158,7 +158,7 @@
<description>
Notifies when a navigation link has been reached.
The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]:
- - [code]location[/code]: The start location of the link that was reached.
+ - [code]position[/code]: The start position of the link that was reached.
- [code]type[/code]: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK].
- [code]rid[/code]: The [RID] of the link.
- [code]owner[/code]: The object which manages the link (usually [NavigationLink3D]).
@@ -166,7 +166,7 @@
</signal>
<signal name="navigation_finished">
<description>
- Notifies when the final location is reached.
+ Notifies when the final position is reached.
</description>
</signal>
<signal name="path_changed">
@@ -176,7 +176,7 @@
</signal>
<signal name="target_reached">
<description>
- Notifies when the player-defined [member target_location] is reached.
+ Notifies when the player-defined [member target_position] is reached.
</description>
</signal>
<signal name="velocity_computed">
@@ -190,7 +190,7 @@
<description>
Notifies when a waypoint along the path has been reached.
The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]:
- - [code]location[/code]: The location of the waypoint that was reached.
+ - [code]position[/code]: The position of the waypoint that was reached.
- [code]type[/code]: The type of navigation primitive (region or link) that contains this waypoint.
- [code]rid[/code]: The [RID] of the containing navigation primitive (region or link).
- [code]owner[/code]: The object which manages the containing navigation primitive (region or link).
diff --git a/doc/classes/NavigationLink2D.xml b/doc/classes/NavigationLink2D.xml
index 44d2110a7c..b3f4367675 100644
--- a/doc/classes/NavigationLink2D.xml
+++ b/doc/classes/NavigationLink2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="NavigationLink2D" inherits="Node2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Creates a link between two locations that [NavigationServer2D] can route agents through.
+ Creates a link between two positions that [NavigationServer2D] can route agents through.
</brief_description>
<description>
- Creates a link between two locations that [NavigationServer2D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
+ Creates a link between two positions that [NavigationServer2D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
</description>
<tutorials>
<link title="Using NavigationLinks">$DOCS_URL/tutorials/navigation/navigation_using_navigationlinks.html</link>
@@ -28,12 +28,12 @@
</methods>
<members>
<member name="bidirectional" type="bool" setter="set_bidirectional" getter="is_bidirectional" default="true">
- Whether this link can be traveled in both directions or only from [member start_location] to [member end_location].
+ Whether this link can be traveled in both directions or only from [member start_position] to [member end_position].
</member>
<member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true">
Whether this link is currently active. If [code]false[/code], [method NavigationServer2D.map_get_path] will ignore this link.
</member>
- <member name="end_location" type="Vector2" setter="set_end_location" getter="get_end_location" default="Vector2(0, 0)">
+ <member name="end_position" type="Vector2" setter="set_end_position" getter="get_end_position" default="Vector2(0, 0)">
Ending position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius].
@@ -44,7 +44,7 @@
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer2D.map_get_path].
</member>
- <member name="start_location" type="Vector2" setter="set_start_location" getter="get_start_location" default="Vector2(0, 0)">
+ <member name="start_position" type="Vector2" setter="set_start_position" getter="get_start_position" default="Vector2(0, 0)">
Starting position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius].
diff --git a/doc/classes/NavigationLink3D.xml b/doc/classes/NavigationLink3D.xml
index 4aa5801afb..4dff226042 100644
--- a/doc/classes/NavigationLink3D.xml
+++ b/doc/classes/NavigationLink3D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="NavigationLink3D" inherits="Node3D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Creates a link between two locations that [NavigationServer3D] can route agents through.
+ Creates a link between two positions that [NavigationServer3D] can route agents through.
</brief_description>
<description>
- Creates a link between two locations that [NavigationServer3D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
+ Creates a link between two positions that [NavigationServer3D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
</description>
<tutorials>
<link title="Using NavigationLinks">$DOCS_URL/tutorials/navigation/navigation_using_navigationlinks.html</link>
@@ -28,12 +28,12 @@
</methods>
<members>
<member name="bidirectional" type="bool" setter="set_bidirectional" getter="is_bidirectional" default="true">
- Whether this link can be traveled in both directions or only from [member start_location] to [member end_location].
+ Whether this link can be traveled in both directions or only from [member start_position] to [member end_position].
</member>
<member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true">
Whether this link is currently active. If [code]false[/code], [method NavigationServer3D.map_get_path] will ignore this link.
</member>
- <member name="end_location" type="Vector3" setter="set_end_location" getter="get_end_location" default="Vector3(0, 0, 0)">
+ <member name="end_position" type="Vector3" setter="set_end_position" getter="get_end_position" default="Vector3(0, 0, 0)">
Ending position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius].
@@ -44,7 +44,7 @@
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer3D.map_get_path].
</member>
- <member name="start_location" type="Vector3" setter="set_start_location" getter="get_start_location" default="Vector3(0, 0, 0)">
+ <member name="start_position" type="Vector3" setter="set_start_position" getter="get_start_position" default="Vector3(0, 0, 0)">
Starting position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius].
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index 1ba949b294..95e3fded36 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -137,14 +137,14 @@
<method name="link_create">
<return type="RID" />
<description>
- Create a new link between two locations on a map.
+ Create a new link between two positions on a map.
</description>
</method>
- <method name="link_get_end_location" qualifiers="const">
+ <method name="link_get_end_position" qualifiers="const">
<return type="Vector2" />
<param index="0" name="link" type="RID" />
<description>
- Returns the ending location of this [code]link[/code].
+ Returns the ending position of this [code]link[/code].
</description>
</method>
<method name="link_get_enter_cost" qualifiers="const">
@@ -175,11 +175,11 @@
Returns the [code]ObjectID[/code] of the object which manages this link.
</description>
</method>
- <method name="link_get_start_location" qualifiers="const">
+ <method name="link_get_start_position" qualifiers="const">
<return type="Vector2" />
<param index="0" name="link" type="RID" />
<description>
- Returns the starting location of this [code]link[/code].
+ Returns the starting position of this [code]link[/code].
</description>
</method>
<method name="link_get_travel_cost" qualifiers="const">
@@ -204,12 +204,12 @@
Sets whether this [code]link[/code] can be travelled in both directions.
</description>
</method>
- <method name="link_set_end_location">
+ <method name="link_set_end_position">
<return type="void" />
<param index="0" name="link" type="RID" />
- <param index="1" name="location" type="Vector2" />
+ <param index="1" name="position" type="Vector2" />
<description>
- Sets the exit location for the [code]link[/code].
+ Sets the exit position for the [code]link[/code].
</description>
</method>
<method name="link_set_enter_cost">
@@ -244,12 +244,12 @@
Set the [code]ObjectID[/code] of the object which manages this link.
</description>
</method>
- <method name="link_set_start_location">
+ <method name="link_set_start_position">
<return type="void" />
<param index="0" name="link" type="RID" />
- <param index="1" name="location" type="Vector2" />
+ <param index="1" name="position" type="Vector2" />
<description>
- Sets the entry location for this [code]link[/code].
+ Sets the entry position for this [code]link[/code].
</description>
</method>
<method name="link_set_travel_cost">
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index e007c71342..fd20f780b3 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -144,14 +144,14 @@
<method name="link_create">
<return type="RID" />
<description>
- Create a new link between two locations on a map.
+ Create a new link between two positions on a map.
</description>
</method>
- <method name="link_get_end_location" qualifiers="const">
+ <method name="link_get_end_position" qualifiers="const">
<return type="Vector3" />
<param index="0" name="link" type="RID" />
<description>
- Returns the ending location of this [code]link[/code].
+ Returns the ending position of this [code]link[/code].
</description>
</method>
<method name="link_get_enter_cost" qualifiers="const">
@@ -182,11 +182,11 @@
Returns the [code]ObjectID[/code] of the object which manages this link.
</description>
</method>
- <method name="link_get_start_location" qualifiers="const">
+ <method name="link_get_start_position" qualifiers="const">
<return type="Vector3" />
<param index="0" name="link" type="RID" />
<description>
- Returns the starting location of this [code]link[/code].
+ Returns the starting position of this [code]link[/code].
</description>
</method>
<method name="link_get_travel_cost" qualifiers="const">
@@ -211,12 +211,12 @@
Sets whether this [code]link[/code] can be travelled in both directions.
</description>
</method>
- <method name="link_set_end_location">
+ <method name="link_set_end_position">
<return type="void" />
<param index="0" name="link" type="RID" />
- <param index="1" name="location" type="Vector3" />
+ <param index="1" name="position" type="Vector3" />
<description>
- Sets the exit location for the [code]link[/code].
+ Sets the exit position for the [code]link[/code].
</description>
</method>
<method name="link_set_enter_cost">
@@ -251,12 +251,12 @@
Set the [code]ObjectID[/code] of the object which manages this link.
</description>
</method>
- <method name="link_set_start_location">
+ <method name="link_set_start_position">
<return type="void" />
<param index="0" name="link" type="RID" />
- <param index="1" name="location" type="Vector3" />
+ <param index="1" name="position" type="Vector3" />
<description>
- Sets the entry location for this [code]link[/code].
+ Sets the entry position for this [code]link[/code].
</description>
</method>
<method name="link_set_travel_cost">
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 7b27f16d82..7c40c189c0 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -666,7 +666,7 @@
channel = 0,
}
[/codeblock]
- See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(authority)[/code]). By default, methods are not exposed to networking (and RPCs).
+ See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc("any")[/code], [code]@rpc("authority")[/code]). By default, methods are not exposed to networking (and RPCs).
</description>
</method>
<method name="rpc_id" qualifiers="vararg">
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index 325ead0cfa..80a9b40605 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -80,9 +80,9 @@
[/gdscript]
[csharp]
// position (-3, 2), size (1, 1)
- var rect = new Rect2i(new Vector2i(-3, 2), new Vector2i(1, 1));
- // position (-3, -1), size (3, 4), so we fit both rect and Vector2i(0, -1)
- var rect2 = rect.Expand(new Vector2i(0, -1));
+ var rect = new Rect2I(new Vector2I(-3, 2), new Vector2I(1, 1));
+ // position (-3, -1), size (3, 4), so we fit both rect and Vector2I(0, -1)
+ var rect2 = rect.Expand(new Vector2I(0, -1));
[/csharp]
[/codeblocks]
</description>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 8c0b16c76f..1ecc8a1d4e 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -251,6 +251,14 @@
Adds a [code][color][/code] tag to the tag stack.
</description>
</method>
+ <method name="push_customfx">
+ <return type="void" />
+ <param index="0" name="effect" type="RichTextEffect" />
+ <param index="1" name="env" type="Dictionary" />
+ <description>
+ Adds a custom effect tag to the tag stack. The effect does not need to be in [member custom_effects]. The environment is directly passed to the effect.
+ </description>
+ </method>
<method name="push_dropcap">
<return type="void" />
<param index="0" name="string" type="String" />
diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml
index 6b2007363e..d1d126c5cb 100644
--- a/doc/classes/Semaphore.xml
+++ b/doc/classes/Semaphore.xml
@@ -17,9 +17,9 @@
</description>
</method>
<method name="try_wait">
- <return type="int" enum="Error" />
+ <return type="bool" />
<description>
- Like [method wait], but won't block, so if the value is zero, fails immediately and returns [constant ERR_BUSY]. If non-zero, it returns [constant OK] to report success.
+ Like [method wait], but won't block, so if the value is zero, fails immediately and returns [code]false[/code]. If non-zero, it returns [code]true[/code] to report success.
</description>
</method>
<method name="wait">
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 97466e7860..143e1f23e9 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -1002,10 +1002,16 @@
[/codeblocks]
</description>
</method>
+ <method name="validate_filename" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns a copy of the string with all characters that are not allowed in [method is_valid_filename] replaced with underscores.
+ </description>
+ </method>
<method name="validate_node_name" qualifiers="const">
<return type="String" />
<description>
- Removes all characters that are not allowed in [member Node.name] from the string ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]).
+ Returns a copy of the string with all characters that are not allowed in [member Node.name] removed ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]).
</description>
</method>
<method name="xml_escape" qualifiers="const">
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index b46e39b8d7..c103fb2287 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -909,10 +909,16 @@
[/codeblocks]
</description>
</method>
+ <method name="validate_filename" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns a copy of the string with all characters that are not allowed in [method is_valid_filename] replaced with underscores.
+ </description>
+ </method>
<method name="validate_node_name" qualifiers="const">
<return type="String" />
<description>
- Removes all characters that are not allowed in [member Node.name] from the string ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]).
+ Returns a copy of the string with all characters that are not allowed in [member Node.name] removed ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]).
</description>
</method>
<method name="xml_escape" qualifiers="const">
diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml
index 745187ed63..f2f6e59a9e 100644
--- a/doc/classes/StyleBoxTexture.xml
+++ b/doc/classes/StyleBoxTexture.xml
@@ -82,6 +82,7 @@
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)">
Species a sub-region of the texture to use.
This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
+ If empty ([code]Rect2(0, 0, 0, 0)[/code]), the whole texture will be used.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The texture to use when drawing this style box.
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index 9d73e9fb39..5b567dbc28 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -133,7 +133,7 @@
<description>
Generates normals from vertices so you do not have to do it manually. If [param flip] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents].
[b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES].
- [b]Note:[/b] [method generate_normals] takes smooth groups into account. If you don't specify any smooth group for each vertex, [method generate_normals] will smooth normals for you.
+ [b]Note:[/b] [method generate_normals] takes smooth groups into account. To generate smooth normals, set the smooth group to a value greater than or equal to [code]0[/code] using [method set_smooth_group] or leave the smooth group at the default of [code]0[/code]. To generate flat normals, set the smooth group to [code]-1[/code] using [method set_smooth_group] prior to adding vertices.
</description>
</method>
<method name="generate_tangents">
@@ -241,7 +241,7 @@
<return type="void" />
<param index="0" name="index" type="int" />
<description>
- Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation.
+ Specifies the smooth group to use for the [i]next[/i] vertex. If this is never called, all vertices will have the default smooth group of [code]0[/code] and will be smoothed with adjacent vertices of the same group. To produce a mesh with flat normals, set the smooth group to [code]-1[/code].
</description>
</method>
<method name="set_tangent">
diff --git a/doc/classes/SystemFont.xml b/doc/classes/SystemFont.xml
index 20bfd0d8ae..5e7b79ae97 100644
--- a/doc/classes/SystemFont.xml
+++ b/doc/classes/SystemFont.xml
@@ -43,6 +43,12 @@
<member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="1">
Font hinting mode.
</member>
+ <member name="msdf_pixel_range" type="int" setter="set_msdf_pixel_range" getter="get_msdf_pixel_range" default="16">
+ The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. The default [member msdf_pixel_range] value of [code]16[/code] allows outline sizes up to [code]8[/code] to look correct.
+ </member>
+ <member name="msdf_size" type="int" setter="set_msdf_size" getter="get_msdf_size" default="48">
+ Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering.
+ </member>
<member name="multichannel_signed_distance_field" type="bool" setter="set_multichannel_signed_distance_field" getter="is_multichannel_signed_distance_field" default="false">
If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
</member>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index ccd79cd170..c309026aaa 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -390,6 +390,45 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
+ You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example:
+ [codeblocks]
+ [gdscript]
+ func _ready():
+ var menu = get_menu()
+ # Remove all items after "Redo".
+ menu.item_count = menu.get_item_index(MENU_REDO) + 1
+ # Add custom items.
+ menu.add_separator()
+ menu.add_item("Insert Date", MENU_MAX + 1)
+ # Connect callback.
+ menu.id_pressed.connect(_on_item_pressed)
+
+ func _on_item_pressed(id):
+ if id == MENU_MAX + 1:
+ insert_text_at_caret(Time.get_date_string_from_system())
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var menu = GetMenu();
+ // Remove all items after "Redo".
+ menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1;
+ // Add custom items.
+ menu.AddSeparator();
+ menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1);
+ // Add event handler.
+ menu.IdPressed += OnItemPressed;
+ }
+
+ public void OnItemPressed(int id)
+ {
+ if (id == TextEdit.MenuItems.Max + 1)
+ {
+ InsertTextAtCaret(Time.GetDateStringFromSystem());
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
@@ -682,7 +721,7 @@
<return type="void" />
<param index="0" name="option" type="int" />
<description>
- Triggers a right-click menu action by the specified index. See [enum MenuItems] for a list of available indexes.
+ Executes a given action as defined in the [enum MenuItems] enum.
</description>
</method>
<method name="merge_gutters">
@@ -764,18 +803,18 @@
[codeblocks]
[gdscript]
var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
- if result.x != -1:
+ if result.x != -1:
# Result found.
var line_number = result.y
var column_number = result.x
[/gdscript]
[csharp]
- Vector2i result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
- if (result.Length &gt; 0)
+ Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
+ if (result.X != -1)
{
// Result found.
- int lineNumber = result.y;
- int columnNumber = result.x;
+ int lineNumber = result.Y;
+ int columnNumber = result.X;
}
[/csharp]
[/codeblocks]
@@ -1224,70 +1263,76 @@
<constant name="MENU_REDO" value="6" enum="MenuItems">
Redoes the previous action.
</constant>
- <constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
+ <constant name="MENU_SUBMENU_TEXT_DIR" value="7" enum="MenuItems">
+ ID of "Text Writing Direction" submenu.
+ </constant>
+ <constant name="MENU_DIR_INHERITED" value="8" enum="MenuItems">
Sets text direction to inherited.
</constant>
- <constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
+ <constant name="MENU_DIR_AUTO" value="9" enum="MenuItems">
Sets text direction to automatic.
</constant>
- <constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
+ <constant name="MENU_DIR_LTR" value="10" enum="MenuItems">
Sets text direction to left-to-right.
</constant>
- <constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
+ <constant name="MENU_DIR_RTL" value="11" enum="MenuItems">
Sets text direction to right-to-left.
</constant>
- <constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
+ <constant name="MENU_DISPLAY_UCC" value="12" enum="MenuItems">
Toggles control character display.
</constant>
- <constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
+ <constant name="MENU_SUBMENU_INSERT_UCC" value="13" enum="MenuItems">
+ ID of "Insert Control Character" submenu.
+ </constant>
+ <constant name="MENU_INSERT_LRM" value="14" enum="MenuItems">
Inserts left-to-right mark (LRM) character.
</constant>
- <constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
+ <constant name="MENU_INSERT_RLM" value="15" enum="MenuItems">
Inserts right-to-left mark (RLM) character.
</constant>
- <constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
+ <constant name="MENU_INSERT_LRE" value="16" enum="MenuItems">
Inserts start of left-to-right embedding (LRE) character.
</constant>
- <constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
+ <constant name="MENU_INSERT_RLE" value="17" enum="MenuItems">
Inserts start of right-to-left embedding (RLE) character.
</constant>
- <constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
+ <constant name="MENU_INSERT_LRO" value="18" enum="MenuItems">
Inserts start of left-to-right override (LRO) character.
</constant>
- <constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
+ <constant name="MENU_INSERT_RLO" value="19" enum="MenuItems">
Inserts start of right-to-left override (RLO) character.
</constant>
- <constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
+ <constant name="MENU_INSERT_PDF" value="20" enum="MenuItems">
Inserts pop direction formatting (PDF) character.
</constant>
- <constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
+ <constant name="MENU_INSERT_ALM" value="21" enum="MenuItems">
Inserts Arabic letter mark (ALM) character.
</constant>
- <constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
+ <constant name="MENU_INSERT_LRI" value="22" enum="MenuItems">
Inserts left-to-right isolate (LRI) character.
</constant>
- <constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
+ <constant name="MENU_INSERT_RLI" value="23" enum="MenuItems">
Inserts right-to-left isolate (RLI) character.
</constant>
- <constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
+ <constant name="MENU_INSERT_FSI" value="24" enum="MenuItems">
Inserts first strong isolate (FSI) character.
</constant>
- <constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
+ <constant name="MENU_INSERT_PDI" value="25" enum="MenuItems">
Inserts pop direction isolate (PDI) character.
</constant>
- <constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
+ <constant name="MENU_INSERT_ZWJ" value="26" enum="MenuItems">
Inserts zero width joiner (ZWJ) character.
</constant>
- <constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
+ <constant name="MENU_INSERT_ZWNJ" value="27" enum="MenuItems">
Inserts zero width non-joiner (ZWNJ) character.
</constant>
- <constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
+ <constant name="MENU_INSERT_WJ" value="28" enum="MenuItems">
Inserts word joiner (WJ) character.
</constant>
- <constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
+ <constant name="MENU_INSERT_SHY" value="29" enum="MenuItems">
Inserts soft hyphen (SHY) character.
</constant>
- <constant name="MENU_MAX" value="28" enum="MenuItems">
+ <constant name="MENU_MAX" value="30" enum="MenuItems">
Represents the size of the [enum MenuItems] enum.
</constant>
<constant name="ACTION_NONE" value="0" enum="EditAction">
diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml
index f815b8d0c3..bedc52abd1 100644
--- a/doc/classes/TileData.xml
+++ b/doc/classes/TileData.xml
@@ -218,7 +218,7 @@
<member name="terrain_set" type="int" setter="set_terrain_set" getter="get_terrain_set" default="-1">
ID of the terrain set that the tile uses.
</member>
- <member name="texture_offset" type="Vector2i" setter="set_texture_offset" getter="get_texture_offset" default="Vector2i(0, 0)">
+ <member name="texture_origin" type="Vector2i" setter="set_texture_origin" getter="get_texture_origin" default="Vector2i(0, 0)">
Offsets the position of where the tile is drawn.
</member>
<member name="transpose" type="bool" setter="set_transpose" getter="get_transpose" default="false">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 2fd42666b4..c387bd435b 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -251,7 +251,7 @@
<param index="0" name="map_position" type="Vector2i" />
<description>
Returns the centered position of a cell in the TileMap's local coordinate space. To convert the returned value into global coordinates, use [method Node2D.to_global]. See also [method local_to_map].
- [b]Note:[/b] This may not correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_offset] property of individual tiles.
+ [b]Note:[/b] This may not correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_origin] property of individual tiles.
</description>
</method>
<method name="move_layer">
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index a812b52307..a39a43be4c 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -143,6 +143,14 @@
Returns the custom data layers count.
</description>
</method>
+ <method name="get_navigation_layer_layer_value" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="layer_index" type="int" />
+ <param index="1" name="layer_number" type="int" />
+ <description>
+ Returns whether or not the specified navigation layer of the TileSet navigation data layer identified by the given [param layer_index] is enabled, given a navigation_layers [param layer_number] between 1 and 32.
+ </description>
+ </method>
<method name="get_navigation_layer_layers" qualifiers="const">
<return type="int" />
<param index="0" name="layer_index" type="int" />
@@ -500,6 +508,15 @@
Sets the type of the custom data layer identified by the given index.
</description>
</method>
+ <method name="set_navigation_layer_layer_value">
+ <return type="void" />
+ <param index="0" name="layer_index" type="int" />
+ <param index="1" name="layer_number" type="int" />
+ <param index="2" name="value" type="bool" />
+ <description>
+ Based on [param value], enables or disables the specified navigation layer of the TileSet navigation data layer identified by the given [param layer_index], given a navigation_layers [param layer_number] between 1 and 32.
+ </description>
+ </method>
<method name="set_navigation_layer_layers">
<return type="void" />
<param index="0" name="layer_index" type="int" />
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 236d34383f..ab2de14638 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -55,7 +55,7 @@
<method name="get_final_transform" qualifiers="const">
<return type="Transform2D" />
<description>
- Returns the total transform of the viewport.
+ Returns the transform from the viewport's coordinate system to the embedder's coordinate system.
</description>
</method>
<method name="get_mouse_position" qualifiers="const">
@@ -210,6 +210,7 @@
<param index="0" name="position" type="Vector2" />
<description>
Moves the mouse pointer to the specified position in this [Viewport] using the coordinate system of this [Viewport].
+ [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
</description>
</method>
</methods>
diff --git a/doc/classes/VisualShaderNodeDerivativeFunc.xml b/doc/classes/VisualShaderNodeDerivativeFunc.xml
index 9a1ad53394..4a31969171 100644
--- a/doc/classes/VisualShaderNodeDerivativeFunc.xml
+++ b/doc/classes/VisualShaderNodeDerivativeFunc.xml
@@ -15,6 +15,9 @@
<member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeDerivativeFunc.OpType" default="0">
A type of operands and returned value. See [enum OpType] for options.
</member>
+ <member name="precision" type="int" setter="set_precision" getter="get_precision" enum="VisualShaderNodeDerivativeFunc.Precision" default="0">
+ Sets the level of precision to use for the derivative function. See [enum Precision] for options. When using the GL_Compatibility renderer, this setting has no effect.
+ </member>
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
@@ -44,5 +47,17 @@
<constant name="FUNC_MAX" value="3" enum="Function">
Represents the size of the [enum Function] enum.
</constant>
+ <constant name="PRECISION_NONE" value="0" enum="Precision">
+ No precision is specified, the GPU driver is allowed to use whatever level of precision it chooses. This is the default option and is equivalent to using [code]dFdx()[/code] or [code]dFdy()[/code] in text shaders.
+ </constant>
+ <constant name="PRECISION_COARSE" value="1" enum="Precision">
+ The derivative will be calculated using the current fragment's neighbors (which may not include the current fragment). This tends to be faster than using [constant PRECISION_FINE], but may not be suitable when more precision is needed. This is equivalent to using [code]dFdxCoarse()[/code] or [code]dFdyCoarse()[/code] in text shaders.
+ </constant>
+ <constant name="PRECISION_FINE" value="2" enum="Precision">
+ The derivative will be calculated using the current fragment and its immediate neighbors. This tends to be slower than using [constant PRECISION_COARSE], but may be necessary when more precision is needed. This is equivalent to using [code]dFdxFine()[/code] or [code]dFdyFine()[/code] in text shaders.
+ </constant>
+ <constant name="PRECISION_MAX" value="3" enum="Precision">
+ Represents the size of the [enum Precision] enum.
+ </constant>
</constants>
</class>