diff options
Diffstat (limited to 'doc')
77 files changed, 735 insertions, 521 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 7e7cb07cef..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> @@ -1767,30 +1905,15 @@ <constant name="KEY_KP_9" value="4194447" enum="Key"> Number 9 on the numeric keypad. </constant> - <constant name="KEY_SUPER_L" value="4194368" enum="Key"> - Left Super key (Windows key). - </constant> - <constant name="KEY_SUPER_R" value="4194369" enum="Key"> - Right Super key (Windows key). - </constant> <constant name="KEY_MENU" value="4194370" enum="Key"> Context menu key. </constant> - <constant name="KEY_HYPER_L" value="4194371" enum="Key"> - Left Hyper key. - </constant> - <constant name="KEY_HYPER_R" value="4194372" enum="Key"> - Right Hyper key. + <constant name="KEY_HYPER" value="4194371" enum="Key"> + Hyper key. (On Linux/X11 only). </constant> <constant name="KEY_HELP" value="4194373" enum="Key"> Help key. </constant> - <constant name="KEY_DIRECTION_L" value="4194374" enum="Key"> - Left Direction key. - </constant> - <constant name="KEY_DIRECTION_R" value="4194375" enum="Key"> - Right Direction key. - </constant> <constant name="KEY_BACK" value="4194376" enum="Key"> Media back key. Not to be confused with the Back button on an Android device. </constant> @@ -1812,21 +1935,6 @@ <constant name="KEY_VOLUMEUP" value="4194382" enum="Key"> Volume up key. </constant> - <constant name="KEY_BASSBOOST" value="4194383" enum="Key"> - Bass Boost key. - </constant> - <constant name="KEY_BASSUP" value="4194384" enum="Key"> - Bass up key. - </constant> - <constant name="KEY_BASSDOWN" value="4194385" enum="Key"> - Bass down key. - </constant> - <constant name="KEY_TREBLEUP" value="4194386" enum="Key"> - Treble up key. - </constant> - <constant name="KEY_TREBLEDOWN" value="4194387" enum="Key"> - Treble down key. - </constant> <constant name="KEY_MEDIAPLAY" value="4194388" enum="Key"> Media play key. </constant> @@ -1911,7 +2019,7 @@ <constant name="KEY_LAUNCHF" value="4194415" enum="Key"> Launch Shortcut F key. </constant> - <constant name="KEY_UNKNOWN" value="16777215" enum="Key"> + <constant name="KEY_UNKNOWN" value="8388607" enum="Key"> Unknown key. </constant> <constant name="KEY_SPACE" value="32" enum="Key"> @@ -2121,203 +2229,23 @@ <constant name="KEY_ASCIITILDE" value="126" enum="Key"> ~ key. </constant> - <constant name="KEY_NOBREAKSPACE" value="160" enum="Key"> - Non-breakable space key. - </constant> - <constant name="KEY_EXCLAMDOWN" value="161" enum="Key"> - ¡ key. - </constant> - <constant name="KEY_CENT" value="162" enum="Key"> - ¢ key. - </constant> - <constant name="KEY_STERLING" value="163" enum="Key"> - £ key. - </constant> - <constant name="KEY_CURRENCY" value="164" enum="Key"> - ¤ key. - </constant> <constant name="KEY_YEN" value="165" enum="Key"> ¥ key. </constant> - <constant name="KEY_BROKENBAR" value="166" enum="Key"> - ¦ key. - </constant> <constant name="KEY_SECTION" value="167" enum="Key"> § key. </constant> - <constant name="KEY_DIAERESIS" value="168" enum="Key"> - ¨ key. - </constant> - <constant name="KEY_COPYRIGHT" value="169" enum="Key"> - © key. - </constant> - <constant name="KEY_ORDFEMININE" value="170" enum="Key"> - ª key. - </constant> - <constant name="KEY_GUILLEMOTLEFT" value="171" enum="Key"> - « key. - </constant> - <constant name="KEY_NOTSIGN" value="172" enum="Key"> - ¬ key. - </constant> - <constant name="KEY_HYPHEN" value="173" enum="Key"> - Soft hyphen key. - </constant> - <constant name="KEY_REGISTERED" value="174" enum="Key"> - ® key. - </constant> - <constant name="KEY_MACRON" value="175" enum="Key"> - ¯ key. - </constant> - <constant name="KEY_DEGREE" value="176" enum="Key"> - ° key. - </constant> - <constant name="KEY_PLUSMINUS" value="177" enum="Key"> - ± key. - </constant> - <constant name="KEY_TWOSUPERIOR" value="178" enum="Key"> - ² key. - </constant> - <constant name="KEY_THREESUPERIOR" value="179" enum="Key"> - ³ key. - </constant> - <constant name="KEY_ACUTE" value="180" enum="Key"> - ´ key. - </constant> - <constant name="KEY_MU" value="181" enum="Key"> - µ key. - </constant> - <constant name="KEY_PARAGRAPH" value="182" enum="Key"> - ¶ key. - </constant> - <constant name="KEY_PERIODCENTERED" value="183" enum="Key"> - · key. - </constant> - <constant name="KEY_CEDILLA" value="184" enum="Key"> - ¸ key. - </constant> - <constant name="KEY_ONESUPERIOR" value="185" enum="Key"> - ¹ key. - </constant> - <constant name="KEY_MASCULINE" value="186" enum="Key"> - º key. - </constant> - <constant name="KEY_GUILLEMOTRIGHT" value="187" enum="Key"> - » key. - </constant> - <constant name="KEY_ONEQUARTER" value="188" enum="Key"> - ¼ key. - </constant> - <constant name="KEY_ONEHALF" value="189" enum="Key"> - ½ key. - </constant> - <constant name="KEY_THREEQUARTERS" value="190" enum="Key"> - ¾ key. - </constant> - <constant name="KEY_QUESTIONDOWN" value="191" enum="Key"> - ¿ key. - </constant> - <constant name="KEY_AGRAVE" value="192" enum="Key"> - À key. - </constant> - <constant name="KEY_AACUTE" value="193" enum="Key"> - Á key. - </constant> - <constant name="KEY_ACIRCUMFLEX" value="194" enum="Key"> - Â key. - </constant> - <constant name="KEY_ATILDE" value="195" enum="Key"> - Ã key. + <constant name="KEY_GLOBE" value="4194416" enum="Key"> + "Globe" key on Mac / iPad keyboard. </constant> - <constant name="KEY_ADIAERESIS" value="196" enum="Key"> - Ä key. + <constant name="KEY_KEYBOARD" value="4194417" enum="Key"> + "On-screen keyboard" key iPad keyboard. </constant> - <constant name="KEY_ARING" value="197" enum="Key"> - Å key. + <constant name="KEY_JIS_EISU" value="4194418" enum="Key"> + 英数 key on Mac keyboard. </constant> - <constant name="KEY_AE" value="198" enum="Key"> - Æ key. - </constant> - <constant name="KEY_CCEDILLA" value="199" enum="Key"> - Ç key. - </constant> - <constant name="KEY_EGRAVE" value="200" enum="Key"> - È key. - </constant> - <constant name="KEY_EACUTE" value="201" enum="Key"> - É key. - </constant> - <constant name="KEY_ECIRCUMFLEX" value="202" enum="Key"> - Ê key. - </constant> - <constant name="KEY_EDIAERESIS" value="203" enum="Key"> - Ë key. - </constant> - <constant name="KEY_IGRAVE" value="204" enum="Key"> - Ì key. - </constant> - <constant name="KEY_IACUTE" value="205" enum="Key"> - Í key. - </constant> - <constant name="KEY_ICIRCUMFLEX" value="206" enum="Key"> - Î key. - </constant> - <constant name="KEY_IDIAERESIS" value="207" enum="Key"> - Ï key. - </constant> - <constant name="KEY_ETH" value="208" enum="Key"> - Ð key. - </constant> - <constant name="KEY_NTILDE" value="209" enum="Key"> - Ñ key. - </constant> - <constant name="KEY_OGRAVE" value="210" enum="Key"> - Ò key. - </constant> - <constant name="KEY_OACUTE" value="211" enum="Key"> - Ó key. - </constant> - <constant name="KEY_OCIRCUMFLEX" value="212" enum="Key"> - Ô key. - </constant> - <constant name="KEY_OTILDE" value="213" enum="Key"> - Õ key. - </constant> - <constant name="KEY_ODIAERESIS" value="214" enum="Key"> - Ö key. - </constant> - <constant name="KEY_MULTIPLY" value="215" enum="Key"> - × key. - </constant> - <constant name="KEY_OOBLIQUE" value="216" enum="Key"> - Ø key. - </constant> - <constant name="KEY_UGRAVE" value="217" enum="Key"> - Ù key. - </constant> - <constant name="KEY_UACUTE" value="218" enum="Key"> - Ú key. - </constant> - <constant name="KEY_UCIRCUMFLEX" value="219" enum="Key"> - Û key. - </constant> - <constant name="KEY_UDIAERESIS" value="220" enum="Key"> - Ü key. - </constant> - <constant name="KEY_YACUTE" value="221" enum="Key"> - Ý key. - </constant> - <constant name="KEY_THORN" value="222" enum="Key"> - Þ key. - </constant> - <constant name="KEY_SSHARP" value="223" enum="Key"> - ß key. - </constant> - <constant name="KEY_DIVISION" value="247" enum="Key"> - ÷ key. - </constant> - <constant name="KEY_YDIAERESIS" value="255" enum="Key"> - ÿ key. + <constant name="KEY_JIS_KANA" value="4194419" enum="Key"> + かな key on Mac keyboard. </constant> <constant name="KEY_CODE_MASK" value="8388607" enum="KeyModifierMask" is_bitfield="true"> Key Code mask. @@ -2874,25 +2802,28 @@ <constant name="PROPERTY_USAGE_ARRAY" value="262144" enum="PropertyUsageFlags" is_bitfield="true"> The property is an array. </constant> - <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="524288" enum="PropertyUsageFlags" is_bitfield="true"> - If the property is a [Resource], a new copy of it is always created when calling [method Node.duplicate] or [method Resource.duplicate]. + <constant name="PROPERTY_USAGE_ALWAYS_DUPLICATE" value="524288" enum="PropertyUsageFlags" is_bitfield="true"> + When duplicating a resource with [method Resource.duplicate], and this flag is set on a property of that resource, the property should always be duplicated, regardless of the [code]subresources[/code] bool parameter. + </constant> + <constant name="PROPERTY_USAGE_NEVER_DUPLICATE" value="1048576" enum="PropertyUsageFlags" is_bitfield="true"> + When duplicating a resource with [method Resource.duplicate], and this flag is set on a property of that resource, the property should never be duplicated, regardless of the [code]subresources[/code] bool parameter. </constant> - <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="1048576" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="2097152" enum="PropertyUsageFlags" is_bitfield="true"> The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). </constant> - <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="2097152" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="4194304" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="4194304" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="8388608" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="8388608" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="16777216" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="33554432" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="67108864" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_READ_ONLY" value="134217728" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_READ_ONLY" value="268435456" enum="PropertyUsageFlags" is_bitfield="true"> The property is read-only in the [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags" is_bitfield="true"> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 4da9e41ca8..c0e5d6ad07 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -53,7 +53,7 @@ <return type="void" /> <param index="0" name="button" type="Control" /> <description> - Removes the [param button] from the dialog. Does NOT free the [param button]. The [param button] must be a [Button] added with [method add_button] or [method add_cancel_button] method. After removal, pressing the [param button] will no longer emit this dialog's [signal custom_action] or [signal cancelled] signals. + Removes the [param button] from the dialog. Does NOT free the [param button]. The [param button] must be a [Button] added with [method add_button] or [method add_cancel_button] method. After removal, pressing the [param button] will no longer emit this dialog's [signal custom_action] or [signal canceled] signals. </description> </method> </methods> @@ -81,7 +81,7 @@ <member name="wrap_controls" type="bool" setter="set_wrap_controls" getter="is_wrapping_controls" overrides="Window" default="true" /> </members> <signals> - <signal name="cancelled"> + <signal name="canceled"> <description> Emitted when the dialog is closed or the button created with [method add_cancel_button] is pressed. </description> diff --git a/doc/classes/AnimatableBody3D.xml b/doc/classes/AnimatableBody3D.xml index 2a08c4c8f1..0733780bf7 100644 --- a/doc/classes/AnimatableBody3D.xml +++ b/doc/classes/AnimatableBody3D.xml @@ -7,6 +7,7 @@ Animatable body for 3D physics. An animatable body can't be moved by external forces or contacts, but can be moved by script or animation to affect other bodies in its path. It is ideal for implementing moving objects in the environment, such as moving platforms or doors. When the body is moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to [code]physics[/code]), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index bca94a568a..90bae41586 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -16,18 +16,21 @@ <return type="int" /> <param index="0" name="caption" type="String" /> <description> + Returns the input index which corresponds to [param caption]. If not found, returns [code]-1[/code]. </description> </method> <method name="get_input_caption" qualifiers="const"> <return type="String" /> <param index="0" name="input" type="int" /> <description> + Returns the name of the input at the given [param input] index. This name is displayed in the editor next to the node input. </description> </method> <method name="is_input_set_as_auto_advance" qualifiers="const"> <return type="bool" /> <param index="0" name="input" type="int" /> <description> + Returns [code]true[/code] if auto-advance is enabled for the given [param input] index. </description> </method> <method name="set_input_as_auto_advance"> @@ -35,6 +38,7 @@ <param index="0" name="input" type="int" /> <param index="1" name="enable" type="bool" /> <description> + Enables or disables auto-advance for the given [param input] index. If enabled, state changes to the next input after playing the animation once. If enabled for the last input state, it loops to the first. </description> </method> <method name="set_input_caption"> @@ -42,17 +46,19 @@ <param index="0" name="input" type="int" /> <param index="1" name="caption" type="String" /> <description> + Sets the name of the input at the given [param input] index. This name is displayed in the editor next to the node input. </description> </method> </methods> <members> <member name="enabled_inputs" type="int" setter="set_enabled_inputs" getter="get_enabled_inputs" default="0"> - The number of enabled input ports for this node. + The number of enabled input ports for this node. The maximum is [code]31[/code]. </member> <member name="reset" type="bool" setter="set_reset" getter="is_reset" default="true"> If [code]true[/code], the destination animation is played back from the beginning when switched. </member> <member name="xfade_curve" type="Curve" setter="set_xfade_curve" getter="get_xfade_curve"> + Determines how cross-fading between animations is eased. If empty, the transition will be linear. </member> <member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time" default="0.0"> Cross-fading time (in seconds) between each animation connected to the inputs. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 304caeef43..c164fe4363 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" /> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index a17a727d7e..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" /> @@ -104,7 +115,7 @@ </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code]. - If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be cancelled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale] and [RootMotionView]. + If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale] and [RootMotionView]. </member> <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root"> The root animation node of this [AnimationTree]. See [AnimationNode]. diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 8923ac8aae..d40bca99d8 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -7,6 +7,7 @@ 3D area that detects [CollisionObject3D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses. To give the area its shape, add a [CollisionShape3D] or a [CollisionPolygon3D] node as a [i]direct[/i] child (or add multiple such nodes as direct children) of the area. [b]Warning:[/b] See [ConcavePolygonShape3D] (also called "trimesh") for a warning about possibly unexpected behavior when using that shape for an area. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> 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/AudioStreamPlaybackPolyphonic.xml b/doc/classes/AudioStreamPlaybackPolyphonic.xml new file mode 100644 index 0000000000..8b0951153b --- /dev/null +++ b/doc/classes/AudioStreamPlaybackPolyphonic.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AudioStreamPlaybackPolyphonic" inherits="AudioStreamPlayback" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Playback instance for [AudioStreamPolyphonic]. + </brief_description> + <description> + Playback instance for [AudioStreamPolyphonic]. After setting the [code]stream[/code] property of [AudioStreamPlayer], [AudioStreamPlayer2D], or [AudioStreamPlayer3D], the playback instance can be obtained by calling [method AudioStreamPlayer.get_stream_playback], [method AudioStreamPlayer2D.get_stream_playback] or [method AudioStreamPlayer3D.get_stream_playback] methods. + </description> + <tutorials> + </tutorials> + <methods> + <method name="is_stream_playing" qualifiers="const"> + <return type="bool" /> + <param index="0" name="stream" type="int" /> + <description> + Return true whether the stream associated with an integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid. + </description> + </method> + <method name="play_stream"> + <return type="int" /> + <param index="0" name="stream" type="AudioStream" /> + <param index="1" name="from_offset" type="float" default="0" /> + <param index="2" name="volume_db" type="float" default="0" /> + <param index="3" name="pitch_scale" type="float" default="1.0" /> + <description> + Play an [AudioStream] at a given offset, volume and pitch scale. Playback starts immediately. + The return value is an unique integer ID that is associated to this playback stream and which can be used to control it. + This ID becomes invalid when the stream ends (if it does not loop), when the [AudioStreamPlaybackPolyphonic] is stopped, or when [method stop_stream] is called. + This function returns [constant INVALID_ID] if the amount of streams currently playing equals [member AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this value. + </description> + </method> + <method name="set_stream_pitch_scale"> + <return type="void" /> + <param index="0" name="stream" type="int" /> + <param index="1" name="pitch_scale" type="float" /> + <description> + Change the stream pitch scale. The [param stream] argument is an integer ID returned by [method play_stream]. + </description> + </method> + <method name="set_stream_volume"> + <return type="void" /> + <param index="0" name="stream" type="int" /> + <param index="1" name="volume_db" type="float" /> + <description> + Change the stream volume (in db). The [param stream] argument is an integer ID returned by [method play_stream]. + </description> + </method> + <method name="stop_stream"> + <return type="void" /> + <param index="0" name="stream" type="int" /> + <description> + Stop a stream. The [param stream] argument is an integer ID returned by [method play_stream], which becomes invalid after calling this function. + </description> + </method> + </methods> + <constants> + <constant name="INVALID_ID" value="-1"> + Returned by [method play_stream] in case it could not allocate a stream for playback. + </constant> + </constants> +</class> diff --git a/doc/classes/AudioStreamPolyphonic.xml b/doc/classes/AudioStreamPolyphonic.xml new file mode 100644 index 0000000000..baa1fc7037 --- /dev/null +++ b/doc/classes/AudioStreamPolyphonic.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AudioStreamPolyphonic" inherits="AudioStream" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. + </brief_description> + <description> + AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. + Playback control is done via the [AudioStreamPlaybackPolyphonic] instance set inside the player, which can be obtained via [method AudioStreamPlayer.get_stream_playback], [method AudioStreamPlayer2D.get_stream_playback] or [method AudioStreamPlayer3D.get_stream_playback] methods. Obtaining the playback instance is only valid after the [code]stream[/code] property is set as an [AudioStreamPolyphonic] in those players. + </description> + <tutorials> + </tutorials> + <members> + <member name="polyphony" type="int" setter="set_polyphony" getter="get_polyphony" default="32"> + Maximum amount of simultaneous streams that can be played. + </member> + </members> +</class> diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 79e65f3472..8fc44d7536 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -18,17 +18,19 @@ callable.call("invalid") # Invalid call, should have at least 2 arguments. [/gdscript] [csharp] - public void PrintArgs(object arg1, object arg2, object arg3 = null) + // Default parameter values are not supported. + public void PrintArgs(Variant arg1, Variant arg2, Variant arg3 = default) { GD.PrintS(arg1, arg2, arg3); } public void Test() { - Callable callable = new Callable(this, nameof(PrintArgs)); - callable.Call("hello", "world"); // Prints "hello world null". + // Invalid calls fail silently. + Callable callable = new Callable(this, MethodName.PrintArgs); + callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments. callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs". - callable.Call("invalid"); // Invalid call, should have at least 2 arguments. + callable.Call("invalid"); // Invalid call, should have 3 arguments. } [/csharp] [/codeblocks] diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 821117122c..2ff207acb7 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -5,8 +5,9 @@ </brief_description> <description> Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a [AnimatableBody3D]. However, they have two main uses: - [b]Kinematic characters:[/b] Character bodies have an API for moving objects with walls and slopes detection ([method move_and_slide] method), in addition to collision detection (also done with [method PhysicsBody3D.move_and_collide]). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics. - [b]Kinematic motion:[/b] Character bodies can also be used for kinematic motion (same functionality as [AnimatableBody3D]), which allows them to be moved by code and push other bodies on their path. + [i]Kinematic characters:[/i] Character bodies have an API for moving objects with walls and slopes detection ([method move_and_slide] method), in addition to collision detection (also done with [method PhysicsBody3D.move_and_collide]). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics. + [i]Kinematic motion:[/i] Character bodies can also be used for kinematic motion (same functionality as [AnimatableBody3D]), which allows them to be moved by code and push other bodies on their path. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> diff --git a/doc/classes/CollisionObject3D.xml b/doc/classes/CollisionObject3D.xml index 31b5842930..01b0d88326 100644 --- a/doc/classes/CollisionObject3D.xml +++ b/doc/classes/CollisionObject3D.xml @@ -5,6 +5,7 @@ </brief_description> <description> CollisionObject3D is the base class for physics objects. It can hold any number of collision [Shape3D]s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject3D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> </tutorials> diff --git a/doc/classes/CollisionPolygon3D.xml b/doc/classes/CollisionPolygon3D.xml index 7d718cff27..29e55367a8 100644 --- a/doc/classes/CollisionPolygon3D.xml +++ b/doc/classes/CollisionPolygon3D.xml @@ -6,6 +6,7 @@ <description> Allows editing a concave or convex collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates several [ConvexPolygonShape3D]s at run-time to represent the original polygon using convex decomposition. [b]Note:[/b] Since this is an editor-only helper, properties modified during gameplay will have no effect. + [b]Warning:[/b] A non-uniformly scaled CollisionPolygon3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change its [member polygon]'s vertices instead. </description> <tutorials> </tutorials> diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml index 304b46ba27..c5d05670e9 100644 --- a/doc/classes/CollisionShape3D.xml +++ b/doc/classes/CollisionShape3D.xml @@ -6,6 +6,7 @@ <description> Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject3D.shape_owner_get_shape] to get the actual shape. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area3D] to give it a detection shape, or add it to a [PhysicsBody3D] to create a solid object. + [b]Warning:[/b] A non-uniformly scaled CollisionShape3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size of its [member shape] resource instead. </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index d1387d088d..57278d9241 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -101,7 +101,7 @@ <return type="Color" /> <param index="0" name="over" type="Color" /> <description> - Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the [param over] color painted over this colour (including alpha). + Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the [param over] color painted over this color (including alpha). [codeblocks] [gdscript] var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 48b4df9126..ac2ea5be17 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -8,10 +8,10 @@ To get cancel action, you can use: [codeblocks] [gdscript] - get_cancel_button().pressed.connect(self.cancelled) + get_cancel_button().pressed.connect(self.canceled) [/gdscript] [csharp] - GetCancelButton().Pressed += Cancelled; + GetCancelButton().Pressed += Canceled; [/csharp] [/codeblocks] </description> 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/Cubemap.xml b/doc/classes/Cubemap.xml index 46ddede9b1..01ec4c40d7 100644 --- a/doc/classes/Cubemap.xml +++ b/doc/classes/Cubemap.xml @@ -11,4 +11,12 @@ </description> <tutorials> </tutorials> + <methods> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderCubemap]). + </description> + </method> + </methods> </class> diff --git a/doc/classes/CubemapArray.xml b/doc/classes/CubemapArray.xml index 2fd55b66c6..1b410671c1 100644 --- a/doc/classes/CubemapArray.xml +++ b/doc/classes/CubemapArray.xml @@ -12,4 +12,12 @@ </description> <tutorials> </tutorials> + <methods> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderCubemapArray]). + </description> + </method> + </methods> </class> diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml index b5e75dff68..fe597d0955 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -162,6 +162,8 @@ <param index="0" name="max_stages" type="int" default="5" /> <param index="1" name="tolerance_length" type="float" default="20.0" /> <description> + Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! + [param tolerance_length] controls the maximal distance between two neighboring points, before the segment has to be subdivided. </description> </method> </methods> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 362d792b39..72ac95a700 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -198,7 +198,7 @@ <param index="1" name="tolerance_length" type="float" default="0.2" /> <description> Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! - [param tolerance_length] controls the maximal distance between two neighbouring points, before the segment has to be subdivided. + [param tolerance_length] controls the maximal distance between two neighboring points, before the segment has to be subdivided. </description> </method> </methods> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 5f99ba82b8..03e5b5d1d8 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. diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 832adb6e98..b0657cab90 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1090,6 +1090,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"> @@ -1434,9 +1435,9 @@ <param index="0" name="vsync_mode" type="int" enum="DisplayServer.VSyncMode" /> <param index="1" name="window_id" type="int" default="0" /> <description> - Sets the V-Sync mode of the given window. + Sets the V-Sync mode of the given window. See also [member ProjectSettings.display/window/vsync/vsync_mode]. See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application. - Depending on the platform and used renderer, the engine will fall back to [constant VSYNC_ENABLED], if the desired mode is not supported. + Depending on the platform and used renderer, the engine will fall back to [constant VSYNC_ENABLED] if the desired mode is not supported. </description> </method> <method name="window_set_window_buttons_offset"> diff --git a/doc/classes/EditorCommandPalette.xml b/doc/classes/EditorCommandPalette.xml index 380c79fc1a..448a622ae4 100644 --- a/doc/classes/EditorCommandPalette.xml +++ b/doc/classes/EditorCommandPalette.xml @@ -16,7 +16,7 @@ [csharp] EditorCommandPalette commandPalette = GetEditorInterface().GetCommandPalette(); // ExternalCommand is a function that will be called with the command is executed. - Callable commandCallable = new Callable(this, nameof(ExternalCommand)); + Callable commandCallable = new Callable(this, MethodName.ExternalCommand); commandPalette.AddCommand("command", "test/command", commandCallable) [/csharp] [/codeblocks] diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index 4670e0c382..2c7d83a811 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -28,7 +28,7 @@ public override void _Ready() { - GetNode("LineEdit").TextSubmitted += OnTextEntered; + GetNode<LineEdit>("LineEdit").TextSubmitted += OnTextEntered; } private void OnTextEntered(string command) diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml index 00f5c7ddff..f76bc2c279 100644 --- a/doc/classes/FileSystemDock.xml +++ b/doc/classes/FileSystemDock.xml @@ -51,5 +51,10 @@ <description> </description> </signal> + <signal name="resource_removed"> + <param index="0" name="resource" type="Resource" /> + <description> + </description> + </signal> </signals> </class> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index c7d10078e8..29779e4a77 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -5,7 +5,8 @@ </brief_description> <description> 2D particle node used to create a variety of particle systems and effects. [GPUParticles2D] features an emitter that generates some number of particles at a given rate. - Use the [code]process_material[/code] property to add a [ParticleProcessMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. + Use the [member process_material] property to add a [ParticleProcessMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. + 2D particles can optionally collide with [LightOccluder2D] nodes (note: they don't collide with [PhysicsBody2D] nodes). </description> <tutorials> <link title="Particle systems (2D)">$DOCS_URL/tutorials/2d/particle_systems_2d.html</link> @@ -42,6 +43,7 @@ Number of particles emitted in one emission cycle. </member> <member name="collision_base_size" type="float" setter="set_collision_base_size" getter="get_collision_base_size" default="1.0"> + Multiplier for particle's collision radius. [code]1.0[/code] corresponds to the size of the sprite. </member> <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="GPUParticles2D.DrawOrder" default="1"> Particle draw order. Uses [enum DrawOrder] values. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index c504e26d58..3dbc024b14 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -69,7 +69,7 @@ } // Called when the HTTP request is completed. - private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body) + private void HttpRequestCompleted(int result, int responseCode, string[] headers, byte[] body) { var json = new JSON(); json.Parse(body.GetStringFromUTF8()); @@ -128,7 +128,7 @@ } // Called when the HTTP request is completed. - private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body) + private void HttpRequestCompleted(int result, int responseCode, string[] headers, byte[] body) { if (result != (int)HTTPRequest.Result.Success) { diff --git a/doc/classes/HeightMapShape3D.xml b/doc/classes/HeightMapShape3D.xml index 206981e547..f34870c500 100644 --- a/doc/classes/HeightMapShape3D.xml +++ b/doc/classes/HeightMapShape3D.xml @@ -14,10 +14,10 @@ Height map data, pool array must be of [member map_width] * [member map_depth] size. </member> <member name="map_depth" type="int" setter="set_map_depth" getter="get_map_depth" default="2"> - Depth of the height map data. Changing this will resize the [member map_data]. + Number of vertices in the depth of the height map. Changing this will resize the [member map_data]. </member> <member name="map_width" type="int" setter="set_map_width" getter="get_map_width" default="2"> - Width of the height map data. Changing this will resize the [member map_data]. + Number of vertices in the width of the height map. Changing this will resize the [member map_data]. </member> </members> </class> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 6ecf903fde..70e629974d 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -224,11 +224,18 @@ Returns [code]true[/code] if the system knows the specified device. This means that it sets all button and axis indices. Unknown joypads are not expected to match these constants, but you can still retrieve events from them. </description> </method> + <method name="is_key_label_pressed" qualifiers="const"> + <return type="bool" /> + <param index="0" name="keycode" type="int" enum="Key" /> + <description> + Returns [code]true[/code] if you are pressing the key with the [param keycode] printed on it. You can pass a [enum Key] constant or any Unicode character code. + </description> + </method> <method name="is_key_pressed" qualifiers="const"> <return type="bool" /> <param index="0" name="keycode" type="int" enum="Key" /> <description> - Returns [code]true[/code] if you are pressing the key in the current keyboard layout. You can pass a [enum Key] constant. + Returns [code]true[/code] if you are pressing the Latin key in the current keyboard layout. You can pass a [enum Key] constant. [method is_key_pressed] is only recommended over [method is_physical_key_pressed] in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use [method is_physical_key_pressed]. [b]Note:[/b] Due to keyboard ghosting, [method is_key_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. </description> @@ -368,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/InputEventKey.xml b/doc/classes/InputEventKey.xml index c3d682de9e..4d10a183d4 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -5,15 +5,42 @@ </brief_description> <description> Stores key presses on the keyboard. Supports key presses, key releases and [member echo] events. + [b]Note:[/b] Events received from the keyboard usually have all properties set. Event mappings should have only one of the [member keycode], [member physical_keycode] or [member unicode] set. + When events are compared, properties are checked in the following priority - [member keycode], [member physical_keycode] and [member unicode], events with the first matching value will be considered equal. </description> <tutorials> <link title="InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link> </tutorials> <methods> + <method name="as_text_key_label" qualifiers="const"> + <return type="String" /> + <description> + Returns a [String] representation of the event's [member key_label] and modifiers. + </description> + </method> + <method name="as_text_keycode" qualifiers="const"> + <return type="String" /> + <description> + Returns a [String] representation of the event's [member keycode] and modifiers. + </description> + </method> + <method name="as_text_physical_keycode" qualifiers="const"> + <return type="String" /> + <description> + Returns a [String] representation of the event's [member physical_keycode] and modifiers. + </description> + </method> + <method name="get_key_label_with_modifiers" qualifiers="const"> + <return type="int" enum="Key" /> + <description> + Returns the localized key label combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. + To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_key_label_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey]. + </description> + </method> <method name="get_keycode_with_modifiers" qualifiers="const"> <return type="int" enum="Key" /> <description> - Returns the keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. + Returns the Latin keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_keycode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey]. </description> </method> @@ -29,19 +56,36 @@ <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false"> If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down. </member> + <member name="key_label" type="int" setter="set_key_label" getter="get_key_label" enum="Key" default="0"> + Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character. + For keyboard layouts with a single label on the key, it is equivalent to [member keycode]. + To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.key_label)[/code] where [code]event[/code] is the [InputEventKey]. + [codeblock] + +-----+ +-----+ + | Q | | Q | - "Q" - keycode + | Й | | ض | - "Й" and "ض" - key_label + +-----+ +-----+ + [/codeblock] + </member> <member name="keycode" type="int" setter="set_keycode" getter="get_keycode" enum="Key" default="0"> - The key keycode, which corresponds to one of the [enum Key] constants. Represent key in the current keyboard layout. + Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey]. + [codeblock] + +-----+ +-----+ + | Q | | Q | - "Q" - keycode + | Й | | ض | - "Й" and "ض" - key_label + +-----+ +-----+ + [/codeblock] </member> <member name="physical_keycode" type="int" setter="set_physical_keycode" getter="get_physical_keycode" enum="Key" default="0"> - Key physical keycode, which corresponds to one of the [enum Key] constants. Represent the physical location of a key on the 101/102-key US QWERTY keyboard. + Represents the physical location of a key on the 101/102-key US QWERTY keyboard, which corresponds to one of the [enum Key] constants. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey]. </member> <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> If [code]true[/code], the key's state is pressed. If [code]false[/code], the key's state is released. </member> <member name="unicode" type="int" setter="set_unicode" getter="get_unicode" default="0"> - The key Unicode identifier (when relevant). Unicode identifiers for the composite characters and complex scripts may not be available unless IME input mode is active. See [method Window.set_ime_active] for more information. + The key Unicode character code (when relevant), shifted by modifier keys. Unicode character codes for composite characters and complex scripts may not be available unless IME input mode is active. See [method Window.set_ime_active] for more information. </member> </members> </class> diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml index c6311d780c..26b88e6ff2 100644 --- a/doc/classes/InputEventWithModifiers.xml +++ b/doc/classes/InputEventWithModifiers.xml @@ -10,6 +10,12 @@ <link title="InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link> </tutorials> <methods> + <method name="get_modifiers_mask" qualifiers="const"> + <return type="int" enum="KeyModifierMask" /> + <description> + Returns the keycode combination of modifier keys. + </description> + </method> <method name="is_command_or_control_pressed" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index fe7756faaf..95c39d535e 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -80,7 +80,7 @@ A typical household lightbulb can range from around 600 lumens to 1,200 lumens, a candle is about 13 lumens, while a streetlight can be approximately 60,000 lumens. </member> <member name="light_intensity_lux" type="float" setter="set_param" getter="get_param"> - Used by [DirectionalLight3D]s when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is [code]true[/code]. Sets the intensity of the light source measured in Lux. Lux is a measure pf luminous flux per unit area, it is equal to one lumen per square metre. Lux is the measure of how much light hits a surface at a given time. + Used by [DirectionalLight3D]s when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is [code]true[/code]. Sets the intensity of the light source measured in Lux. Lux is a measure of luminous flux per unit area, it is equal to one lumen per square meter. Lux is the measure of how much light hits a surface at a given time. On a clear sunny day a surface in direct sunlight may be approximately 100,000 lux, a typical room in a home may be approximately 50 lux, while the moonlit ground may be approximately 0.1 lux. </member> <member name="light_negative" type="bool" setter="set_negative" getter="is_negative" default="false"> diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index 53dae1a8e6..723e6bbf21 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -93,22 +93,28 @@ <constant name="BAKE_ERROR_OK" value="0" enum="BakeError"> Lightmap baking was successful. </constant> - <constant name="BAKE_ERROR_NO_LIGHTMAPPER" value="1" enum="BakeError"> + <constant name="BAKE_ERROR_NO_SCENE_ROOT" value="1" enum="BakeError"> + Lightmap baking failed because the root node for the edited scene could not be accessed. + </constant> + <constant name="BAKE_ERROR_FOREIGN_DATA" value="2" enum="BakeError"> + Lightmap baking failed as the lightmap data resource is embedded in a foreign resource. + </constant> + <constant name="BAKE_ERROR_NO_LIGHTMAPPER" value="3" enum="BakeError"> Lightmap baking failed as there is no lightmapper available in this Godot build. </constant> - <constant name="BAKE_ERROR_NO_SAVE_PATH" value="2" enum="BakeError"> + <constant name="BAKE_ERROR_NO_SAVE_PATH" value="4" enum="BakeError"> Lightmap baking failed as the [LightmapGIData] save path isn't configured in the resource. </constant> - <constant name="BAKE_ERROR_NO_MESHES" value="3" enum="BakeError"> + <constant name="BAKE_ERROR_NO_MESHES" value="5" enum="BakeError"> Lightmap baking failed as there are no meshes whose [member GeometryInstance3D.gi_mode] is [constant GeometryInstance3D.GI_MODE_STATIC] and with valid UV2 mapping in the current scene. You may need to select 3D scenes in the Import dock and change their global illumination mode accordingly. </constant> - <constant name="BAKE_ERROR_MESHES_INVALID" value="4" enum="BakeError"> + <constant name="BAKE_ERROR_MESHES_INVALID" value="6" enum="BakeError"> Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking. </constant> - <constant name="BAKE_ERROR_CANT_CREATE_IMAGE" value="5" enum="BakeError"> + <constant name="BAKE_ERROR_CANT_CREATE_IMAGE" value="7" enum="BakeError"> Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved. </constant> - <constant name="BAKE_ERROR_USER_ABORTED" value="6" enum="BakeError"> + <constant name="BAKE_ERROR_USER_ABORTED" value="8" enum="BakeError"> The user aborted the lightmap baking operation (typically by clicking the [b]Cancel[/b] button in the progress dialog). </constant> <constant name="ENVIRONMENT_MODE_DISABLED" value="0" enum="EnvironmentMode"> diff --git a/doc/classes/Marshalls.xml b/doc/classes/Marshalls.xml index 102e4b75ed..1eeb0be7ce 100644 --- a/doc/classes/Marshalls.xml +++ b/doc/classes/Marshalls.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Marshalls" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Data transformation (marshalling) and encoding helpers. + Data transformation (marshaling) and encoding helpers. </brief_description> <description> Provides data transformation and encoding utility functions. diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index c5d567c1fe..bdd5cee797 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -31,6 +31,12 @@ <description> </description> </method> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderMaterial]). + </description> + </method> <method name="inspect_native_shader_code"> <return type="void" /> <description> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 1c1f48588f..ece3199aab 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -114,6 +114,12 @@ [b]Note:[/b] This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise). </description> </method> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderMesh]). + </description> + </method> <method name="create_trimesh_shape" qualifiers="const"> <return type="ConcavePolygonShape3D" /> <description> 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/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 02fd6dae30..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"> @@ -909,6 +909,9 @@ <constant name="NOTIFICATION_ENABLED" value="29"> Notification received when the node is enabled again after being disabled. See [constant PROCESS_MODE_DISABLED]. </constant> + <constant name="NOTIFICATION_NODE_RECACHE_REQUESTED" value="30"> + Notification received when other nodes in the tree may have been removed/replaced and node pointers may require re-caching. + </constant> <constant name="NOTIFICATION_EDITOR_PRE_SAVE" value="9001"> Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. </constant> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 1bc81ffb42..0058bf8a2f 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -566,7 +566,7 @@ <method name="open_midi_inputs"> <return type="void" /> <description> - Initialises the singleton for the system MIDI driver. + Initializes the singleton for the system MIDI driver. [b]Note:[/b] This method is implemented on Linux, macOS and Windows. </description> </method> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index a9e17f4666..e4607456ca 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -305,7 +305,7 @@ [/gdscript] [csharp] var node = new Node3D(); - node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f); + node.Call(Node3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. @@ -323,7 +323,7 @@ [/gdscript] [csharp] var node = new Node3D(); - node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f); + node.CallDeferred(Node3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. @@ -342,7 +342,7 @@ [/gdscript] [csharp] var node = new Node3D(); - node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f }); + node.Callv(Node3D.MethodName.Rotate, new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f }); [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call @@ -394,8 +394,8 @@ // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); - // Signals as events (`player.Hit += OnPlayerHit;`) do not support argument binding. You have to use: - player.Hit.Connect(OnPlayerHit, new Godot.Collections.Array {"sword", 100 }); + // We can use lambdas when we need to bind additional parameters. + player.Hit += () => OnPlayerHit("sword", 100); } private void OnButtonDown() @@ -405,7 +405,7 @@ private void OnPlayerHit(string weaponType, int damage) { - GD.Print(String.Format("Hit with weapon {0} for {1} damage.", weaponType, damage)); + GD.Print($"Hit with weapon {weaponType} for {damage} damage."); } [/csharp] [/codeblocks] @@ -431,16 +431,12 @@ public override void _Ready() { var button = new Button(); - // Option 1: Object.Connect() with an implicit Callable for the defined function. - button.Connect("button_down", OnButtonDown); - // Option 2: Object.connect() with a constructed Callable using a target object and method name. - button.Connect("button_down", new Callable(self, nameof(OnButtonDown))); - // Option 3: Signal.connect() with an implicit Callable for the defined function. - button.ButtonDown.Connect(OnButtonDown); - // Option 3b: In C#, we can use signals as events and connect with this more idiomatic syntax: + // Option 1: In C#, we can use signals as events and connect with this idiomatic syntax: button.ButtonDown += OnButtonDown; - // Option 4: Signal.connect() with a constructed Callable using a target object and method name. - button.ButtonDown.Connect(new Callable(self, nameof(OnButtonDown))); + // Option 2: Object.Connect() with a constructed Callable from a method group. + button.Connect(Button.SignalName.ButtonDown, Callable.From(OnButtonDown)); + // Option 3: Object.Connect() with a constructed Callable using a target object and method name. + button.Connect(Button.SignalName.ButtonDown, new Callable(this, MethodName.OnButtonDown)); } private void OnButtonDown() @@ -458,6 +454,7 @@ func _ready(): # This assumes that a `Player` class exists, which defines a `hit` signal. var player = Player.new() + # Using Callable.bind(). player.hit.connect(_on_player_hit.bind("sword", 100)) # Parameters added when emitting the signal are passed first. @@ -473,20 +470,19 @@ { // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); - // Option 1: Using Callable.Bind(). This way we can still use signals as events. - player.Hit += OnPlayerHit.Bind("sword", 100); - // Option 2: Using a `binds` Array in Signal.Connect(). - player.Hit.Connect(OnPlayerHit, new Godot.Collections.Array{ "sword", 100 }); + // Using lambda expressions that create a closure that captures the additional parameters. + // The lambda only receives the parameters defined by the signal's delegate. + player.Hit += (hitBy, level) => OnPlayerHit(hitBy, level, "sword", 100); // Parameters added when emitting the signal are passed first. - player.EmitSignal("hit", "Dark lord", 5); + player.EmitSignal(SignalName.Hit, "Dark lord", 5); } // We pass two arguments when emitting (`hit_by`, `level`), // and bind two more arguments when connecting (`weapon_type`, `damage`). private void OnPlayerHit(string hitBy, int level, string weaponType, int damage) { - GD.Print(String.Format("Hit by {0} (level {1}) with weapon {2} for {3} damage.", hitBy, level, weaponType, damage)); + GD.Print($"Hit by {hitBy} (level {level}) with weapon {weaponType} for {damage} damage."); } [/csharp] [/codeblocks] @@ -512,8 +508,8 @@ emit_signal("game_over") [/gdscript] [csharp] - EmitSignal("Hit", "sword", 100); - EmitSignal("GameOver"); + EmitSignal(SignalName.Hit, "sword", 100); + EmitSignal(SignalName.GameOver); [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. @@ -581,7 +577,7 @@ var b = node.GetIndexed("position:y"); // b is -10 [/csharp] [/codeblocks] - [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. + [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. [b]Note:[/b] This method does not support actual paths to nodes in the [SceneTree], only sub-property paths. In the context of nodes, use [method Node.get_node_and_resource] instead. </description> </method> @@ -868,7 +864,7 @@ GD.Print(node.Position); // Prints (42, -10) [/csharp] [/codeblocks] - [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. + [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="set_message_translation"> @@ -883,7 +879,7 @@ <param index="0" name="name" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> - Adds or changes the entry [param name] inside the object's metadata. The metadata [param value] can be any [Variant], although some types cannot be serialised correctly. + Adds or changes the entry [param name] inside the object's metadata. The metadata [param value] can be any [Variant], although some types cannot be serialized correctly. If [param value] is [code]null[/code], the entry is removed. This is the equivalent of using [method remove_meta]. See also [method has_meta] and [method get_meta]. [b]Note:[/b] Metadata that has a [param name] starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector dock and should not be edited. </description> diff --git a/doc/classes/ParticleProcessMaterial.xml b/doc/classes/ParticleProcessMaterial.xml index d4050e3bd1..d046d52ed1 100644 --- a/doc/classes/ParticleProcessMaterial.xml +++ b/doc/classes/ParticleProcessMaterial.xml @@ -123,7 +123,8 @@ </member> <member name="collision_mode" type="int" setter="set_collision_mode" getter="get_collision_mode" enum="ParticleProcessMaterial.CollisionMode" default="0"> The particles' collision mode. - [b]Note:[/b] Particles can only collide with [GPUParticlesCollision3D] nodes, not [PhysicsBody3D] nodes. To make particles collide with various objects, you can add [GPUParticlesCollision3D] nodes as children of [PhysicsBody3D] nodes. + [b]Note:[/b] 3D Particles can only collide with [GPUParticlesCollision3D] nodes, not [PhysicsBody3D] nodes. To make particles collide with various objects, you can add [GPUParticlesCollision3D] nodes as children of [PhysicsBody3D] nodes. + [b]Note:[/b] 2D Particles can only collide with [LightOccluder2D] nodes, not [PhysicsBody2D] nodes. </member> <member name="collision_use_scale" type="bool" setter="set_collision_use_scale" getter="is_collision_using_scale" default="false"> Should collision take scale into account. diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 6b7daa534e..493af8aff2 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -45,7 +45,7 @@ [csharp] public override void _Ready() { - var monitorValue = new Callable(this, nameof(GetMonitorValue)); + var monitorValue = new Callable(this, MethodName.GetMonitorValue); // Adds monitor with name "MyName" to category "MyCategory". Performance.AddCustomMonitor("MyCategory/MyMonitor", monitorValue); diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index 0768df31cc..f38130fe0c 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -3,6 +3,7 @@ <brief_description> </brief_description> <description> + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> </tutorials> diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml index 2ef54683f2..3e100e3280 100644 --- a/doc/classes/PhysicsBody3D.xml +++ b/doc/classes/PhysicsBody3D.xml @@ -4,7 +4,8 @@ Base class for all objects affected by physics in 3D space. </brief_description> <description> - PhysicsBody3D is an abstract base class for implementing a physics body. All *Body types inherit from it. + PhysicsBody3D is an abstract base class for implementing a physics body. All *Body3D types inherit from it. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index bd68dc7a64..430f1c60fd 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -384,6 +384,9 @@ <member name="debug/gdscript/warnings/assert_always_true" type="int" setter="" getter="" default="1"> When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to true. </member> + <member name="debug/gdscript/warnings/confusable_identifier" type="int" setter="" getter="" default="1"> + When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an identifier contains characters that can be confused with something else, like when mixing different alphabets. + </member> <member name="debug/gdscript/warnings/constant_used_as_function" type="int" setter="" getter="" default="1"> When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a constant is used as a function. </member> @@ -659,7 +662,8 @@ <member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1"> Sets the V-Sync mode for the main game window. See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application. - Depending on the platform and used renderer, the engine will fall back to [code]Enabled[/code], if the desired mode is not supported. + Depending on the platform and used renderer, the engine will fall back to [code]Enabled[/code] if the desired mode is not supported. + [b]Note:[/b] This property is only read when the project starts. To change the V-Sync mode at runtime, call [method DisplayServer.window_set_vsync_mode] instead. </member> <member name="dotnet/project/assembly_name" type="String" setter="" getter="" default=""""> Name of the .NET assembly. This name is used as the name of the [code].csproj[/code] and [code].sln[/code] files. By default, it's set to the name of the project ([member application/config/name]) allowing to change it in the future without affecting the .NET assembly. @@ -694,10 +698,16 @@ <member name="editor/movie_writer/speaker_mode" type="int" setter="" getter="" default="0"> The speaker mode to use in the recorded audio when writing a movie. See [enum AudioServer.SpeakerMode] for possible values. </member> - <member name="editor/node_naming/name_casing" type="int" setter="" getter="" default="0"> + <member name="editor/naming/default_signal_callback_name" type="String" setter="" getter="" default=""_on_{node_name}_{signal_name}""> + The format of the default signal callback name (in the Signal Connection Dialog). The following substitutions are available: [code]{NodeName}[/code], [code]{nodeName}[/code], [code]{node_name}[/code], [code]{SignalName}[/code], [code]{signalName}[/code], and [code]{signal_name}[/code]. + </member> + <member name="editor/naming/default_signal_callback_to_self_name" type="String" setter="" getter="" default=""_on_{signal_name}""> + The format of the default signal callback name when a signal connects to the same node that emits it (in the Signal Connection Dialog). The following substitutions are available: [code]{NodeName}[/code], [code]{nodeName}[/code], [code]{node_name}[/code], [code]{SignalName}[/code], [code]{signalName}[/code], and [code]{signal_name}[/code]. + </member> + <member name="editor/naming/node_name_casing" type="int" setter="" getter="" default="0"> When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. </member> - <member name="editor/node_naming/name_num_separator" type="int" setter="" getter="" default="0"> + <member name="editor/naming/node_name_num_separator" type="int" setter="" getter="" default="0"> What to use to separate node name from number. This is mostly an editor setting. </member> <member name="editor/run/main_run_args" type="String" setter="" getter="" default=""""> diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml index 602833bca5..99e3f1725f 100644 --- a/doc/classes/Projection.xml +++ b/doc/classes/Projection.xml @@ -149,7 +149,7 @@ <param index="4" name="flip_fov" type="bool" /> <param index="5" name="eye" type="int" /> <param index="6" name="intraocular_dist" type="float" /> - <param index="7" name=" convergence_dist" type="float" /> + <param index="7" name="convergence_dist" type="float" /> <description> Creates a new [Projection] that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on. [param eye] creates the projection for the left eye when set to 1, or the right eye when set to 2. diff --git a/doc/classes/RemoteTransform2D.xml b/doc/classes/RemoteTransform2D.xml index 20fa41a3f0..6f100541be 100644 --- a/doc/classes/RemoteTransform2D.xml +++ b/doc/classes/RemoteTransform2D.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="RemoteTransform2D" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - RemoteTransform2D pushes its own [Transform2D] to another [CanvasItem] derived Node in the scene. + RemoteTransform2D pushes its own [Transform2D] to another [Node2D] derived node in the scene. </brief_description> <description> - RemoteTransform2D pushes its own [Transform2D] to another [CanvasItem] derived Node (called the remote node) in the scene. - It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. + RemoteTransform2D pushes its own [Transform2D] to another [Node2D] derived node (called the remote node) in the scene. + It can be set to update another node's position, rotation and/or scale. It can use either global or local coordinates. </description> <tutorials> </tutorials> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index e533fc1e32..67f466ad4c 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -24,7 +24,8 @@ <param index="0" name="subresources" type="bool" default="false" /> <description> Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original. - If [param subresources] is [code]false[/code], a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overridden by the [constant PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE] flag. + If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared from the original resource. If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared. + Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated even with [param subresources] set to [code]false[/code], and properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated even with [param subresources] set to [code]true[/code]. [b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters. </description> </method> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 5550bf0955..1ecc8a1d4e 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -8,7 +8,7 @@ [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods. [b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code][b]bold[i]bold italic[/b]italic[/i][/code], use [code][b]bold[i]bold italic[/i][/b][i]italic[/i][/code]. [b]Note:[/b] [code]push_*/pop[/code] functions won't affect BBCode. - [b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property. + [b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content] property. </description> <tutorials> <link title="BBCode in RichTextLabel">$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link> @@ -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" /> @@ -474,9 +482,8 @@ <member name="deselect_on_focus_loss_enabled" type="bool" setter="set_deselect_on_focus_loss_enabled" getter="is_deselect_on_focus_loss_enabled" default="true"> If [code]true[/code], the selected text will be deselected when focus is lost. </member> - <member name="fit_content_height" type="bool" setter="set_fit_content_height" getter="is_fit_content_height_enabled" default="false"> - If [code]true[/code], the label's height will be automatically updated to fit its content. - [b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions. + <member name="fit_content" type="bool" setter="set_fit_content" getter="is_fit_content_enabled" default="false"> + If [code]true[/code], the label's minimum size will be automatically updated to fit its content, matching the behavior of [Label]. </member> <member name="hint_underlined" type="bool" setter="set_hint_underline" getter="is_hint_underlined" default="true"> If [code]true[/code], the label underlines hint tags such as [code][hint=description]{text}[/hint][/code]. diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index 8380d56de3..148cdf96ee 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -8,6 +8,7 @@ You can switch the body's behavior using [member lock_rotation], [member freeze], and [member freeze_mode]. [b]Note:[/b] Don't change a RigidBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator]. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 3412cd2140..71905e8b2e 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -16,12 +16,12 @@ [/gdscript] [csharp] [Signal] - delegate void Attacked(); + delegate void AttackedEventHandler(); // Additional arguments may be declared. // These arguments must be passed when the signal is emitted. [Signal] - delegate void ItemDropped(itemName: string, amount: int); + delegate void ItemDroppedEventHandler(string itemName, int amount); [/csharp] [/codeblocks] </description> diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml index 0beaa6bb52..7bebd46004 100644 --- a/doc/classes/StaticBody3D.xml +++ b/doc/classes/StaticBody3D.xml @@ -7,8 +7,9 @@ Static body for 3D physics. A static body is a simple body that doesn't move under physics simulation, i.e. it can't be moved by external forces or contacts but its transformation can still be updated manually by the user. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody3D], it doesn't consume any CPU resources as long as they don't move. They have extra functionalities to move and affect other bodies: - [b]Static transform change:[/b] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. - [b]Constant velocity:[/b] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. + [i]Static transform change:[/i] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. + [i]Constant velocity:[/i] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index ff6d4d8821..4a63f4488c 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -17,21 +17,16 @@ <description> </description> </method> - <method name="_get_center_size" qualifiers="virtual const"> - <return type="Vector2" /> - <description> - </description> - </method> <method name="_get_draw_rect" qualifiers="virtual const"> <return type="Rect2" /> <param index="0" name="rect" type="Rect2" /> <description> </description> </method> - <method name="_get_style_margin" qualifiers="virtual const"> - <return type="float" /> - <param index="0" name="side" type="int" enum="Side" /> + <method name="_get_minimum_size" qualifiers="virtual const"> + <return type="Vector2" /> <description> + Virtual method to be implemented by the user. Returns a custom minimum size that the stylebox must respect when drawing. By default [method get_minimum_size] only takes content margins into account. This method can be overridden to add another size restriction. A combination of the default behavior and the output of this method will be used, to account for both sizes. </description> </method> <method name="_test_mask" qualifiers="virtual const"> @@ -50,10 +45,11 @@ The [RID] value can either be the result of [method CanvasItem.get_canvas_item] called on an existing [CanvasItem]-derived node, or directly from creating a canvas item in the [RenderingServer] with [method RenderingServer.canvas_item_create]. </description> </method> - <method name="get_center_size" qualifiers="const"> - <return type="Vector2" /> + <method name="get_content_margin" qualifiers="const"> + <return type="float" /> + <param index="0" name="margin" type="int" enum="Side" /> <description> - Returns the size of this [StyleBox] without the margins. + Returns the default margin of the specified [enum Side]. </description> </method> <method name="get_current_item_drawn" qualifiers="const"> @@ -62,13 +58,6 @@ Returns the [CanvasItem] that handles its [constant CanvasItem.NOTIFICATION_DRAW] or [method CanvasItem._draw] callback at this moment. </description> </method> - <method name="get_default_margin" qualifiers="const"> - <return type="float" /> - <param index="0" name="margin" type="int" enum="Side" /> - <description> - Returns the default margin of the specified [enum Side]. - </description> - </method> <method name="get_margin" qualifiers="const"> <return type="float" /> <param index="0" name="margin" type="int" enum="Side" /> @@ -89,7 +78,7 @@ Returns the "offset" of a stylebox. This helper function returns a value equivalent to [code]Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))[/code]. </description> </method> - <method name="set_default_margin"> + <method name="set_content_margin"> <return type="void" /> <param index="0" name="margin" type="int" enum="Side" /> <param index="1" name="offset" type="float" /> @@ -97,7 +86,7 @@ Sets the default value of the specified [enum Side] to [param offset] pixels. </description> </method> - <method name="set_default_margin_all"> + <method name="set_content_margin_all"> <return type="void" /> <param index="0" name="offset" type="float" /> <description> @@ -114,21 +103,21 @@ </method> </methods> <members> - <member name="content_margin_bottom" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_bottom" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0"> The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. If this value is negative, it is ignored and a child-specific margin is used instead. For example for [StyleBoxFlat] the border thickness (if any) is used instead. It is up to the code using this style box to decide what these contents are: for example, a [Button] respects this content margin for the textual contents of the button. [method get_margin] should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. </member> - <member name="content_margin_left" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_left" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0"> The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. Refer to [member content_margin_bottom] for extra considerations. </member> - <member name="content_margin_right" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_right" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0"> The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. Refer to [member content_margin_bottom] for extra considerations. </member> - <member name="content_margin_top" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_top" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0"> The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. Refer to [member content_margin_bottom] for extra considerations. </member> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index aeba777b43..745187ed63 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -9,36 +9,36 @@ <tutorials> </tutorials> <methods> - <method name="get_expand_margin_size" qualifiers="const"> + <method name="get_expand_margin" qualifiers="const"> <return type="float" /> <param index="0" name="margin" type="int" enum="Side" /> <description> Returns the expand margin size of the specified [enum Side]. </description> </method> - <method name="get_margin_size" qualifiers="const"> + <method name="get_texture_margin" qualifiers="const"> <return type="float" /> <param index="0" name="margin" type="int" enum="Side" /> <description> Returns the margin size of the specified [enum Side]. </description> </method> - <method name="set_expand_margin_all"> + <method name="set_expand_margin"> <return type="void" /> - <param index="0" name="size" type="float" /> + <param index="0" name="margin" type="int" enum="Side" /> + <param index="1" name="size" type="float" /> <description> - Sets the expand margin to [param size] pixels for all margins. + Sets the expand margin to [param size] pixels for the specified [enum Side]. </description> </method> - <method name="set_expand_margin_size"> + <method name="set_expand_margin_all"> <return type="void" /> - <param index="0" name="margin" type="int" enum="Side" /> - <param index="1" name="size" type="float" /> + <param index="0" name="size" type="float" /> <description> - Sets the expand margin to [param size] pixels for the specified [enum Side]. + Sets the expand margin to [param size] pixels for all margins. </description> </method> - <method name="set_margin_size"> + <method name="set_texture_margin"> <return type="void" /> <param index="0" name="margin" type="int" enum="Side" /> <param index="1" name="size" type="float" /> @@ -46,7 +46,7 @@ Sets the margin to [param size] pixels for the specified [enum Side]. </description> </method> - <method name="set_margin_size_all"> + <method name="set_texture_margin_all"> <return type="void" /> <param index="0" name="size" type="float" /> <description> @@ -64,48 +64,48 @@ <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true"> If [code]true[/code], the nine-patch texture's center tile will be drawn. </member> - <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0"> + <member name="expand_margin_bottom" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. </member> - <member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0"> + <member name="expand_margin_left" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. </member> - <member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0"> + <member name="expand_margin_right" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. </member> - <member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0"> + <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. </member> - <member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0"> + <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> + Modulates the color of the texture when this style box is drawn. + </member> + <member name="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. + </member> + <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> + The texture to use when drawing this style box. + </member> + <member name="texture_margin_bottom" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> Increases the bottom margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative. </member> - <member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0"> + <member name="texture_margin_left" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> Increases the left margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative. </member> - <member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0"> + <member name="texture_margin_right" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> Increases the right margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative. </member> - <member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0"> + <member name="texture_margin_top" type="float" setter="set_texture_margin" getter="get_texture_margin" default="0.0"> Increases the top margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative. </member> - <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> - Modulates the color of the texture when this style box is drawn. - </member> - <member name="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. - </member> - <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> - The texture to use when drawing this style box. - </member> </members> <constants> <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode"> 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 1efd0f9326..ccd79cd170 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -696,7 +696,7 @@ <method name="merge_overlapping_carets"> <return type="void" /> <description> - Merges any overlapping carets. Will favour the newest caret, or the caret with a selection. + Merges any overlapping carets. Will favor the newest caret, or the caret with a selection. [b]Note:[/b] This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap. </description> </method> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index aac197090a..7329ebb868 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -74,6 +74,12 @@ Called when a pixel's opaque state in the [Texture2D] is queried at the specified [code](x, y)[/code] position. </description> </method> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderTexture2D]). + </description> + </method> <method name="draw" qualifiers="const"> <return type="void" /> <param index="0" name="canvas_item" type="RID" /> diff --git a/doc/classes/Texture2DArray.xml b/doc/classes/Texture2DArray.xml index ec00198db1..6c9fb55bef 100644 --- a/doc/classes/Texture2DArray.xml +++ b/doc/classes/Texture2DArray.xml @@ -10,4 +10,12 @@ </description> <tutorials> </tutorials> + <methods> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderTexture2DArray]). + </description> + </method> + </methods> </class> diff --git a/doc/classes/Texture3D.xml b/doc/classes/Texture3D.xml index 1a66932d62..d2df82a74d 100644 --- a/doc/classes/Texture3D.xml +++ b/doc/classes/Texture3D.xml @@ -47,6 +47,12 @@ Called when the presence of mipmaps in the [Texture3D] is queried. </description> </method> + <method name="create_placeholder" qualifiers="const"> + <return type="Resource" /> + <description> + Creates a placeholder version of this resource ([PlaceholderTexture3D]). + </description> + </method> <method name="get_data" qualifiers="const"> <return type="Image[]" /> <description> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 7fc6ba8161..a812b52307 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -589,7 +589,7 @@ <param index="0" name="terrain_set" type="int" /> <param index="1" name="mode" type="int" enum="TileSet.TerrainMode" /> <description> - Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighbouring tiles' terrains. + Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighboring tiles' terrains. </description> </method> </methods> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index ff5a665bfd..cf28dafcc9 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -401,7 +401,7 @@ </signal> <signal name="item_activated"> <description> - Emitted when an item's label is double-clicked. + Emitted when an item is double-clicked, or selected with a [code]ui_accept[/code] input event (e.g. using [kbd]Enter[/kbd] or [kbd]Space[/kbd] on the keyboard). </description> </signal> <signal name="item_collapsed"> @@ -415,14 +415,14 @@ Emitted when a custom button is pressed (i.e. in a [constant TreeItem.CELL_MODE_CUSTOM] mode cell). </description> </signal> - <signal name="item_double_clicked"> + <signal name="item_edited"> <description> - Emitted when an item's icon is double-clicked. + Emitted when an item is edited. </description> </signal> - <signal name="item_edited"> + <signal name="item_icon_double_clicked"> <description> - Emitted when an item is edited. + Emitted when an item's icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see [signal item_activated]. </description> </signal> <signal name="item_mouse_selected"> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index fc0dd9f05d..9bb92cf362 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -19,7 +19,7 @@ Tween tween = GetTree().CreateTween(); tween.TweenProperty(GetNode("Sprite"), "modulate", Colors.Red, 1.0f); tween.TweenProperty(GetNode("Sprite"), "scale", Vector2.Zero, 1.0f); - tween.TweenCallback(new Callable(GetNode("Sprite").QueueFree)); + tween.TweenCallback(Callable.From(GetNode("Sprite").QueueFree)); [/csharp] [/codeblocks] This sequence will make the [code]$Sprite[/code] node turn red, then shrink, before finally calling [method Node.queue_free] to free the sprite. [Tweener]s are executed one after another by default. This behavior can be changed using [method parallel] and [method set_parallel]. @@ -35,7 +35,7 @@ Tween tween = GetTree().CreateTween(); tween.TweenProperty(GetNode("Sprite"), "modulate", Colors.Red, 1.0f).SetTrans(Tween.TransitionType.Sine); tween.TweenProperty(GetNode("Sprite"), "scale", Vector2.Zero, 1.0f).SetTrans(Tween.TransitionType.Bounce); - tween.TweenCallback(new Callable(GetNode("Sprite").QueueFree)); + tween.TweenCallback(Callable.From(GetNode("Sprite").QueueFree)); [/csharp] [/codeblocks] Most of the [Tween] methods can be chained this way too. In the following example the [Tween] is bound to the running script's node and a default transition is set for its [Tweener]s: @@ -50,7 +50,7 @@ var tween = GetTree().CreateTween().BindNode(this).SetTrans(Tween.TransitionType.Elastic); tween.TweenProperty(GetNode("Sprite"), "modulate", Colors.Red, 1.0f); tween.TweenProperty(GetNode("Sprite"), "scale", Vector2.Zero, 1.0f); - tween.TweenCallback(new Callable(GetNode("Sprite").QueueFree)); + tween.TweenCallback(Callable.From(GetNode("Sprite").QueueFree)); [/csharp] [/codeblocks] Another interesting use for [Tween]s is animating arbitrary sets of objects: @@ -281,7 +281,7 @@ [/gdscript] [csharp] Tween tween = GetTree().CreateTween().SetLoops(); - tween.TweenCallback(new Callable(Shoot)).SetDelay(1.0f); + tween.TweenCallback(Callable.From(Shoot)).SetDelay(1.0f); [/csharp] [/codeblocks] [b]Example:[/b] Turning a sprite red and then blue, with 2 second delay: @@ -294,8 +294,8 @@ [csharp] Tween tween = GetTree().CreateTween(); Sprite2D sprite = GetNode<Sprite2D>("Sprite"); - tween.TweenCallback(new Callable(() => sprite.Modulate = Colors.Red)).SetDelay(2.0f); - tween.TweenCallback(new Callable(() => sprite.Modulate = Colors.Blue)).SetDelay(2.0f); + tween.TweenCallback(Callable.From(() => sprite.Modulate = Colors.Red)).SetDelay(2.0f); + tween.TweenCallback(Callable.From(() => sprite.Modulate = Colors.Blue)).SetDelay(2.0f); [/csharp] [/codeblocks] </description> @@ -332,10 +332,10 @@ [csharp] Tween tween = CreateTween().SetLoops(); tween.TweenProperty(GetNode("Sprite"), "position:x", 200.0f, 1.0f).AsRelative(); - tween.TweenCallback(new Callable(Jump)); + tween.TweenCallback(Callable.From(Jump)); tween.TweenInterval(2.0f); tween.TweenProperty(GetNode("Sprite"), "position:x", -200.0f, 1.0f).AsRelative(); - tween.TweenCallback(new Callable(Jump)); + tween.TweenCallback(Callable.From(Jump)); tween.TweenInterval(2.0f); [/csharp] [/codeblocks] @@ -357,7 +357,7 @@ [/gdscript] [csharp] Tween tween = CreateTween(); - tween.TweenMethod(new Callable(() => LookAt(Vector3.Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), 1.0f); // The LookAt() method takes up vector as second argument. + tween.TweenMethod(Callable.From(() => LookAt(Vector3.Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), 1.0f); // The LookAt() method takes up vector as second argument. [/csharp] [/codeblocks] [b]Example:[/b] Setting the text of a [Label], using an intermediate method and after a delay: @@ -376,7 +376,7 @@ base._Ready(); Tween tween = CreateTween(); - tween.TweenMethod(new Callable(SetLabelText), 0.0f, 10.0f, 1.0f).SetDelay(1.0f); + tween.TweenMethod(Callable.From<int>(SetLabelText), 0.0f, 10.0f, 1.0f).SetDelay(1.0f); } private void SetLabelText(int value) diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 42baf7728d..6c151ef958 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -48,10 +48,10 @@ { var node = GetNode<Node2D>("MyNode2D"); UndoRedo.CreateAction("Move the node"); - UndoRedo.AddDoMethod(this, nameof(DoSomething)); - UndoRedo.AddUndoMethod(this, nameof(UndoSomething)); - UndoRedo.AddDoProperty(node, "position", new Vector2(100, 100)); - UndoRedo.AddUndoProperty(node, "position", node.Position); + UndoRedo.AddDoMethod(this, MethodName.DoSomething); + UndoRedo.AddUndoMethod(this, MethodName.UndoSomething); + UndoRedo.AddDoProperty(node, Node2D.PropertyName.Position, new Vector2(100, 100)); + UndoRedo.AddUndoProperty(node, Node2D.PropertyName.Position, node.Position); UndoRedo.CommitAction(); } [/csharp] diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml index e1689133de..9f905c0ec5 100644 --- a/doc/classes/VehicleBody3D.xml +++ b/doc/classes/VehicleBody3D.xml @@ -7,6 +7,7 @@ This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape3D] for the main body of your vehicle and add [VehicleWheel3D] nodes for the wheels. You should also add a [MeshInstance3D] to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [member brake], [member engine_force], and [member steering] properties and not change the position or orientation of this node directly. [b]Note:[/b] The origin point of your VehicleBody3D will determine the center of gravity of your vehicle so it is better to keep this low and move the [CollisionShape3D] and [MeshInstance3D] upwards. [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class. + [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. </description> <tutorials> <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> 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> diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml index 9e192177e5..0b21002893 100644 --- a/doc/classes/XRController3D.xml +++ b/doc/classes/XRController3D.xml @@ -13,11 +13,18 @@ <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> - <method name="get_axis" qualifiers="const"> - <return type="Vector2" /> + <method name="get_float" qualifiers="const"> + <return type="float" /> <param index="0" name="name" type="StringName" /> <description> - Returns a [Vector2] for the input with the given [param name]. This is used for thumbsticks and thumbpads found on many controllers. + Returns a numeric value for the input with the given [param name]. This is used for triggers and grip sensors. + </description> + </method> + <method name="get_input" qualifiers="const"> + <return type="Variant" /> + <param index="0" name="name" type="StringName" /> + <description> + Returns a [Variant] for the input with the given [param name]. This works for any input type, the variant will be typed according to the actions configuration. </description> </method> <method name="get_tracker_hand" qualifiers="const"> @@ -26,11 +33,11 @@ Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand]. </description> </method> - <method name="get_value" qualifiers="const"> - <return type="float" /> + <method name="get_vector2" qualifiers="const"> + <return type="Vector2" /> <param index="0" name="name" type="StringName" /> <description> - Returns a numeric value for the input with the given [param name]. This is used for triggers and grip sensors. + Returns a [Vector2] for the input with the given [param name]. This is used for thumbsticks and thumbpads found on many controllers. </description> </method> <method name="is_button_pressed" qualifiers="const"> @@ -54,18 +61,18 @@ Emitted when a button on this controller is released. </description> </signal> - <signal name="input_axis_changed"> + <signal name="input_float_changed"> <param index="0" name="name" type="String" /> - <param index="1" name="value" type="Vector2" /> + <param index="1" name="value" type="float" /> <description> - Emitted when a thumbstick or thumbpad on this controller is moved. + Emitted when a trigger or similar input on this controller changes value. </description> </signal> - <signal name="input_value_changed"> + <signal name="input_vector2_changed"> <param index="0" name="name" type="String" /> - <param index="1" name="value" type="float" /> + <param index="1" name="value" type="Vector2" /> <description> - Emitted when a trigger or similar input on this controller changes value. + Emitted when a thumbstick or thumbpad on this controller is moved. </description> </signal> </signals> diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml index db2910f25e..93e6a5497c 100644 --- a/doc/classes/XRPositionalTracker.xml +++ b/doc/classes/XRPositionalTracker.xml @@ -92,18 +92,18 @@ Emitted when a button on this tracker is released. </description> </signal> - <signal name="input_axis_changed"> + <signal name="input_float_changed"> <param index="0" name="name" type="String" /> - <param index="1" name="vector" type="Vector2" /> + <param index="1" name="value" type="float" /> <description> - Emitted when a thumbstick or thumbpad on this tracker moves. + Emitted when a trigger or similar input on this tracker changes value. </description> </signal> - <signal name="input_value_changed"> + <signal name="input_vector2_changed"> <param index="0" name="name" type="String" /> - <param index="1" name="value" type="float" /> + <param index="1" name="vector" type="Vector2" /> <description> - Emitted when a trigger or similar input on this tracker changes value. + Emitted when a thumbstick or thumbpad on this tracker moves. </description> </signal> <signal name="pose_changed"> |