diff options
Diffstat (limited to 'doc/classes')
204 files changed, 3303 insertions, 1621 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 5f81c80887..7acec9e63b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -106,6 +106,17 @@ [/codeblock] </description> </method> + <method name="bezier_interpolate"> + <return type="float" /> + <argument index="0" name="start" type="float" /> + <argument index="1" name="control_1" type="float" /> + <argument index="2" name="control_2" type="float" /> + <argument index="3" name="end" type="float" /> + <argument index="4" name="t" type="float" /> + <description> + Returns the point at the given [code]t[/code] on a one-dimnesional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [code]control_1[/code], [code]control_2[/code], and [code]end[/code] points. + </description> + </method> <method name="bytes2var"> <return type="Variant" /> <argument index="0" name="bytes" type="PackedByteArray" /> @@ -646,6 +657,16 @@ [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. 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> + <method name="print_rich" qualifiers="vararg"> + <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] + print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b] + [/codeblock] + [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> <method name="print_verbose" qualifiers="vararg"> <description> If verbose mode is enabled ([method OS.is_stdout_verbose] returning [code]true[/code]), converts one or more arguments of any type to string in the best way possible and prints them to the console. @@ -1040,6 +1061,27 @@ A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it. </description> </method> + <method name="wrap"> + <return type="Variant" /> + <argument index="0" name="value" type="Variant" /> + <argument index="1" name="min" type="Variant" /> + <argument index="2" name="max" type="Variant" /> + <description> + Wraps the [Variant] [code]value[/code] between [code]min[/code] and [code]max[/code]. + Usable for creating loop-alike behavior or infinite surfaces. + Variant types [int] and [float] (real) are supported. If any of the argument is [float] the result will be [float], otherwise it is [int]. + [codeblock] + var a = wrap(4, 5, 10) + # a is 9 (int) + + var a = wrap(7, 5, 10) + # a is 7 (int) + + var a = wrap(10.5, 5, 10) + # a is 5.5 (float) + [/codeblock] + </description> + </method> <method name="wrapf"> <return type="float" /> <argument index="0" name="value" type="float" /> @@ -1414,6 +1456,63 @@ <constant name="KEY_F16" value="16777259" enum="Key"> F16 key. </constant> + <constant name="KEY_F17" value="16777260" enum="Key"> + F17 key. + </constant> + <constant name="KEY_F18" value="16777261" enum="Key"> + F18 key. + </constant> + <constant name="KEY_F19" value="16777262" enum="Key"> + F19 key. + </constant> + <constant name="KEY_F20" value="16777263" enum="Key"> + F20 key. + </constant> + <constant name="KEY_F21" value="16777264" enum="Key"> + F21 key. + </constant> + <constant name="KEY_F22" value="16777265" enum="Key"> + F22 key. + </constant> + <constant name="KEY_F23" value="16777266" enum="Key"> + F23 key. + </constant> + <constant name="KEY_F24" value="16777267" enum="Key"> + F24 key. + </constant> + <constant name="KEY_F25" value="16777268" enum="Key"> + F25 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F26" value="16777269" enum="Key"> + F26 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F27" value="16777270" enum="Key"> + F27 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F28" value="16777271" enum="Key"> + F28 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F29" value="16777272" enum="Key"> + F29 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F30" value="16777273" enum="Key"> + F30 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F31" value="16777274" enum="Key"> + F31 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F32" value="16777275" enum="Key"> + F32 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F33" value="16777276" enum="Key"> + F33 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F34" value="16777277" enum="Key"> + F34 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> + <constant name="KEY_F35" value="16777278" enum="Key"> + F35 key. Only supported on macOS and Linux due to a Windows limitation. + </constant> <constant name="KEY_KP_MULTIPLY" value="16777345" enum="Key"> Multiply (*) key on the numeric keypad. </constant> @@ -1459,148 +1558,148 @@ <constant name="KEY_KP_9" value="16777359" enum="Key"> Number 9 on the numeric keypad. </constant> - <constant name="KEY_SUPER_L" value="16777260" enum="Key"> + <constant name="KEY_SUPER_L" value="16777280" enum="Key"> Left Super key (Windows key). </constant> - <constant name="KEY_SUPER_R" value="16777261" enum="Key"> + <constant name="KEY_SUPER_R" value="16777281" enum="Key"> Right Super key (Windows key). </constant> - <constant name="KEY_MENU" value="16777262" enum="Key"> + <constant name="KEY_MENU" value="16777282" enum="Key"> Context menu key. </constant> - <constant name="KEY_HYPER_L" value="16777263" enum="Key"> + <constant name="KEY_HYPER_L" value="16777283" enum="Key"> Left Hyper key. </constant> - <constant name="KEY_HYPER_R" value="16777264" enum="Key"> + <constant name="KEY_HYPER_R" value="16777284" enum="Key"> Right Hyper key. </constant> - <constant name="KEY_HELP" value="16777265" enum="Key"> + <constant name="KEY_HELP" value="16777285" enum="Key"> Help key. </constant> - <constant name="KEY_DIRECTION_L" value="16777266" enum="Key"> + <constant name="KEY_DIRECTION_L" value="16777286" enum="Key"> Left Direction key. </constant> - <constant name="KEY_DIRECTION_R" value="16777267" enum="Key"> + <constant name="KEY_DIRECTION_R" value="16777287" enum="Key"> Right Direction key. </constant> - <constant name="KEY_BACK" value="16777280" enum="Key"> + <constant name="KEY_BACK" value="16777288" enum="Key"> Media back key. Not to be confused with the Back button on an Android device. </constant> - <constant name="KEY_FORWARD" value="16777281" enum="Key"> + <constant name="KEY_FORWARD" value="16777289" enum="Key"> Media forward key. </constant> - <constant name="KEY_STOP" value="16777282" enum="Key"> + <constant name="KEY_STOP" value="16777290" enum="Key"> Media stop key. </constant> - <constant name="KEY_REFRESH" value="16777283" enum="Key"> + <constant name="KEY_REFRESH" value="16777291" enum="Key"> Media refresh key. </constant> - <constant name="KEY_VOLUMEDOWN" value="16777284" enum="Key"> + <constant name="KEY_VOLUMEDOWN" value="16777292" enum="Key"> Volume down key. </constant> - <constant name="KEY_VOLUMEMUTE" value="16777285" enum="Key"> + <constant name="KEY_VOLUMEMUTE" value="16777293" enum="Key"> Mute volume key. </constant> - <constant name="KEY_VOLUMEUP" value="16777286" enum="Key"> + <constant name="KEY_VOLUMEUP" value="16777294" enum="Key"> Volume up key. </constant> - <constant name="KEY_BASSBOOST" value="16777287" enum="Key"> + <constant name="KEY_BASSBOOST" value="16777295" enum="Key"> Bass Boost key. </constant> - <constant name="KEY_BASSUP" value="16777288" enum="Key"> + <constant name="KEY_BASSUP" value="16777296" enum="Key"> Bass up key. </constant> - <constant name="KEY_BASSDOWN" value="16777289" enum="Key"> + <constant name="KEY_BASSDOWN" value="16777297" enum="Key"> Bass down key. </constant> - <constant name="KEY_TREBLEUP" value="16777290" enum="Key"> + <constant name="KEY_TREBLEUP" value="16777298" enum="Key"> Treble up key. </constant> - <constant name="KEY_TREBLEDOWN" value="16777291" enum="Key"> + <constant name="KEY_TREBLEDOWN" value="16777299" enum="Key"> Treble down key. </constant> - <constant name="KEY_MEDIAPLAY" value="16777292" enum="Key"> + <constant name="KEY_MEDIAPLAY" value="16777300" enum="Key"> Media play key. </constant> - <constant name="KEY_MEDIASTOP" value="16777293" enum="Key"> + <constant name="KEY_MEDIASTOP" value="16777301" enum="Key"> Media stop key. </constant> - <constant name="KEY_MEDIAPREVIOUS" value="16777294" enum="Key"> + <constant name="KEY_MEDIAPREVIOUS" value="16777302" enum="Key"> Previous song key. </constant> - <constant name="KEY_MEDIANEXT" value="16777295" enum="Key"> + <constant name="KEY_MEDIANEXT" value="16777303" enum="Key"> Next song key. </constant> - <constant name="KEY_MEDIARECORD" value="16777296" enum="Key"> + <constant name="KEY_MEDIARECORD" value="16777304" enum="Key"> Media record key. </constant> - <constant name="KEY_HOMEPAGE" value="16777297" enum="Key"> + <constant name="KEY_HOMEPAGE" value="16777305" enum="Key"> Home page key. </constant> - <constant name="KEY_FAVORITES" value="16777298" enum="Key"> + <constant name="KEY_FAVORITES" value="16777306" enum="Key"> Favorites key. </constant> - <constant name="KEY_SEARCH" value="16777299" enum="Key"> + <constant name="KEY_SEARCH" value="16777307" enum="Key"> Search key. </constant> - <constant name="KEY_STANDBY" value="16777300" enum="Key"> + <constant name="KEY_STANDBY" value="16777308" enum="Key"> Standby key. </constant> - <constant name="KEY_OPENURL" value="16777301" enum="Key"> + <constant name="KEY_OPENURL" value="16777309" enum="Key"> Open URL / Launch Browser key. </constant> - <constant name="KEY_LAUNCHMAIL" value="16777302" enum="Key"> + <constant name="KEY_LAUNCHMAIL" value="16777310" enum="Key"> Launch Mail key. </constant> - <constant name="KEY_LAUNCHMEDIA" value="16777303" enum="Key"> + <constant name="KEY_LAUNCHMEDIA" value="16777311" enum="Key"> Launch Media key. </constant> - <constant name="KEY_LAUNCH0" value="16777304" enum="Key"> + <constant name="KEY_LAUNCH0" value="16777312" enum="Key"> Launch Shortcut 0 key. </constant> - <constant name="KEY_LAUNCH1" value="16777305" enum="Key"> + <constant name="KEY_LAUNCH1" value="16777313" enum="Key"> Launch Shortcut 1 key. </constant> - <constant name="KEY_LAUNCH2" value="16777306" enum="Key"> + <constant name="KEY_LAUNCH2" value="16777314" enum="Key"> Launch Shortcut 2 key. </constant> - <constant name="KEY_LAUNCH3" value="16777307" enum="Key"> + <constant name="KEY_LAUNCH3" value="16777315" enum="Key"> Launch Shortcut 3 key. </constant> - <constant name="KEY_LAUNCH4" value="16777308" enum="Key"> + <constant name="KEY_LAUNCH4" value="16777316" enum="Key"> Launch Shortcut 4 key. </constant> - <constant name="KEY_LAUNCH5" value="16777309" enum="Key"> + <constant name="KEY_LAUNCH5" value="16777317" enum="Key"> Launch Shortcut 5 key. </constant> - <constant name="KEY_LAUNCH6" value="16777310" enum="Key"> + <constant name="KEY_LAUNCH6" value="16777318" enum="Key"> Launch Shortcut 6 key. </constant> - <constant name="KEY_LAUNCH7" value="16777311" enum="Key"> + <constant name="KEY_LAUNCH7" value="16777319" enum="Key"> Launch Shortcut 7 key. </constant> - <constant name="KEY_LAUNCH8" value="16777312" enum="Key"> + <constant name="KEY_LAUNCH8" value="16777320" enum="Key"> Launch Shortcut 8 key. </constant> - <constant name="KEY_LAUNCH9" value="16777313" enum="Key"> + <constant name="KEY_LAUNCH9" value="16777321" enum="Key"> Launch Shortcut 9 key. </constant> - <constant name="KEY_LAUNCHA" value="16777314" enum="Key"> + <constant name="KEY_LAUNCHA" value="16777322" enum="Key"> Launch Shortcut A key. </constant> - <constant name="KEY_LAUNCHB" value="16777315" enum="Key"> + <constant name="KEY_LAUNCHB" value="16777323" enum="Key"> Launch Shortcut B key. </constant> - <constant name="KEY_LAUNCHC" value="16777316" enum="Key"> + <constant name="KEY_LAUNCHC" value="16777324" enum="Key"> Launch Shortcut C key. </constant> - <constant name="KEY_LAUNCHD" value="16777317" enum="Key"> + <constant name="KEY_LAUNCHD" value="16777325" enum="Key"> Launch Shortcut D key. </constant> - <constant name="KEY_LAUNCHE" value="16777318" enum="Key"> + <constant name="KEY_LAUNCHE" value="16777326" enum="Key"> Launch Shortcut E key. </constant> - <constant name="KEY_LAUNCHF" value="16777319" enum="Key"> + <constant name="KEY_LAUNCHF" value="16777327" enum="Key"> Launch Shortcut F key. </constant> <constant name="KEY_UNKNOWN" value="33554431" enum="Key"> @@ -2403,7 +2502,7 @@ </constant> <constant name="PROPERTY_HINT_RANGE" value="1" enum="PropertyHint"> Hints that an integer or float property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,or_greater,or_lesser"[/code]. - Additionally, other keywords can be included: "exp" for exponential range editing, "radians" for editing radian angles in degrees, "degrees" to hint at an angle and "noslider" to hide the slider. + Additionally, other keywords can be included: "exp" for exponential range editing, "radians" for editing radian angles in degrees, "degrees" to hint at an angle and "no_slider" to hide the slider. </constant> <constant name="PROPERTY_HINT_ENUM" value="2" enum="PropertyHint"> Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string. @@ -2416,51 +2515,51 @@ <constant name="PROPERTY_HINT_EXP_EASING" value="4" enum="PropertyHint"> Hints that a float property should be edited via an exponential easing function. The hint string can include [code]"attenuation"[/code] to flip the curve horizontally and/or [code]"inout"[/code] to also include in/out easing. </constant> - <constant name="PROPERTY_HINT_LENGTH" value="5" enum="PropertyHint"> - Deprecated hint, unused. - </constant> - <constant name="PROPERTY_HINT_KEY_ACCEL" value="6" enum="PropertyHint"> - Deprecated hint, unused. + <constant name="PROPERTY_HINT_LINK" value="5" enum="PropertyHint"> + Hints that a vector property should allow linking values (e.g. to edit both [code]x[/code] and [code]y[/code] together). </constant> - <constant name="PROPERTY_HINT_FLAGS" value="7" enum="PropertyHint"> + <constant name="PROPERTY_HINT_FLAGS" value="6" enum="PropertyHint"> Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like [code]"Bit0,Bit1,Bit2,,Bit4"[/code]. </constant> - <constant name="PROPERTY_HINT_LAYERS_2D_RENDER" value="8" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_2D_RENDER" value="7" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 2D render layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_2D_PHYSICS" value="9" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_2D_PHYSICS" value="8" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 2D physics layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_2D_NAVIGATION" value="10" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_2D_NAVIGATION" value="9" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 2D navigation layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="11" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="10" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 3D render layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="12" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="11" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 3D physics layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_3D_NAVIGATION" value="13" enum="PropertyHint"> - Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + <constant name="PROPERTY_HINT_LAYERS_3D_NAVIGATION" value="12" enum="PropertyHint"> + Hints that an integer property is a bitmask using the optionally named 3D navigation layers. </constant> - <constant name="PROPERTY_HINT_FILE" value="14" enum="PropertyHint"> + <constant name="PROPERTY_HINT_FILE" value="13" enum="PropertyHint"> Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. </constant> - <constant name="PROPERTY_HINT_DIR" value="15" enum="PropertyHint"> + <constant name="PROPERTY_HINT_DIR" value="14" enum="PropertyHint"> Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. </constant> - <constant name="PROPERTY_HINT_GLOBAL_FILE" value="16" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_FILE" value="15" enum="PropertyHint"> Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. </constant> - <constant name="PROPERTY_HINT_GLOBAL_DIR" value="17" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_DIR" value="16" enum="PropertyHint"> Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. </constant> - <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="18" enum="PropertyHint"> + <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="17" enum="PropertyHint"> Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. [code]"Texture2D"[/code]). Editing it will show a popup menu of valid resource types to instantiate. </constant> - <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="19" enum="PropertyHint"> + <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="18" enum="PropertyHint"> Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. </constant> + <constant name="PROPERTY_HINT_EXPRESSION" value="19" enum="PropertyHint"> + Hints that a string property is an [Expression]. + </constant> <constant name="PROPERTY_HINT_PLACEHOLDER_TEXT" value="20" enum="PropertyHint"> Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. </constant> @@ -2509,100 +2608,100 @@ </constant> <constant name="PROPERTY_HINT_SAVE_FILE" value="37" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="38" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="38" enum="PropertyHint"> + </constant> + <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="39" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_INT_IS_POINTER" value="40" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_POINTER" value="41" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_ARRAY_TYPE" value="39" enum="PropertyHint"> + <constant name="PROPERTY_HINT_ARRAY_TYPE" value="40" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_LOCALE_ID" value="41" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LOCALE_ID" value="42" enum="PropertyHint"> Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. </constant> - <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="42" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="43" enum="PropertyHint"> Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. </constant> - <constant name="PROPERTY_HINT_MAX" value="43" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_TYPE" value="44" enum="PropertyHint"> + </constant> + <constant name="PROPERTY_HINT_MAX" value="45" enum="PropertyHint"> </constant> <constant name="PROPERTY_USAGE_NONE" value="0" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_STORAGE" value="1" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_STORAGE" value="2" enum="PropertyUsageFlags"> The property is serialized and saved in the scene file (default). </constant> - <constant name="PROPERTY_USAGE_EDITOR" value="2" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_EDITOR" value="4" enum="PropertyUsageFlags"> The property is shown in the editor inspector (default). </constant> - <constant name="PROPERTY_USAGE_NETWORK" value="4" enum="PropertyUsageFlags"> - Deprecated usage flag, unused. - </constant> - <constant name="PROPERTY_USAGE_EDITOR_HELPER" value="8" enum="PropertyUsageFlags"> - Deprecated usage flag, unused. - </constant> - <constant name="PROPERTY_USAGE_CHECKABLE" value="16" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_CHECKABLE" value="8" enum="PropertyUsageFlags"> The property can be checked in the editor inspector. </constant> - <constant name="PROPERTY_USAGE_CHECKED" value="32" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_CHECKED" value="16" enum="PropertyUsageFlags"> The property is checked in the editor inspector. </constant> - <constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="64" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="32" enum="PropertyUsageFlags"> The property is a translatable string. </constant> - <constant name="PROPERTY_USAGE_GROUP" value="128" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_GROUP" value="64" enum="PropertyUsageFlags"> Used to group properties together in the editor. See [EditorInspector]. </constant> - <constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_CATEGORY" value="128" enum="PropertyUsageFlags"> Used to categorize properties together in the editor. </constant> - <constant name="PROPERTY_USAGE_SUBGROUP" value="512" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_SUBGROUP" value="256" enum="PropertyUsageFlags"> Used to group properties together in the editor in a subgroup (under a group). See [EditorInspector]. </constant> - <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_CLASS_IS_BITFIELD" value="512" enum="PropertyUsageFlags"> + </constant> + <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="1024" enum="PropertyUsageFlags"> The property does not save its state in [PackedScene]. </constant> - <constant name="PROPERTY_USAGE_RESTART_IF_CHANGED" value="4096" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_RESTART_IF_CHANGED" value="2048" enum="PropertyUsageFlags"> Editing the property prompts the user for restarting the editor. </constant> - <constant name="PROPERTY_USAGE_SCRIPT_VARIABLE" value="8192" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_SCRIPT_VARIABLE" value="4096" enum="PropertyUsageFlags"> The property is a script variable which should be serialized and saved in the scene file. </constant> - <constant name="PROPERTY_USAGE_STORE_IF_NULL" value="16384" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_STORE_IF_NULL" value="8192" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_ANIMATE_AS_TRIGGER" value="32768" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_ANIMATE_AS_TRIGGER" value="16384" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="65536" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="32768" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="131072" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="65536" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="262144" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="131072" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="524288" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="262144" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_INTERNAL" value="1048576" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_INTERNAL" value="524288" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="2097152" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="1048576" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="4194304" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="2097152" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="8388608" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="4194304" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="16777216" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="8388608" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="33554432" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="67108864" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="134217728" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="268435456" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_ARRAY" value="1073741824" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_ARRAY" value="536870912" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_DEFAULT" value="7" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags"> Default usage (storage, editor and network). </constant> - <constant name="PROPERTY_USAGE_DEFAULT_INTL" value="71" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_DEFAULT_INTL" value="38" enum="PropertyUsageFlags"> Default usage for translatable strings (storage, editor, network and internationalized). </constant> - <constant name="PROPERTY_USAGE_NO_EDITOR" value="5" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_NO_EDITOR" value="2" enum="PropertyUsageFlags"> Default usage but without showing the property in the editor (storage, network). </constant> <constant name="METHOD_FLAG_NORMAL" value="1" enum="MethodFlags"> @@ -2611,24 +2710,17 @@ <constant name="METHOD_FLAG_EDITOR" value="2" enum="MethodFlags"> Flag for an editor method. </constant> - <constant name="METHOD_FLAG_NOSCRIPT" value="4" enum="MethodFlags"> - Deprecated method flag, unused. - </constant> - <constant name="METHOD_FLAG_CONST" value="8" enum="MethodFlags"> + <constant name="METHOD_FLAG_CONST" value="4" enum="MethodFlags"> Flag for a constant method. </constant> - <constant name="METHOD_FLAG_REVERSE" value="16" enum="MethodFlags"> - Deprecated method flag, unused. - </constant> - <constant name="METHOD_FLAG_VIRTUAL" value="32" enum="MethodFlags"> + <constant name="METHOD_FLAG_VIRTUAL" value="8" enum="MethodFlags"> Flag for a virtual method. </constant> - <constant name="METHOD_FLAG_FROM_SCRIPT" value="64" enum="MethodFlags"> - Deprecated method flag, unused. + <constant name="METHOD_FLAG_VARARG" value="16" enum="MethodFlags"> </constant> - <constant name="METHOD_FLAG_STATIC" value="256" enum="MethodFlags"> + <constant name="METHOD_FLAG_STATIC" value="32" enum="MethodFlags"> </constant> - <constant name="METHOD_FLAG_OBJECT_CORE" value="512" enum="MethodFlags"> + <constant name="METHOD_FLAG_OBJECT_CORE" value="64" enum="MethodFlags"> Used internally. Allows to not dump core virtuals such as [code]_notification[/code] to the JSON API. </constant> <constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags"> @@ -2640,8 +2732,8 @@ <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. </constant> - <constant name="RPC_MODE_AUTH" 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(auth)[/code] annotation. See [method Node.set_multiplayer_authority]. + <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]. </constant> <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode"> Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters. diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 7a27568d30..c05fb885b9 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -52,8 +52,9 @@ <return type="bool" /> <argument index="0" name="id" type="int" /> <argument index="1" name="to_id" type="int" /> + <argument index="2" name="bidirectional" type="bool" default="true" /> <description> - Returns whether there is a connection/segment between the given points. + Returns whether there is a connection/segment between the given points. If [code]bidirectional[/code] is [code]false[/code], returns whether movement from [code]id[/code] to [code]to_id[/code] is possible through this segment. </description> </method> <method name="clear"> @@ -89,8 +90,9 @@ <return type="void" /> <argument index="0" name="id" type="int" /> <argument index="1" name="to_id" type="int" /> + <argument index="2" name="bidirectional" type="bool" default="true" /> <description> - Deletes the segment between the given points. + Deletes the segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is prevented, and a unidirectional segment possibly remains. </description> </method> <method name="get_available_point_id" qualifiers="const"> @@ -133,7 +135,7 @@ </description> </method> <method name="get_id_path"> - <return type="PackedInt32Array" /> + <return type="PackedInt64Array" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> <description> @@ -177,7 +179,7 @@ </description> </method> <method name="get_point_connections"> - <return type="PackedInt32Array" /> + <return type="PackedInt64Array" /> <argument index="0" name="id" type="int" /> <description> Returns an array with the IDs of the points that form the connection with the given point. diff --git a/doc/classes/AStar3D.xml b/doc/classes/AStar3D.xml index 33407c3e74..ea4e49c173 100644 --- a/doc/classes/AStar3D.xml +++ b/doc/classes/AStar3D.xml @@ -164,7 +164,7 @@ </description> </method> <method name="get_id_path"> - <return type="PackedInt32Array" /> + <return type="PackedInt64Array" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> <description> @@ -207,7 +207,7 @@ </description> </method> <method name="get_point_connections"> - <return type="PackedInt32Array" /> + <return type="PackedInt64Array" /> <argument index="0" name="id" type="int" /> <description> Returns an array with the IDs of the points that form the connection with the given point. diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index c1e28ffba3..0009c82548 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -62,6 +62,7 @@ Sets autowrapping for the text in the dialog. </member> <member name="dialog_close_on_escape" type="bool" setter="set_close_on_escape" getter="get_close_on_escape" default="true"> + If [code]true[/code], the dialog will be hidden when the escape key ([constant @GlobalScope.KEY_ESCAPE]) is pressed. </member> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" default="true"> If [code]true[/code], the dialog is hidden when the OK button is pressed. You can set it to [code]false[/code] if you want to do e.g. input validation when receiving the [signal confirmed] signal, and handle hiding the dialog in your own logic. @@ -71,6 +72,9 @@ The text displayed by the dialog. </member> <member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" overrides="Window" default="true" /> + <member name="ok_button_text" type="String" setter="set_ok_button_text" getter="get_ok_button_text" default=""OK""> + The text displayed by the OK button (see [method get_ok_button]). + </member> <member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default=""Alert!"" /> <member name="transient" type="bool" setter="set_transient" getter="is_transient" overrides="Window" default="true" /> <member name="visible" type="bool" setter="set_visible" getter="is_visible" overrides="Window" default="false" /> diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml index 0a731edadd..d856c65dfc 100644 --- a/doc/classes/AnimationLibrary.xml +++ b/doc/classes/AnimationLibrary.xml @@ -51,18 +51,18 @@ </members> <signals> <signal name="animation_added"> - <argument index="0" name="name" type="Animation" /> + <argument index="0" name="name" type="StringName" /> <description> </description> </signal> <signal name="animation_removed"> - <argument index="0" name="name" type="Animation" /> + <argument index="0" name="name" type="StringName" /> <description> </description> </signal> <signal name="animation_renamed"> - <argument index="0" name="name" type="Animation" /> - <argument index="1" name="to_name" type="Animation" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="to_name" type="StringName" /> <description> </description> </signal> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 99d21706ee..189e30b5f2 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -53,6 +53,7 @@ <return type="float" /> <argument index="0" name="time" type="float" /> <argument index="1" name="seek" type="bool" /> + <argument index="2" name="seek_root" type="bool" /> <description> User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. @@ -72,8 +73,9 @@ <argument index="1" name="time" type="float" /> <argument index="2" name="delta" type="float" /> <argument index="3" name="seeked" type="bool" /> - <argument index="4" name="blend" type="float" /> - <argument index="5" name="pingponged" type="int" default="0" /> + <argument index="4" name="seek_root" type="bool" /> + <argument index="5" name="blend" type="float" /> + <argument index="6" name="pingponged" type="int" default="0" /> <description> Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened. </description> @@ -83,9 +85,10 @@ <argument index="0" name="input_index" type="int" /> <argument index="1" name="time" type="float" /> <argument index="2" name="seek" type="bool" /> - <argument index="3" name="blend" type="float" /> - <argument index="4" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" /> - <argument index="5" name="optimize" type="bool" default="true" /> + <argument index="3" name="seek_root" type="bool" /> + <argument index="4" name="blend" type="float" /> + <argument index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" /> + <argument index="6" name="sync" type="bool" default="true" /> <description> Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options). </description> @@ -96,9 +99,10 @@ <argument index="1" name="node" type="AnimationNode" /> <argument index="2" name="time" type="float" /> <argument index="3" name="seek" type="bool" /> - <argument index="4" name="blend" type="float" /> - <argument index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" /> - <argument index="6" name="optimize" type="bool" default="true" /> + <argument index="4" name="seek_root" type="bool" /> + <argument index="5" name="blend" type="float" /> + <argument index="6" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" /> + <argument index="7" name="sync" type="bool" default="true" /> <description> Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition. </description> diff --git a/doc/classes/AnimationNodeAdd2.xml b/doc/classes/AnimationNodeAdd2.xml index ca117e3ecd..e6ac1dd963 100644 --- a/doc/classes/AnimationNodeAdd2.xml +++ b/doc/classes/AnimationNodeAdd2.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeAdd2" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeAdd2" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Blends two animations additively inside of an [AnimationNodeBlendTree]. </brief_description> @@ -9,9 +9,4 @@ <tutorials> <link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> </tutorials> - <members> - <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> - If [code]true[/code], sets the [code]optimization[/code] to [code]false[/code] when calling [method AnimationNode.blend_input], forcing the blended animations to update every frame. - </member> - </members> </class> diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml index 91e030a6ae..f290032e11 100644 --- a/doc/classes/AnimationNodeAdd3.xml +++ b/doc/classes/AnimationNodeAdd3.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeAdd3" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeAdd3" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Blends two of three animations additively inside of an [AnimationNodeBlendTree]. </brief_description> @@ -14,9 +14,4 @@ <link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> - <members> - <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> - If [code]true[/code], sets the [code]optimization[/code] to [code]false[/code] when calling [method AnimationNode.blend_input], forcing the blended animations to update every frame. - </member> - </members> </class> diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml index f17163e155..5001e3ba24 100644 --- a/doc/classes/AnimationNodeBlend2.xml +++ b/doc/classes/AnimationNodeBlend2.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeBlend2" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeBlend2" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Blends two animations linearly inside of an [AnimationNodeBlendTree]. </brief_description> @@ -11,9 +11,4 @@ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link> <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> - <members> - <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> - If [code]true[/code], sets the [code]optimization[/code] to [code]false[/code] when calling [method AnimationNode.blend_input], forcing the blended animations to update every frame. - </member> - </members> </class> diff --git a/doc/classes/AnimationNodeBlend3.xml b/doc/classes/AnimationNodeBlend3.xml index 6bc7a20823..93947c2462 100644 --- a/doc/classes/AnimationNodeBlend3.xml +++ b/doc/classes/AnimationNodeBlend3.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeBlend3" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeBlend3" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Blends two of three animations linearly inside of an [AnimationNodeBlendTree]. </brief_description> @@ -13,9 +13,4 @@ <tutorials> <link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> </tutorials> - <members> - <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> - If [code]true[/code], sets the [code]optimization[/code] to [code]false[/code] when calling [method AnimationNode.blend_input], forcing the blended animations to update every frame. - </member> - </members> </class> diff --git a/doc/classes/AnimationNodeBlendSpace1D.xml b/doc/classes/AnimationNodeBlendSpace1D.xml index 6ded3a7ff9..7bb136308d 100644 --- a/doc/classes/AnimationNodeBlendSpace1D.xml +++ b/doc/classes/AnimationNodeBlendSpace1D.xml @@ -76,6 +76,10 @@ <member name="snap" type="float" setter="set_snap" getter="get_snap" default="0.1"> Position increment to snap to when moving a point on the axis. </member> + <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> + If [code]false[/code], the blended animations' frame are stopped when the blend value is [code]0[/code]. + If [code]true[/code], forcing the blended animations to advance frame. + </member> <member name="value_label" type="String" setter="set_value_label" getter="get_value_label" default=""value""> Label of the virtual axis of the blend space. </member> diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index 9e0e408ac5..eb2249d2d2 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -113,6 +113,10 @@ <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2(0.1, 0.1)"> Position increment to snap to when moving a point. </member> + <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> + If [code]false[/code], the blended animations' frame are stopped when the blend value is [code]0[/code]. + If [code]true[/code], forcing the blended animations to advance frame. + </member> <member name="x_label" type="String" setter="set_x_label" getter="get_x_label" default=""x""> Name of the blend space's X axis. </member> diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index 727a09e110..14abc34992 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeOneShot" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeOneShot" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Plays an animation once in [AnimationNodeBlendTree]. </brief_description> @@ -20,14 +20,12 @@ <member name="autorestart_random_delay" type="float" setter="set_autorestart_random_delay" getter="get_autorestart_random_delay" default="0.0"> If [member autorestart] is [code]true[/code], a random additional delay (in seconds) between 0 and this value will be added to [member autorestart_delay]. </member> - <member name="fadein_time" type="float" setter="set_fadein_time" getter="get_fadein_time" default="0.1"> + <member name="fadein_time" type="float" setter="set_fadein_time" getter="get_fadein_time" default="0.0"> </member> - <member name="fadeout_time" type="float" setter="set_fadeout_time" getter="get_fadeout_time" default="0.1"> + <member name="fadeout_time" type="float" setter="set_fadeout_time" getter="get_fadeout_time" default="0.0"> </member> <member name="mix_mode" type="int" setter="set_mix_mode" getter="get_mix_mode" enum="AnimationNodeOneShot.MixMode" default="0"> </member> - <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> - </member> </members> <constants> <constant name="MIX_MODE_BLEND" value="0" enum="MixMode"> diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index 94e6a2f23d..206164d675 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -19,6 +19,12 @@ [/csharp] [/codeblocks] </member> + <member name="advance_expression" type="String" setter="set_advance_expression" getter="get_advance_expression" default=""""> + Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code. + </member> + <member name="advance_expression_base_node" type="NodePath" setter="set_advance_expression_base_node" getter="get_advance_expression_base_node" default="NodePath("")"> + The path to the [Node] used to evaluate an [Expression] if one is not explictly specified internally. + </member> <member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance" default="false"> Turn on the transition automatically when this state is reached. This works best with [constant SWITCH_MODE_AT_END]. </member> diff --git a/doc/classes/AnimationNodeSync.xml b/doc/classes/AnimationNodeSync.xml new file mode 100644 index 0000000000..21cac11d50 --- /dev/null +++ b/doc/classes/AnimationNodeSync.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AnimationNodeSync" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <members> + <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> + If [code]false[/code], the blended animations' frame are stopped when the blend value is [code]0[/code]. + If [code]true[/code], forcing the blended animations to advance frame. + </member> + </members> +</class> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 70c874d251..7e757d4640 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationNodeTransition" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AnimationNodeTransition" inherits="AnimationNodeSync" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A generic animation transition node for [AnimationTree]. </brief_description> @@ -40,6 +40,9 @@ </method> </methods> <members> + <member name="from_start" type="bool" setter="set_from_start" getter="is_from_start" default="true"> + If [code]true[/code], the destination animation is played back from the beginning when switched. + </member> <member name="input_count" type="int" setter="set_enabled_inputs" getter="get_enabled_inputs" default="0"> The number of available input ports for this node. </member> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 625cf3c47c..653607610d 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -179,6 +179,7 @@ <argument index="1" name="update" type="bool" default="false" /> <description> Seeks the animation to the [code]seconds[/code] point in time (in seconds). If [code]update[/code] is [code]true[/code], the animation updates too, otherwise it updates at process time. Events between the current frame and [code]seconds[/code] are skipped. + [b]Note:[/b] Seeking to the end of the animation doesn't emit [signal animation_finished]. If you want to skip animation and emit the signal, use [method advance]. </description> </method> <method name="set_blend_time"> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index 67e64c6bee..ecac228a26 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -37,6 +37,9 @@ <member name="active" type="bool" setter="set_active" getter="is_active" default="false"> If [code]true[/code], the [AnimationTree] will be processing. </member> + <member name="advance_expression_base_node" type="NodePath" setter="set_advance_expression_base_node" getter="get_advance_expression_base_node" default="NodePath(".")"> + The path to the [Node] used to evaluate the AnimationNode [Expression] if one is not explictly specified internally. + </member> <member name="anim_player" type="NodePath" setter="set_animation_player" getter="get_animation_player" default="NodePath("")"> The path to the [AnimationPlayer] used for animating. </member> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index ef4f86f1a9..c149cdc0e4 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -123,6 +123,52 @@ </constructor> </constructors> <methods> + <method name="all" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="method" type="Callable" /> + <description> + Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]all[/i] elements in the array. If the [Callable] returns [code]false[/code] for one array element or more, this method returns [code]false[/code]. + The callable's method should take one [Variant] parameter (the current array element) and return a boolean value. + [codeblock] + func _ready(): + print([6, 10, 6].all(greater_than_5)) # Prints True (3/3 elements evaluate to `true`). + print([4, 10, 4].all(greater_than_5)) # Prints False (1/3 elements evaluate to `true`). + print([4, 4, 4].all(greater_than_5)) # Prints False (0/3 elements evaluate to `true`). + print([].all(greater_than_5)) # Prints True (0/0 elements evaluate to `true`). + + print([6, 10, 6].all(func(number): return number > 5)) # Prints True. Same as the first line above, but using lambda function. + + func greater_than_5(number): + return number > 5 + [/codeblock] + See also [method any], [method filter], [method map] and [method reduce]. + [b]Note:[/b] Unlike relying on the size of an array returned by [method filter], this method will return as early as possible to improve performance (especially with large arrays). + [b]Note:[/b] For an empty array, this method [url=https://en.wikipedia.org/wiki/Vacuous_truth]always[/url] returns [code]true[/code]. + </description> + </method> + <method name="any" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="method" type="Callable" /> + <description> + Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]one or more[/i] elements in the array. If the [Callable] returns [code]false[/code] for all elements in the array, this method returns [code]false[/code]. + The callable's method should take one [Variant] parameter (the current array element) and return a boolean value. + [codeblock] + func _ready(): + print([6, 10, 6].any(greater_than_5)) # Prints True (3 elements evaluate to `true`). + print([4, 10, 4].any(greater_than_5)) # Prints True (1 elements evaluate to `true`). + print([4, 4, 4].any(greater_than_5)) # Prints False (0 elements evaluate to `true`). + print([].any(greater_than_5)) # Prints False (0 elements evaluate to `true`). + + print([6, 10, 6].any(func(number): return number > 5)) # Prints True. Same as the first line above, but using lambda function. + + func greater_than_5(number): + return number > 5 + [/codeblock] + See also [method all], [method filter], [method map] and [method reduce]. + [b]Note:[/b] Unlike relying on the size of an array returned by [method filter], this method will return as early as possible to improve performance (especially with large arrays). + [b]Note:[/b] For an empty array, this method always returns [code]false[/code]. + </description> + </method> <method name="append"> <return type="void" /> <argument index="0" name="value" type="Variant" /> @@ -232,6 +278,7 @@ func remove_1(number): return number != 1 [/codeblock] + See also [method any], [method all], [method map] and [method reduce]. </description> </method> <method name="find" qualifiers="const"> @@ -333,6 +380,7 @@ func negate(number): return -number [/codeblock] + See also [method filter], [method reduce], [method any] and [method all]. </description> </method> <method name="max" qualifiers="const"> @@ -398,6 +446,7 @@ func sum(accum, number): return accum + number [/codeblock] + See also [method map], [method filter], [method any] and [method all]. </description> </method> <method name="remove_at"> diff --git a/doc/classes/AudioEffectAmplify.xml b/doc/classes/AudioEffectAmplify.xml index 7ae0b06dad..43fa9d6ad3 100644 --- a/doc/classes/AudioEffectAmplify.xml +++ b/doc/classes/AudioEffectAmplify.xml @@ -2,12 +2,12 @@ <class name="AudioEffectAmplify" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Adds an amplifying audio effect to an audio bus. - Increases or decreases the volume of the selected audio bus. </brief_description> <description> Increases or decreases the volume being routed through the audio bus. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> diff --git a/doc/classes/AudioEffectBandLimitFilter.xml b/doc/classes/AudioEffectBandLimitFilter.xml index 3635f122f2..4efa431714 100644 --- a/doc/classes/AudioEffectBandLimitFilter.xml +++ b/doc/classes/AudioEffectBandLimitFilter.xml @@ -7,5 +7,6 @@ Limits the frequencies in a range around the [member AudioEffectFilter.cutoff_hz] and allows frequencies outside of this range to pass. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectBandPassFilter.xml b/doc/classes/AudioEffectBandPassFilter.xml index 5e7713f3d4..6820b2c9f8 100644 --- a/doc/classes/AudioEffectBandPassFilter.xml +++ b/doc/classes/AudioEffectBandPassFilter.xml @@ -7,5 +7,6 @@ Attenuates the frequencies inside of a range around the [member AudioEffectFilter.cutoff_hz] and cuts frequencies outside of this band. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectCapture.xml b/doc/classes/AudioEffectCapture.xml index 5ab4403be5..8e02056456 100644 --- a/doc/classes/AudioEffectCapture.xml +++ b/doc/classes/AudioEffectCapture.xml @@ -5,9 +5,10 @@ </brief_description> <description> AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. - Application code should consume these audio frames from this ring buffer using [method get_buffer] and process it as needed, for example to capture data from a microphone, implement application defined effects, or to transmit audio over the network. + Application code should consume these audio frames from this ring buffer using [method get_buffer] and process it as needed, for example to capture data from a microphone, implement application defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <methods> <method name="can_get_buffer" qualifiers="const"> diff --git a/doc/classes/AudioEffectChorus.xml b/doc/classes/AudioEffectChorus.xml index ca04126da4..5efba17e6a 100644 --- a/doc/classes/AudioEffectChorus.xml +++ b/doc/classes/AudioEffectChorus.xml @@ -7,6 +7,7 @@ Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <methods> <method name="get_voice_cutoff_hz" qualifiers="const"> diff --git a/doc/classes/AudioEffectCompressor.xml b/doc/classes/AudioEffectCompressor.xml index 5ad948feba..8793ec0a02 100644 --- a/doc/classes/AudioEffectCompressor.xml +++ b/doc/classes/AudioEffectCompressor.xml @@ -13,6 +13,7 @@ - Accentuates transients by using a wider attack, making effects sound more punchy. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="attack_us" type="float" setter="set_attack_us" getter="get_attack_us" default="20.0"> diff --git a/doc/classes/AudioEffectDelay.xml b/doc/classes/AudioEffectDelay.xml index 8a95e315cd..8223ccd6bd 100644 --- a/doc/classes/AudioEffectDelay.xml +++ b/doc/classes/AudioEffectDelay.xml @@ -8,6 +8,7 @@ Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="dry" type="float" setter="set_dry" getter="get_dry" default="1.0"> diff --git a/doc/classes/AudioEffectEQ.xml b/doc/classes/AudioEffectEQ.xml index 908ae956ed..ce5b6de3be 100644 --- a/doc/classes/AudioEffectEQ.xml +++ b/doc/classes/AudioEffectEQ.xml @@ -8,6 +8,7 @@ AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged). </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <methods> <method name="get_band_count" qualifiers="const"> diff --git a/doc/classes/AudioEffectEQ10.xml b/doc/classes/AudioEffectEQ10.xml index 0b03ea99dd..8cf53b9df2 100644 --- a/doc/classes/AudioEffectEQ10.xml +++ b/doc/classes/AudioEffectEQ10.xml @@ -19,5 +19,6 @@ See also [AudioEffectEQ], [AudioEffectEQ6], [AudioEffectEQ21]. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectEQ21.xml b/doc/classes/AudioEffectEQ21.xml index 6861a74596..2eed3b4836 100644 --- a/doc/classes/AudioEffectEQ21.xml +++ b/doc/classes/AudioEffectEQ21.xml @@ -30,5 +30,6 @@ See also [AudioEffectEQ], [AudioEffectEQ6], [AudioEffectEQ10]. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectEQ6.xml b/doc/classes/AudioEffectEQ6.xml index 5aea8efaa9..816d4b9b38 100644 --- a/doc/classes/AudioEffectEQ6.xml +++ b/doc/classes/AudioEffectEQ6.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectEQ6" inherits="AudioEffectEQ" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. + Adds a 6-band equalizer audio effect to an audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. Each frequency can be modulated between -60/+24 dB. </brief_description> <description> @@ -15,5 +15,6 @@ See also [AudioEffectEQ], [AudioEffectEQ10], [AudioEffectEQ21]. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectHighPassFilter.xml b/doc/classes/AudioEffectHighPassFilter.xml index 02d8dbfffc..53e6f3ca63 100644 --- a/doc/classes/AudioEffectHighPassFilter.xml +++ b/doc/classes/AudioEffectHighPassFilter.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectHighPassFilter" inherits="AudioEffectFilter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a high-pass filter to the Audio Bus. + Adds a high-pass filter to the audio bus. </brief_description> <description> Cuts frequencies lower than the [member AudioEffectFilter.cutoff_hz] and allows higher frequencies to pass. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml index bb5cf5c4a0..f2c20862fb 100644 --- a/doc/classes/AudioEffectHighShelfFilter.xml +++ b/doc/classes/AudioEffectHighShelfFilter.xml @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz]. + Adds a high-shelf filter to the audio bus. </brief_description> <description> + Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz]. </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> diff --git a/doc/classes/AudioEffectLimiter.xml b/doc/classes/AudioEffectLimiter.xml index 3fd099b55e..e841889b2a 100644 --- a/doc/classes/AudioEffectLimiter.xml +++ b/doc/classes/AudioEffectLimiter.xml @@ -8,6 +8,7 @@ Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="ceiling_db" type="float" setter="set_ceiling_db" getter="get_ceiling_db" default="-0.1"> diff --git a/doc/classes/AudioEffectLowPassFilter.xml b/doc/classes/AudioEffectLowPassFilter.xml index 8a9ca04354..b0577f19c3 100644 --- a/doc/classes/AudioEffectLowPassFilter.xml +++ b/doc/classes/AudioEffectLowPassFilter.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectLowPassFilter" inherits="AudioEffectFilter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a low-pass filter to the Audio bus. + Adds a low-pass filter to the audio bus. </brief_description> <description> Cuts frequencies higher than the [member AudioEffectFilter.cutoff_hz] and allows lower frequencies to pass. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml index 04cc1ab1d8..f654ba3612 100644 --- a/doc/classes/AudioEffectLowShelfFilter.xml +++ b/doc/classes/AudioEffectLowShelfFilter.xml @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz]. + Adds a low-shelf filter to the audio bus. </brief_description> <description> + Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz]. </description> <tutorials> <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> diff --git a/doc/classes/AudioEffectNotchFilter.xml b/doc/classes/AudioEffectNotchFilter.xml index a2cc764003..ad4577cfbc 100644 --- a/doc/classes/AudioEffectNotchFilter.xml +++ b/doc/classes/AudioEffectNotchFilter.xml @@ -7,5 +7,6 @@ Attenuates frequencies in a narrow band around the [member AudioEffectFilter.cutoff_hz] and cuts frequencies outside of this range. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> </class> diff --git a/doc/classes/AudioEffectPanner.xml b/doc/classes/AudioEffectPanner.xml index 1dd2d9fa27..291e86214e 100644 --- a/doc/classes/AudioEffectPanner.xml +++ b/doc/classes/AudioEffectPanner.xml @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectPanner" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a panner audio effect to an Audio bus. Pans sound left or right. + Adds a panner audio effect to an audio bus. Pans sound left or right. </brief_description> <description> Determines how much of an audio signal is sent to the left and right buses. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="pan" type="float" setter="set_pan" getter="get_pan" default="0.0"> diff --git a/doc/classes/AudioEffectPhaser.xml b/doc/classes/AudioEffectPhaser.xml index 9c10052b6a..7aaf404352 100644 --- a/doc/classes/AudioEffectPhaser.xml +++ b/doc/classes/AudioEffectPhaser.xml @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectPhaser" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a phaser audio effect to an Audio bus. + Adds a phaser audio effect to an audio bus. Combines the original signal with a copy that is slightly out of phase with the original. </brief_description> <description> Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0"> diff --git a/doc/classes/AudioEffectPitchShift.xml b/doc/classes/AudioEffectPitchShift.xml index aab380aa72..952d432879 100644 --- a/doc/classes/AudioEffectPitchShift.xml +++ b/doc/classes/AudioEffectPitchShift.xml @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectPitchShift" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Adds a pitch-shifting audio effect to an Audio bus. + Adds a pitch-shifting audio effect to an audio bus. Raises or lowers the pitch of original sound. </brief_description> <description> Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="fft_size" type="int" setter="set_fft_size" getter="get_fft_size" enum="AudioEffectPitchShift.FFTSize" default="3"> diff --git a/doc/classes/AudioEffectReverb.xml b/doc/classes/AudioEffectReverb.xml index 5525102806..b024f06849 100644 --- a/doc/classes/AudioEffectReverb.xml +++ b/doc/classes/AudioEffectReverb.xml @@ -2,12 +2,12 @@ <class name="AudioEffectReverb" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Adds a reverberation audio effect to an Audio bus. - Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces. </brief_description> <description> - Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room. + Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <members> diff --git a/doc/classes/AudioEffectStereoEnhance.xml b/doc/classes/AudioEffectStereoEnhance.xml index 5c62ba982f..088d61189f 100644 --- a/doc/classes/AudioEffectStereoEnhance.xml +++ b/doc/classes/AudioEffectStereoEnhance.xml @@ -7,6 +7,7 @@ An audio effect that can be used to adjust the intensity of stereo panning. </description> <tutorials> + <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> </tutorials> <members> <member name="pan_pullout" type="float" setter="set_pan_pullout" getter="get_pan_pullout" default="1.0"> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 26fe1278f7..e0bc98e208 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -55,6 +55,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1"> The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 7d0470f396..f04f95bd72 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -57,6 +57,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="2000.0"> Maximum distance from which audio is still hearable. @@ -64,6 +65,9 @@ <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1"> The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. </member> + <member name="panning_strength" type="float" setter="set_panning_strength" getter="get_panning_strength" default="1.0"> + Scales the panning strength for this node by multiplying the base [member ProjectSettings.audio/general/2d_panning_strength] with this factor. Higher values will pan audio from left to right more dramatically than lower values. + </member> <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0"> The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. </member> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 8356596f54..72febf7006 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -64,6 +64,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> The bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioStreamPlayer3D.DopplerTracking" default="0"> Decides in which step the Doppler effect should be calculated. @@ -86,6 +87,9 @@ <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1"> The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. </member> + <member name="panning_strength" type="float" setter="set_panning_strength" getter="get_panning_strength" default="1.0"> + Scales the panning strength for this node by multiplying the base [member ProjectSettings.audio/general/3d_panning_strength] with this factor. Higher values will pan audio from left to right more dramatically than lower values. + </member> <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0"> The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. </member> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index f3e2c4b308..d3ae85101d 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -61,14 +61,16 @@ The material's base color. [b]Note:[/b] If [member detail_enabled] is [code]true[/code] and a [member detail_albedo] texture is specified, [member albedo_color] will [i]not[/i] modulate the detail texture. This can be used to color partial areas of a material by not specifying an albedo texture and using a transparent [member detail_albedo] texture instead. </member> - <member name="albedo_tex_force_srgb" type="bool" setter="set_flag" getter="get_flag" default="false"> - Forces a conversion of the [member albedo_texture] from sRGB space to linear space. - </member> - <member name="albedo_tex_msdf" type="bool" setter="set_flag" getter="get_flag" default="false"> - Enables multichannel signed distance field rendering shader. Use [member msdf_pixel_range] and [member msdf_outline_size] to configure MSDF paramenters. - </member> <member name="albedo_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture to multiply by [member albedo_color]. Used for basic texturing of objects. + If the texture appears unexpectedly too dark or too bright, check [member albedo_texture_force_srgb]. + </member> + <member name="albedo_texture_force_srgb" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], forces a conversion of the [member albedo_texture] from sRGB color space to linear color space. See also [member vertex_color_is_srgb]. + This should only be enabled when needed (typically when using a [ViewportTexture] as [member albedo_texture]). If [member albedo_texture_force_srgb] is [code]true[/code] when it shouldn't be, the texture will appear to be too dark. If [member albedo_texture_force_srgb] is [code]false[/code] when it shouldn't be, the texture will appear to be too bright. + </member> + <member name="albedo_texture_msdf" type="bool" setter="set_flag" getter="get_flag" default="false"> + Enables multichannel signed distance field rendering shader. Use [member msdf_pixel_range] and [member msdf_outline_size] to configure MSDF parameters. </member> <member name="alpha_antialiasing_edge" type="float" setter="set_alpha_antialiasing_edge" getter="get_alpha_antialiasing_edge"> Threshold at which antialiasing will be applied on the alpha channel. @@ -357,6 +359,7 @@ </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="BaseMaterial3D.TextureFilter" default="3"> Filter flags for the texture. See [enum TextureFilter] for options. + [b]Note:[/b] [member heightmap_texture] is always sampled with linear filtering, even if nearest-neighbor filtering is selected here. This is to ensure the heightmap effect looks as intended. If you need sharper height transitions between pixels, resize the heightmap texture in an image editor with nearest-neighbor filtering. </member> <member name="texture_repeat" type="bool" setter="set_flag" getter="get_flag" default="true"> Repeat flags for the texture. See [enum TextureFilter] for options. @@ -401,7 +404,8 @@ If [code]true[/code], triplanar mapping for [code]UV2[/code] is calculated in world space rather than object local space. See also [member uv2_triplanar]. </member> <member name="vertex_color_is_srgb" type="bool" setter="set_flag" getter="get_flag" default="false"> - If [code]true[/code], the model's vertex colors are processed as sRGB mode. + If [code]true[/code], vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. If [code]false[/code], vertex colors are considered to be stored in linear color space and are rendered as-is. See also [member albedo_texture_force_srgb]. + [b]Note:[/b] Only effective when using the Vulkan Clustered or Vulkan Mobile backends. </member> <member name="vertex_color_use_as_albedo" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], the vertex color is used as albedo color. @@ -607,7 +611,8 @@ Set [code]ALBEDO[/code] to the per-vertex color specified in the mesh. </constant> <constant name="FLAG_SRGB_VERTEX_COLOR" value="2" enum="Flags"> - Vertex color is in sRGB space and needs to be converted to linear. Only applies in the Vulkan renderer. + Vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. See also [member vertex_color_is_srgb]. + [b]Note:[/b] Only effective when using the Vulkan Clustered or Vulkan Mobile backends. </constant> <constant name="FLAG_USE_POINT_SIZE" value="3" enum="Flags"> Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use [code]POINT_COORD[/code] instead of [code]UV[/code]. @@ -637,7 +642,7 @@ Use [code]UV2[/code] coordinates to look up from the [member emission_texture]. </constant> <constant name="FLAG_ALBEDO_TEXTURE_FORCE_SRGB" value="12" enum="Flags"> - Forces the shader to convert albedo from sRGB space to linear space. + Forces the shader to convert albedo from sRGB space to linear space. See also [member albedo_texture_force_srgb]. </constant> <constant name="FLAG_DONT_RECEIVE_SHADOWS" value="13" enum="Flags"> Disables receiving shadows from other objects. diff --git a/doc/classes/BoneMap.xml b/doc/classes/BoneMap.xml new file mode 100644 index 0000000000..371cb4fa93 --- /dev/null +++ b/doc/classes/BoneMap.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="BoneMap" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Bone map for retargeting. + </brief_description> + <description> + This class contains a hashmap that uses a list of bone names in [SkeletonProfile] as key names. + By assigning the actual [Skeleton3D] bone name as the key value, it maps the [Skeleton3D] to the [SkeletonProfile]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="find_profile_bone_name" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="skeleton_bone_name" type="StringName" /> + <description> + Returns a profile bone name having [code]skeleton_bone_name[/code]. If not found, an empty [StringName] will be returned. + In the retargeting process, the returned bone name is the bone name of the target skeleton. + </description> + </method> + <method name="get_skeleton_bone_name" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="profile_bone_name" type="StringName" /> + <description> + Returns a skeleton bone name is mapped to [code]profile_bone_name[/code]. + In the retargeting process, the returned bone name is the bone name of the source skeleton. + </description> + </method> + <method name="set_skeleton_bone_name"> + <return type="void" /> + <argument index="0" name="profile_bone_name" type="StringName" /> + <argument index="1" name="skeleton_bone_name" type="StringName" /> + <description> + Maps a skeleton bone name to [code]profile_bone_name[/code]. + In the retargeting process, the setting bone name is the bone name of the source skeleton. + </description> + </method> + </methods> + <members> + <member name="profile" type="SkeletonProfile" setter="set_profile" getter="get_profile"> + A [SkeletonProfile] of the mapping target. Key names in the [BoneMap] are synchronized with it. + </member> + </members> + <signals> + <signal name="bone_map_updated"> + <description> + This signal is emitted when change the key value in the [BoneMap]. This is used to validate mapping and to update [BoneMap] editor. + </description> + </signal> + <signal name="profile_updated"> + <description> + This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the [BoneMap] and to redraw the [BoneMap] editor. + </description> + </signal> + </signals> +</class> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index d85d02fbfb..1cd9ca0afb 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -40,29 +40,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants. @@ -92,6 +69,9 @@ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> Base text writing direction. </member> + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> + Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. + </member> </members> <theme_items> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 5008cd826e..468fddcfc1 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -88,14 +88,14 @@ <return type="Vector3" /> <argument index="0" name="screen_point" type="Vector2" /> <description> - Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. </description> </method> <method name="project_ray_origin" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="screen_point" type="Vector2" /> <description> - Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. </description> </method> <method name="set_cull_mask_value"> @@ -155,6 +155,7 @@ </member> <member name="current" type="bool" setter="set_current" getter="is_current" default="false"> If [code]true[/code], the ancestor [Viewport] is currently using this camera. + If multiple cameras are in the scene, one will always be made current. For example, if two [Camera3D] nodes are present in the scene and only one is current, setting one camera's [member current] to [code]false[/code] will cause the other camera to be made current. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera3D.DopplerTracking" default="0"> If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 6cd2da520f..2d68ae6902 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -48,17 +48,26 @@ </description> </method> <method name="draw_char" qualifiers="const"> - <return type="float" /> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="String" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <description> + Draws a string first character using a custom font. + </description> + </method> + <method name="draw_char_outline" qualifiers="const"> + <return type="void" /> <argument index="0" name="font" type="Font" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="String" /> - <argument index="3" name="next" type="String" default="""" /> - <argument index="4" name="size" type="int" default="16" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="size" type="int" default="-1" /> <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> <description> - Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. + Draws a string first character outline using a custom font. </description> </method> <method name="draw_circle"> @@ -67,7 +76,7 @@ <argument index="1" name="radius" type="float" /> <argument index="2" name="color" type="Color" /> <description> - Draws a colored, unfilled circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon]. + Draws a colored, filled circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon]. </description> </method> <method name="draw_colored_polygon"> @@ -127,7 +136,7 @@ <argument index="4" name="outline" type="float" default="0.0" /> <argument index="5" name="pixel_range" type="float" default="4.0" /> <description> - Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontData.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. + Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius. Value of the [code]pixel_range[/code] should the same that was used during distance field texture generation. </description> @@ -157,16 +166,36 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> + <argument index="9" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> + <argument index="10" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="11" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="12" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines and draws text outline using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_multimesh"> <return type="void" /> <argument index="0" name="multimesh" type="MultiMesh" /> @@ -250,11 +279,11 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. [b]Example using the default project font:[/b] @@ -279,6 +308,23 @@ See also [method Font.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draws [code]text[/code] outline using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_style_box"> <return type="void" /> <argument index="0" name="style_box" type="StyleBox" /> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index ab55aeba05..4994ef352e 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -478,7 +478,7 @@ <member name="indent_automatic" type="bool" setter="set_auto_indent_enabled" getter="is_auto_indent_enabled" default="false"> Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found. </member> - <member name="indent_automatic_prefixes" type="String[]" setter="set_auto_indent_prefixes" getter="get_auto_indent_prefixes" default="["(", ":", "[", "{"]"> + <member name="indent_automatic_prefixes" type="String[]" setter="set_auto_indent_prefixes" getter="get_auto_indent_prefixes" default="[":", "{", "[", "("]"> Prefixes to trigger an automatic indent. </member> <member name="indent_size" type="int" setter="set_indent_size" getter="get_indent_size" default="4"> @@ -592,6 +592,9 @@ <theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.29)"> [Color] of the scrollbar in the code completion popup. </theme_item> + <theme_item name="completion_scroll_hovered_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.4)"> + [Color] of the scrollbar in the code completion popup when hovered. + </theme_item> <theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> Background highlight [Color] for the current selected option item in the code completion popup. </theme_item> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 7b8a57ed22..59ad104ad1 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -157,10 +157,28 @@ Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. [code]h[/code] (hue), [code]s[/code] (saturation), and [code]v[/code] (value) are typically between 0 and 1. [codeblocks] [gdscript] - var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) + var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8) [/gdscript] [csharp] - var c = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); + var color = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); + [/csharp] + [/codeblocks] + </description> + </method> + <method name="from_ok_hsl" qualifiers="static"> + <return type="Color" /> + <argument index="0" name="h" type="float" /> + <argument index="1" name="s" type="float" /> + <argument index="2" name="l" type="float" /> + <argument index="3" name="alpha" type="float" default="1.0" /> + <description> + Constructs a color from an [url=https://bottosson.github.io/posts/colorpicker/]OK HSL profile[/url]. [code]h[/code] (hue), [code]s[/code] (saturation), and [code]v[/code] (value) are typically between 0 and 1. + [codeblocks] + [gdscript] + var color = Color.from_ok_hsl(0.58, 0.5, 0.79, 0.8) + [/gdscript] + [csharp] + var color = Color.FromOkHsl(0.58f, 0.5f, 0.79f, 0.8f); [/csharp] [/codeblocks] </description> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 5c47d6fb54..cc9c5877c5 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -37,16 +37,15 @@ <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(1, 1, 1, 1)"> The currently selected color. </member> + <member name="color_mode" type="int" setter="set_color_mode" getter="get_color_mode" enum="ColorPicker.ColorModeType" default="0"> + The currently selected color mode. See [enum ColorModeType]. + </member> <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false"> If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). </member> <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true"> If [code]true[/code], shows an alpha channel slider (opacity). </member> - <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false"> - If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders. - [b]Note:[/b] Cannot be enabled if raw mode is on. - </member> <member name="picker_shape" type="int" setter="set_picker_shape" getter="get_picker_shape" enum="ColorPicker.PickerShapeType" default="0"> The shape of the color space view. See [enum PickerShapeType]. </member> @@ -56,10 +55,6 @@ <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true"> If [code]true[/code], saved color presets are visible. </member> - <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false"> - If [code]true[/code], allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). - [b]Note:[/b] Cannot be enabled if HSV mode is on. - </member> </members> <signals> <signal name="color_changed"> @@ -82,6 +77,20 @@ </signal> </signals> <constants> + <constant name="MODE_RGB" value="0" enum="ColorModeType"> + Allows editing the color with Red/Green/Blue sliders. + </constant> + <constant name="MODE_HSV" value="1" enum="ColorModeType"> + Allows editing the color with Hue/Saturation/Value sliders. + </constant> + <constant name="MODE_RAW" value="2" enum="ColorModeType"> + Allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). + </constant> + <constant name="MODE_OKHSL" value="3" enum="ColorModeType"> + Allows editing the color with Hue/Saturation/Lightness sliders. + OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue. + [url=https://bottosson.github.io/posts/colorpicker/]Okhsv and Okhsl color spaces[/url] + </constant> <constant name="SHAPE_HSV_RECTANGLE" value="0" enum="PickerShapeType"> HSV Color Model rectangle color space. </constant> @@ -91,6 +100,9 @@ <constant name="SHAPE_VHS_CIRCLE" value="2" enum="PickerShapeType"> HSV Color Model circle color space. Use Saturation as a radius. </constant> + <constant name="SHAPE_OKHSL_CIRCLE" value="3" enum="PickerShapeType"> + HSL OK Color Model circle color space. + </constant> </constants> <theme_items> <theme_item name="h_width" data_type="constant" type="int" default="30"> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 53d35c1a3d..75a715789c 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -6,7 +6,7 @@ <description> Encapsulates a [ColorPicker] making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker] visibility. See also [BaseButton] which contains common properties and methods associated with this node. - [b]Note:[/b] By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [member Control.minimum_size] to a big enough value to give the button enough space. + [b]Note:[/b] By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [member Control.custom_minimum_size] to a big enough value to give the button enough space. </description> <tutorials> <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link> diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 2316e32b5d..d4c503857d 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -27,6 +27,9 @@ </method> </methods> <members> + <member name="cancel_button_text" type="String" setter="set_cancel_button_text" getter="get_cancel_button_text" default=""Cancel""> + The text displayed by the cancel button (see [method get_cancel_button]). + </member> <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" overrides="Window" default="Vector2i(200, 70)" /> <member name="size" type="Vector2i" setter="set_size" getter="get_size" overrides="Window" default="Vector2i(200, 100)" /> <member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default=""Please Confirm..."" /> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index d084bd4db9..9fc80e1aab 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -100,7 +100,7 @@ <method name="_get_minimum_size" qualifiers="virtual const"> <return type="Vector2" /> <description> - Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member minimum_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). + Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member custom_minimum_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). If not overridden, defaults to [constant Vector2.ZERO]. [b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc. </description> @@ -157,7 +157,7 @@ Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property. The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead. The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member hint_tooltip] for an example). - [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member minimum_size] to some non-zero value. + [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member custom_minimum_size] to some non-zero value. [b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. Example of usage with a custom-constructed node: [codeblocks] @@ -357,7 +357,7 @@ <method name="get_combined_minimum_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns combined minimum size from [member minimum_size] and [method get_minimum_size]. + Returns combined minimum size from [member custom_minimum_size] and [method get_minimum_size]. </description> </method> <method name="get_cursor_shape" qualifiers="const"> @@ -389,7 +389,7 @@ <method name="get_minimum_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns the minimum size for this control. See [member minimum_size]. + Returns the minimum size for this control. See [member custom_minimum_size]. </description> </method> <method name="get_offset" qualifiers="const"> @@ -939,7 +939,7 @@ <method name="update_minimum_size"> <return type="void" /> <description> - Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member minimum_size] directly calls this method automatically. + Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically. </description> </method> <method name="warp_mouse"> @@ -970,6 +970,9 @@ <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false"> Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. </member> + <member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> + The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. + </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. </member> @@ -1027,9 +1030,6 @@ <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0"> Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). </member> - <member name="minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> - The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. - </member> <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape" default="0"> The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. [b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system. @@ -1037,6 +1037,10 @@ <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter" default="0"> Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does. </member> + <member name="mouse_force_pass_scroll_events" type="bool" setter="set_force_pass_scroll_events" getter="is_force_pass_scroll_events" default="true"> + When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP]. As it defaults to true, this allows nested scrollable containers to work out of the box. + You should disable it on the root of your UI if you do not want scroll events to go to the [code]_unhandled_input[/code] processing. + </member> <member name="offset_bottom" type="float" setter="set_offset" getter="get_offset" default="0.0"> Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. @@ -1194,10 +1198,10 @@ Show the system's cross mouse cursor when the user hovers the node. </constant> <constant name="CURSOR_WAIT" value="4" enum="CursorShape"> - Show the system's wait mouse cursor, often an hourglass, when the user hovers the node. + Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. </constant> <constant name="CURSOR_BUSY" value="5" enum="CursorShape"> - Show the system's busy mouse cursor when the user hovers the node. Often an hourglass. + Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. </constant> <constant name="CURSOR_DRAG" value="6" enum="CursorShape"> Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. @@ -1277,8 +1281,8 @@ <constant name="PRESET_HCENTER_WIDE" value="14" enum="LayoutPreset"> Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset]. </constant> - <constant name="PRESET_WIDE" value="15" enum="LayoutPreset"> - Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with [method set_anchors_preset]. + <constant name="PRESET_FULL_RECT" value="15" enum="LayoutPreset"> + Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_MODE_MINSIZE" value="0" enum="LayoutPresetMode"> The control will be resized to its minimum size. @@ -1315,7 +1319,7 @@ The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. </constant> <constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter"> - The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired. + The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. If no control handled it, the event will be passed to `_unhandled_input` for further processing. </constant> <constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter"> The control will not receive mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index c0a76dc80e..4936fc1d85 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -68,7 +68,6 @@ } [/csharp] [/codeblocks] - [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index b0abdf60c8..8496c6dec1 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -6,7 +6,6 @@ <description> The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource]. They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed_certificate] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate. - [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index 16d0e82a1f..383d33532b 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -38,12 +38,6 @@ Removes all points from the curve. </description> </method> - <method name="get_point_count" qualifiers="const"> - <return type="int" /> - <description> - Returns the number of points describing the curve. - </description> - </method> <method name="get_point_left_mode" qualifiers="const"> <return type="int" enum="Curve.TangentMode" /> <argument index="0" name="index" type="int" /> @@ -159,6 +153,9 @@ <member name="min_value" type="float" setter="set_min_value" getter="get_min_value" default="0.0"> The minimum value the curve can reach. </member> + <member name="point_count" type="int" setter="set_point_count" getter="get_point_count" default="0"> + The number of points describing the curve. + </member> </members> <signals> <signal name="range_changed"> diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml index 94e52912a1..3bba825aaa 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -55,12 +55,6 @@ [code]to_point[/code] must be in this curve's local space. </description> </method> - <method name="get_point_count" qualifiers="const"> - <return type="int" /> - <description> - Returns the number of points describing the curve. - </description> - </method> <method name="get_point_in" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="idx" type="int" /> @@ -155,5 +149,8 @@ <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" default="5.0"> The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. </member> + <member name="point_count" type="int" setter="set_point_count" getter="get_point_count" default="0"> + The number of points describing the curve. + </member> </members> </class> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index ed642e0ddc..6457d9681e 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -68,12 +68,6 @@ [code]to_point[/code] must be in this curve's local space. </description> </method> - <method name="get_point_count" qualifiers="const"> - <return type="int" /> - <description> - Returns the number of points describing the curve. - </description> - </method> <method name="get_point_in" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="idx" type="int" /> @@ -194,6 +188,9 @@ <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" default="0.2"> The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. </member> + <member name="point_count" type="int" setter="set_point_count" getter="get_point_count" default="0"> + The number of points describing the curve. + </member> <member name="up_vector_enabled" type="bool" setter="set_up_vector_enabled" getter="is_up_vector_enabled" default="true"> If [code]true[/code], the curve will bake up vectors used for orientation. This is used when [member PathFollow3D.rotation_mode] is set to [constant PathFollow3D.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed. </member> diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 6aa39e453e..85473fc237 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -5,23 +5,27 @@ </brief_description> <description> Renders a given [Curve] provided to it. Simplifies the task of drawing curves and/or saving them as image files. + If you need to store up to 3 curves within a single texture, use [CurveXYZTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]. </description> <tutorials> </tutorials> <members> <member name="curve" type="Curve" setter="set_curve" getter="get_curve"> - The [code]curve[/code] rendered onto the texture. + The [Curve] that is rendered onto the texture. </member> <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0"> + The format the texture should be generated with. When passing a CurveTexture as a input to a [Shader], this may need to be adjusted. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="256"> - The width of the texture. + The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. </member> </members> <constants> <constant name="TEXTURE_MODE_RGB" value="0" enum="TextureMode"> + Store the curve equally across the red, green and blue channels. This uses more video memory, but is more compatible with shaders that only read the green and blue values. </constant> <constant name="TEXTURE_MODE_RED" value="1" enum="TextureMode"> + Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this. </constant> </constants> </class> diff --git a/doc/classes/CurveXYZTexture.xml b/doc/classes/CurveXYZTexture.xml index d289e394aa..e3f2e8fc45 100644 --- a/doc/classes/CurveXYZTexture.xml +++ b/doc/classes/CurveXYZTexture.xml @@ -1,19 +1,26 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CurveXYZTexture" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + A texture that shows 3 different curves (stored on the red, green and blue color channels). </brief_description> <description> + Renders 3 given [Curve]s provided to it, on the red, green and blue channels respectively. Compared to using separate [CurveTexture]s, this further simplifies the task of drawing curves and/or saving them as image files. + If you only need to store one curve within a single texture, use [CurveTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]. </description> <tutorials> </tutorials> <members> <member name="curve_x" type="Curve" setter="set_curve_x" getter="get_curve_x"> + The [Curve] that is rendered onto the texture's red channel. </member> <member name="curve_y" type="Curve" setter="set_curve_y" getter="get_curve_y"> + The [Curve] that is rendered onto the texture's green channel. </member> <member name="curve_z" type="Curve" setter="set_curve_z" getter="get_curve_z"> + The [Curve] that is rendered onto the texture's blue channel. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="256"> + The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. </member> </members> </class> diff --git a/doc/classes/CylinderMesh.xml b/doc/classes/CylinderMesh.xml index e141ba8203..045c3b914b 100644 --- a/doc/classes/CylinderMesh.xml +++ b/doc/classes/CylinderMesh.xml @@ -10,7 +10,15 @@ </tutorials> <members> <member name="bottom_radius" type="float" setter="set_bottom_radius" getter="get_bottom_radius" default="0.5"> - Bottom radius of the cylinder. If set to [code]0.0[/code], the bottom faces will not be generated, resulting in a conic shape. + Bottom radius of the cylinder. If set to [code]0.0[/code], the bottom faces will not be generated, resulting in a conic shape. See also [member cap_bottom]. + </member> + <member name="cap_bottom" type="bool" setter="set_cap_bottom" getter="is_cap_bottom" default="true"> + If [code]true[/code], generates a cap at the bottom of the cylinder. This can be set to [code]false[/code] to speed up generation and rendering when the cap is never seen by the camera. See also [member bottom_radius]. + [b]Note:[/b] If [member bottom_radius] is [code]0.0[/code], cap generation is always skipped even if [member cap_bottom] is [code]true[/code]. + </member> + <member name="cap_top" type="bool" setter="set_cap_top" getter="is_cap_top" default="true"> + If [code]true[/code], generates a cap at the top of the cylinder. This can be set to [code]false[/code] to speed up generation and rendering when the cap is never seen by the camera. See also [member top_radius]. + [b]Note:[/b] If [member top_radius] is [code]0.0[/code], cap generation is always skipped even if [member cap_top] is [code]true[/code]. </member> <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> Full height of the cylinder. @@ -22,7 +30,7 @@ Number of edge rings along the height of the cylinder. Changing [member rings] does not have any visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher values result in more subdivisions, which can be used to create smoother-looking effects with shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data using a shader or procedural mesh tool, [member rings] should be kept to its default value. </member> <member name="top_radius" type="float" setter="set_top_radius" getter="get_top_radius" default="0.5"> - Top radius of the cylinder. If set to [code]0.0[/code], the top faces will not be generated, resulting in a conic shape. + Top radius of the cylinder. If set to [code]0.0[/code], the top faces will not be generated, resulting in a conic shape. See also [member cap_top]. </member> </members> </class> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index 342bc762af..861b4b480c 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -7,6 +7,7 @@ [Decal]s are used to project a texture onto a [Mesh] in the scene. Use Decals to add detail to a scene without affecting the underlying [Mesh]. They are often used to add weathering to building, add dirt or mud to the ground, or add variety to props. Decals can be moved at any time, making them suitable for things like blob shadows or laser sight dots. They are made of an [AABB] and a group of [Texture2D]s specifying [Color], normal, ORM (ambient occlusion, roughness, metallic), and emission. Decals are projected within their [AABB] so altering the orientation of the Decal affects the direction in which they are projected. By default, Decals are projected down (i.e. from positive Y to negative Y). The [Texture2D]s associated with the Decal are automatically stored in a texture atlas which is used for drawing the decals so all decals can be drawn at once. Godot uses clustered decals, meaning they are stored in cluster data and drawn when the mesh is drawn, they are not drawn as a post-processing effect after. + [b]Note:[/b] Decals cannot affect an underlying material's transparency, regardless of its transparency mode (alpha blend, alpha scissor, alpha hash, opaque pre-pass). This means translucent or transparent areas of a material will remain translucent or transparent even if an opaque decal is applied on them. </description> <tutorials> </tutorials> @@ -78,7 +79,7 @@ Sets the size of the [AABB] used by the decal. The AABB goes from [code]-extents[/code] to [code]extents[/code]. </member> <member name="lower_fade" type="float" setter="set_lower_fade" getter="get_lower_fade" default="0.3"> - Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. + Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> Changes the [Color] of the Decal by multiplying it with this value. @@ -88,18 +89,22 @@ </member> <member name="texture_albedo" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the base [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_emission" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_normal" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_orm" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="upper_fade" type="float" setter="set_upper_fade" getter="get_upper_fade" default="0.3"> - Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. + Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). </member> </members> <constants> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 8ee09ba8f8..6f2ad5205c 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -43,7 +43,7 @@ You can access a dictionary's values by referencing the appropriate 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(String, "White", "Yellow", "Orange") var my_color var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} func _ready(): # We can't use dot syntax here as `my_color` is a variable. @@ -291,6 +291,14 @@ Returns the list of keys in the [Dictionary]. </description> </method> + <method name="merge"> + <return type="void" /> + <argument index="0" name="dictionary" type="Dictionary" /> + <argument index="1" name="overwrite" type="bool" default="false" /> + <description> + Adds elements from [code]dictionary[/code] to this [Dictionary]. By default, duplicate keys will not be copied over, unless [code]overwrite[/code] is [code]true[/code]. + </description> + </method> <method name="size" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index b1fd7b4e76..6fd5abe369 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -11,9 +11,11 @@ <method name="add_filter"> <return type="void" /> <argument index="0" name="filter" type="String" /> + <argument index="1" name="description" type="String" default="""" /> <description> - Adds a comma-delimited file extension filter option to the [EditorFileDialog] with an optional semi-colon-delimited label. - For example, [code]"*.tscn, *.scn; Scenes"[/code] results in filter text "Scenes (*.tscn, *.scn)". + Adds a comma-delimited file name [code]filter[/code] option to the [EditorFileDialog] with an optional [code]description[/code], which restricts what files can be picked. + A [code]filter[/code] should be of the form [code]"filename.extension"[/code], where filename and extension can be [code]*[/code] to match any string. Filters starting with [code].[/code] (i.e. empty filenames) are not allowed. + For example, a [code]filter[/code] of [code]"*.tscn, *.scn"[/code] and a [code]description[/code] of [code]"Scenes"[/code] results in filter text "Scenes (*.tscn, *.scn)". </description> </method> <method name="clear_filters"> diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml index 300cb4bfd6..402efba34a 100644 --- a/doc/classes/EditorFileSystem.xml +++ b/doc/classes/EditorFileSystem.xml @@ -39,7 +39,16 @@ <method name="is_scanning" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] of the filesystem is being scanned. + Returns [code]true[/code] if the filesystem is being scanned. + </description> + </method> + <method name="reimport_files"> + <return type="void" /> + <argument index="0" name="files" type="PackedStringArray" /> + <description> + Reimports a set of files. Call this if these files or their [code].import[/code] files were directly edited by script or an external program. + If the file type changed or the file was newly created, use [method update_file] or [method scan]. + [b]Note:[/b] This function blocks until the import is finished. However, the main loop iteration, including timers and [method Node._process], will occur during the import process due to progress bar updates. Avoid calls to [method reimport_files] or [method scan] while an import is in progress. </description> </method> <method name="scan"> @@ -58,7 +67,8 @@ <return type="void" /> <argument index="0" name="path" type="String" /> <description> - Update a file information. Call this if an external program (not Godot) modified the file. + Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program. + This will not import the file. To reimport, call [method reimport_files] or [method scan] methods. </description> </method> <method name="update_script_classes"> diff --git a/doc/classes/EditorFileSystemImportFormatSupportQuery.xml b/doc/classes/EditorFileSystemImportFormatSupportQuery.xml index 8431a3a7ef..abd77909bd 100644 --- a/doc/classes/EditorFileSystemImportFormatSupportQuery.xml +++ b/doc/classes/EditorFileSystemImportFormatSupportQuery.xml @@ -4,7 +4,7 @@ Used to query and configure import format support. </brief_description> <description> - This class is used to query and configure a certain import format. It is used in conjuntion with asset format import plugins. + This class is used to query and configure a certain import format. It is used in conjunction with asset format import plugins. </description> <tutorials> </tutorials> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 2bbed84b1e..572d5d9d84 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -77,6 +77,7 @@ <return type="void" /> <argument index="0" name="property" type="String" /> <argument index="1" name="editor" type="Control" /> + <argument index="2" name="add_to_end" type="bool" default="false" /> <description> Adds a property editor for an individual property. The [code]editor[/code] control must extend [EditorProperty]. </description> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 7bbb2ae26c..2930c2ec22 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -261,14 +261,28 @@ <method name="_get_state" qualifiers="virtual const"> <return type="Dictionary" /> <description> - Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). + Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an [code]editstate[/code] file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use [method _get_window_layout] instead. + Use [method _set_state] to restore your saved state. + [b]Note:[/b] This method should not be used to save important settings that should persist with the project. + [b]Note:[/b] You must implement [method _get_plugin_name] for the state to be stored and restored correctly. + [codeblock] + func _get_state(): + var state = {"zoom": zoom, "preferred_color": my_color} + return state + [/codeblock] </description> </method> <method name="_get_window_layout" qualifiers="virtual"> <return type="void" /> <argument index="0" name="configuration" type="ConfigFile" /> <description> - Gets the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock). + Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the [code]editor_layout.cfg[/code] file in the editor metadata directory. + Use [method _set_window_layout] to restore your saved layout. + [codeblock] + func _get_window_layout(configuration): + configuration.set_value("MyPlugin", "window_position", $Window.position) + configuration.set_value("MyPlugin", "icon_color", $Icon.modulate) + [/codeblock] </description> </method> <method name="_handles" qualifiers="virtual const"> @@ -282,6 +296,28 @@ <return type="bool" /> <description> Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]). + When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of [method EditorInterface.get_base_control] and made visible inside [method _make_visible]. + Use [method _get_plugin_name] and [method _get_plugin_icon] to customize the plugin button's appearance. + [codeblock] + var plugin_control + + func _enter_tree(): + plugin_control = preload("my_plugin_control.tscn").instantiate() + get_editor_interface().get_editor_main_control().add_child(plugin_control) + plugin_control.hide() + + func _has_main_screen(): + return true + + func _make_visible(visible): + plugin_control.visible = visible + + func _get_plugin_name(): + return "My Super Cool Plugin 3000" + + func _get_plugin_icon(): + return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons") + [/codeblock] </description> </method> <method name="_make_visible" qualifiers="virtual"> @@ -302,14 +338,25 @@ <return type="void" /> <argument index="0" name="state" type="Dictionary" /> <description> - Restore the state saved by [method _get_state]. + Restore the state saved by [method _get_state]. This method is called when the current scene tab is changed in the editor. + [b]Note:[/b] Your plugin must implement [method _get_plugin_name], otherwise it will not be recognized and this method will not be called. + [codeblock] + func _set_state(data): + zoom = data.get("zoom", 1.0) + preferred_color = data.get("my_color", Color.white) + [/codeblock] </description> </method> <method name="_set_window_layout" qualifiers="virtual"> <return type="void" /> <argument index="0" name="configuration" type="ConfigFile" /> <description> - Restore the plugin GUI layout saved by [method _get_window_layout]. + Restore the plugin GUI layout and data saved by [method _get_window_layout]. This method is called for every plugin on editor startup. Use the provided [code]configuration[/code] file to read your saved data. + [codeblock] + func _set_window_layout(configuration): + $Window.position = configuration.get_value("MyPlugin", "window_position", Vector2()) + $Icon.modulate = configuration.get_value("MyPlugin", "icon_color", Color.white) + [/codeblock] </description> </method> <method name="add_autoload_singleton"> @@ -479,7 +526,7 @@ <method name="get_script_create_dialog"> <return type="ScriptCreateDialog" /> <description> - Gets the Editor's dialogue used for making scripts. + Gets the Editor's dialog used for making scripts. [b]Note:[/b] Users can configure it before use. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index c428233372..84f8523da3 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -38,7 +38,7 @@ Gets the edited object. </description> </method> - <method name="get_edited_property"> + <method name="get_edited_property" qualifiers="const"> <return type="StringName" /> <description> Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. diff --git a/doc/classes/EditorScenePostImportPlugin.xml b/doc/classes/EditorScenePostImportPlugin.xml index 0fdbd5db1e..44d644411d 100644 --- a/doc/classes/EditorScenePostImportPlugin.xml +++ b/doc/classes/EditorScenePostImportPlugin.xml @@ -88,7 +88,7 @@ <argument index="2" name="default_value" type="Variant" /> <argument index="3" name="hint" type="int" enum="PropertyHint" default="0" /> <argument index="4" name="hint_string" type="String" default="""" /> - <argument index="5" name="usage_flags" type="int" default="7" /> + <argument index="5" name="usage_flags" type="int" default="6" /> <description> Add a specific import option. This function can only be called from [method _get_import_options] and [method _get_internal_import_options]. </description> @@ -114,7 +114,9 @@ </constant> <constant name="INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE" value="5" enum="InternalImportCategory"> </constant> - <constant name="INTERNAL_IMPORT_CATEGORY_MAX" value="6" enum="InternalImportCategory"> + <constant name="INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE" value="6" enum="InternalImportCategory"> + </constant> + <constant name="INTERNAL_IMPORT_CATEGORY_MAX" value="7" enum="InternalImportCategory"> </constant> </constants> </class> diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 96dea1edce..2ada211dab 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -11,6 +11,9 @@ <members> <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> </member> + <member name="hide_slider" type="bool" setter="set_hide_slider" getter="is_hiding_slider" default="false"> + If [code]true[/code], the slider is hidden. + </member> <member name="label" type="String" setter="set_label" getter="get_label" default=""""> </member> <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false"> diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index b37de09e04..50979c9b68 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -56,6 +56,7 @@ <argument index="0" name="inputs" type="Array" default="[]" /> <argument index="1" name="base_instance" type="Object" default="null" /> <argument index="2" name="show_error" type="bool" default="true" /> + <argument index="3" name="const_calls_only" type="bool" default="false" /> <description> Executes the expression that was previously parsed by [method parse] and returns the result. Before you use the returned object, you should check if the method failed by calling [method has_execute_failed]. If you defined input variables in [method parse], you can specify their values in the inputs array, in the same order. diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index db536a738a..f45031cea8 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -12,10 +12,11 @@ <method name="add_filter"> <return type="void" /> <argument index="0" name="filter" type="String" /> + <argument index="1" name="description" type="String" default="""" /> <description> - Adds [code]filter[/code] to the list of filters, which restricts what files can be picked. - A [code]filter[/code] should be of the form [code]"filename.extension ; Description"[/code], where filename and extension can be [code]*[/code] to match any string. Filters starting with [code].[/code] (i.e. empty filenames) are not allowed. - Example filters: [code]"*.png ; PNG Images"[/code], [code]"project.godot ; Godot Project"[/code]. + Adds a comma-delimited file name [code]filter[/code] option to the [FileDialog] with an optional [code]description[/code], which restricts what files can be picked. + A [code]filter[/code] should be of the form [code]"filename.extension"[/code], where filename and extension can be [code]*[/code] to match any string. Filters starting with [code].[/code] (i.e. empty filenames) are not allowed. + For example, a [code]filter[/code] of [code]"*.png, *.jpg"[/code] and a [code]description[/code] of [code]"Images"[/code] results in filter text "Images (*.png, *.jpg)". </description> </method> <method name="clear_filters"> @@ -75,6 +76,9 @@ <member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title" default="true"> If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File"). </member> + <member name="root_subfolder" type="String" setter="set_root_subfolder" getter="get_root_subfolder" default=""""> + If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory. + </member> <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false"> If [code]true[/code], the dialog will show hidden files. </member> @@ -130,7 +134,7 @@ <theme_item name="file_icon_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The color modulation applied to the file icon. </theme_item> - <theme_item name="files_disabled" data_type="color" type="Color" default="Color(0, 0, 0, 0.7)"> + <theme_item name="files_disabled" data_type="color" type="Color" default="Color(1, 1, 1, 0.25)"> The color tint for disabled files (when the [FileDialog] is used in open folder mode). </theme_item> <theme_item name="folder_icon_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> diff --git a/doc/classes/FogVolume.xml b/doc/classes/FogVolume.xml index d28a6a8783..3f2ee3035c 100644 --- a/doc/classes/FogVolume.xml +++ b/doc/classes/FogVolume.xml @@ -11,14 +11,15 @@ </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> - Sets the size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. + Sets the size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. [b]Note:[/b] Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth] (at a performance cost) or by decreasing [member Environment.volumetric_fog_length] (at no performance cost, but at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a lower density in the [member material]. + [b]Note:[/b] If [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the extents. Non-uniform scaling of cone/cylinder shapes via the [member extents] property is not supported, but you can scale the [FogVolume] node instead. </member> <member name="material" type="Material" setter="set_material" getter="get_material"> Sets the [Material] to be used by the [FogVolume]. Can be either a [FogMaterial] or a custom [ShaderMaterial]. </member> - <member name="shape" type="int" setter="set_shape" getter="get_shape" enum="RenderingServer.FogVolumeShape" default="1"> - Sets the shape of the [FogVolume] to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX], or [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. + <member name="shape" type="int" setter="set_shape" getter="get_shape" enum="RenderingServer.FogVolumeShape" default="3"> + Sets the shape of the [FogVolume] to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. </member> </members> </class> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index dae42ddf34..e95f444d55 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -1,93 +1,36 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Font" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font class is set of font data sources used to draw text. + Base class for fonts and font variations. </brief_description> <description> - Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning. - [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. - [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. - [b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. - [codeblocks] - [gdscript] - var font = Font.new() - font.add_data(load("res://BarlowCondensed-Bold.ttf")) - $"Label".set("custom_fonts/font", font) - $"Label".set("custom_fonts/font_size", 64) - [/gdscript] - [csharp] - var font = new Font(); - font.AddData(ResourceLoader.Load<FontData>("res://BarlowCondensed-Bold.ttf")); - GetNode("Label").Set("custom_fonts/font", font); - GetNode("Label").Set("custom_font_sizes/font_size", 64); - [/csharp] - [/codeblocks] - To control font substitution priority use [FontData] language and script support. - Use language overrides to use same [Font] stack for multiple languages: - [codeblocks] - [gdscript] - # Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf"); - font_data_fa.set_language_support_override("fa", true); - font_data_fa.set_language_support_override("ur", false); - - var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf"); - font_data_ur.set_language_support_override("fa", false); - font_data_ur.set_language_support_override("ur", true); - [/gdscript] - [csharp] - // Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var fontDataFA = ResourceLoader.Load<FontData>("res://NotoNaskhArabicUI_Regular.ttf"); - fontDataFA.SetLanguageSupportOverride("fa", true); - fontDataFA.SetLanguageSupportOverride("ur", false); - - var fontDataUR = ResourceLoader.Load<FontData>("res://NotoNastaliqUrdu_Regular.ttf"); - fontDataUR.SetLanguageSupportOverride("fa", false); - fontDataUR.SetLanguageSupportOverride("ur", true); - [/csharp] - [/codeblocks] - Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format: - [codeblocks] - [gdscript] - # Use specified font for Egyptian hieroglyphs. - var font_data = load("res://unifont.ttf"); - font_data.set_script_support_override("Egyp", true); - [/gdscript] - [csharp] - // Use specified font for Egyptian hieroglyphs. - var fontData = ResourceLoader.Load<FontData>("res://unifont.ttf"); - fontData.SetScriptSupportOverride("Egyp", true); - [/csharp] - [/codeblocks] + Font is the abstract base class for font, so it shouldn't be used directly. Other types of fonts inherit from it. </description> <tutorials> </tutorials> <methods> - <method name="add_data"> - <return type="void" /> - <argument index="0" name="data" type="FontData" /> - <description> - Add font data source to the set. - </description> - </method> - <method name="clear_data"> - <return type="void" /> + <method name="draw_char" qualifiers="const"> + <return type="float" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="int" /> + <argument index="3" name="modulate" type="int" /> + <argument index="4" name="arg4" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Removes all font data sourcers for the set. + Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> - <method name="draw_char" qualifiers="const"> + <method name="draw_char_outline" qualifiers="const"> <return type="float" /> <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="int" /> - <argument index="3" name="next" type="int" default="0" /> - <argument index="4" name="size" type="int" default="16" /> - <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> + <argument index="3" name="size" type="int" /> + <argument index="4" name="modulate" type="int" default="-1" /> + <argument index="5" name="arg5" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + Draw a single Unicode character [code]char[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> @@ -98,17 +41,38 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> + <argument index="9" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_multiline_string]. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> + <argument index="10" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="11" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="12" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws text outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_multiline_string_outline]. + </description> + </method> <method name="draw_string" qualifiers="const"> <return type="void" /> <argument index="0" name="canvas_item" type="RID" /> @@ -116,19 +80,47 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draw [code]text[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_string_outline]. + </description> + </method> + <method name="find_variation" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="variation_coordinates" type="Dictionary" /> + <argument index="1" name="face_index" type="int" default="0" /> + <argument index="2" name="strength" type="float" default="0.0" /> + <argument index="3" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)" /> + <description> + Returns [TextServer] RID of the font cache for specific variation. + </description> + </method> <method name="get_ascent" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the average font ascent (number of pixels above the baseline). [b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line). @@ -137,44 +129,53 @@ <method name="get_char_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="char" type="int" /> - <argument index="1" name="next" type="int" default="0" /> - <argument index="2" name="size" type="int" default="16" /> + <argument index="1" name="arg1" type="int" /> <description> Returns the size of a character, optionally taking kerning into account if the next character is provided. [b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height. </description> </method> - <method name="get_data" qualifiers="const"> - <return type="FontData" /> - <argument index="0" name="idx" type="int" /> + <method name="get_descent" qualifiers="const"> + <return type="float" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> - Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code]. + Returns the average font descent (number of pixels below the baseline). + [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). </description> </method> - <method name="get_data_count" qualifiers="const"> + <method name="get_face_count" qualifiers="const"> <return type="int" /> <description> - Returns the number of font data sources. + Returns number of faces in the TrueType / OpenType collection. </description> </method> - <method name="get_data_rid" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="idx" type="int" /> + <method name="get_fallbacks" qualifiers="const"> + <return type="Font[]" /> <description> - Returns TextServer RID of the font data resources. + Returns array of fallback [Font]s. </description> </method> - <method name="get_descent" qualifiers="const"> - <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <method name="get_font_name" qualifiers="const"> + <return type="String" /> <description> - Returns the average font descent (number of pixels below the baseline). - [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). + Returns font family name. + </description> + </method> + <method name="get_font_style" qualifiers="const"> + <return type="int" enum="TextServer.FontStyle" /> + <description> + Returns font style flags, see [enum TextServer.FontStyle]. + </description> + </method> + <method name="get_font_style_name" qualifiers="const"> + <return type="String" /> + <description> + Returns font style name. </description> </method> <method name="get_height" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the total average font height (ascent plus descent) in pixels. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line). @@ -183,18 +184,29 @@ <method name="get_multiline_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="width" type="float" default="-1" /> - <argument index="2" name="size" type="int" default="16" /> - <argument index="3" name="flags" type="int" default="96" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="max_lines" type="int" default="-1" /> + <argument index="5" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> + <argument index="6" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="7" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="8" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. See also [method draw_multiline_string]. </description> </method> + <method name="get_opentype_features" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns a set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </description> + </method> <method name="get_rids" qualifiers="const"> - <return type="Array" /> + <return type="RID[]" /> <description> - Returns [Array] of valid [FontData] [RID]s, which can be passed to the [TextServer] methods. + Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. </description> </method> <method name="get_spacing" qualifiers="const"> @@ -207,10 +219,12 @@ <method name="get_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="size" type="int" default="16" /> - <argument index="2" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> - <argument index="3" name="width" type="float" default="-1" /> - <argument index="4" name="flags" type="int" default="3" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> + <argument index="5" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="6" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string, taking kerning and advance into account. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. @@ -224,9 +238,22 @@ If a given character is included in more than one font data source, it appears only once in the returned string. </description> </method> + <method name="get_supported_feature_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of OpenType features supported by font. + </description> + </method> + <method name="get_supported_variation_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. + Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. + </description> + </method> <method name="get_underline_position" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average pixel offset of the underline below the baseline. [b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -234,7 +261,7 @@ </method> <method name="get_underline_thickness" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average thickness of the underline. [b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -247,45 +274,34 @@ Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> - <method name="remove_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> + <method name="is_language_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="language" type="String" /> <description> - Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). </description> </method> - <method name="set_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="data" type="FontData" /> + <method name="is_script_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="script" type="String" /> <description> - Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). </description> </method> - <method name="set_spacing"> + <method name="set_cache_capacity"> <return type="void" /> - <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="1" name="value" type="int" /> + <argument index="0" name="single_line" type="int" /> + <argument index="1" name="multi_line" type="int" /> <description> - Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + Sets LRU cache capacity for [code]draw_*[/code] methods. </description> </method> - <method name="update_changes"> + <method name="set_fallbacks"> <return type="void" /> + <argument index="0" name="fallbacks" type="Font[]" /> <description> - After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it. + Sets array of fallback [Font]s. </description> </method> </methods> - <members> - <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the bottom of the line in pixels. - </member> - <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the top of the line in pixels. - </member> - <member name="variation_coordinates" type="Dictionary" setter="set_variation_coordinates" getter="get_variation_coordinates" default="{}"> - Default font [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url]. - </member> - </members> </class> diff --git a/doc/classes/FontData.xml b/doc/classes/FontFile.xml index a423d7a4e4..aaf871d55a 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontFile.xml @@ -1,13 +1,32 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="FontData" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="FontFile" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font source data and prerendered glyph cache, imported from dynamic or bitmap font. + FontFile source data and prerendered glyph cache, imported from dynamic or bitmap font. + </brief_description> + <description> + [FontFile] contains a set of glyphs to represent Unicode characters imported from a font file, as well as a cache of rasterized glyphs, and a set of fallback [Font]s to use. + Use [FontVariation] to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text. + For more complex text processing, use [FontVariation] in conjunction with [TextLine] or [TextParagraph]. Supported font formats: - - Dynamic font importer: TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm). + - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm). - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants. - Monospace image font importer: All supported image formats. - </brief_description> - <description> + [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. + [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. + [b]Note:[/b] If a none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. + + [codeblocks] + [gdscript] + var f = load("res://BarlowCondensed-Bold.ttf") + $"Label".set("custom_fonts/font", f) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf"); + GetNode("Label").Set("custom_fonts/font", f); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> @@ -51,14 +70,7 @@ [b]Note:[/b] This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually. </description> </method> - <method name="find_cache" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="variation_coordinates" type="Dictionary" /> - <description> - Returns existing or creates a new font cache entry for the specified variation coordinates. - </description> - </method> - <method name="get_ascent" qualifiers="const"> + <method name="get_cache_ascent" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> @@ -72,19 +84,46 @@ Returns number of the font cache entries. </description> </method> - <method name="get_cache_rid" qualifiers="const"> - <return type="RID" /> + <method name="get_cache_descent" qualifiers="const"> + <return type="float" /> <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> <description> - Returns text server font cache entry resource id. </description> </method> - <method name="get_descent" qualifiers="const"> + <method name="get_cache_scale" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <description> - Returns font descent (number of pixels below the baseline). + </description> + </method> + <method name="get_cache_underline_position" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_cache_underline_thickness" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_embolden" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <description> + Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="get_face_index" qualifiers="const"> + <return type="int" /> + <argument index="0" name="cache_index" type="int" /> + <description> + Recturns an active face index in the TrueType / OpenType collection. </description> </method> <method name="get_glyph_advance" qualifiers="const"> @@ -180,14 +219,6 @@ Returns list of language support overrides. </description> </method> - <method name="get_scale" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns scaling factor of the color bitmap font. - </description> - </method> <method name="get_script_support_override" qualifiers="const"> <return type="bool" /> <argument index="0" name="script" type="String" /> @@ -208,34 +239,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> - <method name="get_supported_chars" qualifiers="const"> - <return type="String" /> - <description> - Returns a string containing all the characters available in the font. - </description> - </method> - <method name="get_supported_feature_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of OpenType features supported by font. - </description> - </method> - <method name="get_supported_variation_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. - Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. - </description> - </method> <method name="get_texture_count" qualifiers="const"> <return type="int" /> <argument index="0" name="cache_index" type="int" /> @@ -262,48 +265,18 @@ Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. </description> </method> - <method name="get_underline_position" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns pixel offset of the underline below the baseline. - </description> - </method> - <method name="get_underline_thickness" qualifiers="const"> - <return type="float" /> + <method name="get_transform" qualifiers="const"> + <return type="Transform2D" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> <description> - Returns thickness of the underline in pixels. + Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="get_variation_coordinates" qualifiers="const"> <return type="Dictionary" /> <argument index="0" name="cache_index" type="int" /> <description> - Returns variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. - </description> - </method> - <method name="has_char" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="char" type="int" /> - <description> - Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. - </description> - </method> - <method name="is_language_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="language" type="String" /> - <description> - Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). - </description> - </method> - <method name="is_script_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="script" type="String" /> - <description> - Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). + Returns variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> <method name="load_bitmap_font"> @@ -376,8 +349,8 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. - [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method remove_glyph]. + Removes specified texture from the cache entry. + [b]Note:[/b] This function will not remove glyphs associated with the texture. Remove them manually using [method remove_glyph]. </description> </method> <method name="render_glyph"> @@ -386,7 +359,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="index" type="int" /> <description> - Renders specified glyph the the font cache texture. + Renders specified glyph to the font cache texture. </description> </method> <method name="render_range"> @@ -399,22 +372,60 @@ Renders the range of characters to the font cache texture. </description> </method> - <method name="set_ascent"> + <method name="set_cache_ascent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="ascent" type="float" /> <description> - Sets the font ascent (number of pixels above the baseline). </description> </method> - <method name="set_descent"> + <method name="set_cache_descent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="descent" type="float" /> <description> - Sets the font descent (number of pixels below the baseline). + </description> + </method> + <method name="set_cache_scale"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="scale" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_position"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_position" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_thickness"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_thickness" type="float" /> + <description> + </description> + </method> + <method name="set_embolden"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="strength" type="float" /> + <description> + Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="set_face_index"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="face_index" type="int" /> + <description> + Sets an active face index in the TrueType / OpenType collection. </description> </method> <method name="set_glyph_advance"> @@ -483,16 +494,7 @@ <argument index="0" name="language" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_language_supported]. - </description> - </method> - <method name="set_scale"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="scale" type="float" /> - <description> - Sets scaling factor of the color bitmap font. + Adds override for [method Font.is_language_supported]. </description> </method> <method name="set_script_support_override"> @@ -500,17 +502,7 @@ <argument index="0" name="script" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_script_supported]. - </description> - </method> - <method name="set_spacing"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. + Adds override for [method Font.is_script_supported]. </description> </method> <method name="set_texture_image"> @@ -533,22 +525,12 @@ Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support). </description> </method> - <method name="set_underline_position"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_position" type="float" /> - <description> - Sets pixel offset of the underline below the baseline. - </description> - </method> - <method name="set_underline_thickness"> + <method name="set_transform"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_thickness" type="float" /> + <argument index="1" name="transform" type="Transform2D" /> <description> - Sets thickness of the underline in pixels. + Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="set_variation_coordinates"> @@ -556,7 +538,7 @@ <argument index="0" name="cache_index" type="int" /> <argument index="1" name="variation_coordinates" type="Dictionary" /> <description> - Sets variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. + Sets variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> </methods> @@ -567,8 +549,8 @@ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contents of the dynamic font source file. </member> - <member name="embolden" type="float" setter="set_embolden" getter="get_embolden" default="0.0"> - If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. </member> <member name="fixed_size" type="int" setter="set_fixed_size" getter="get_fixed_size" default="0"> Font size, used only for the bitmap fonts. @@ -576,7 +558,7 @@ <member name="font_name" type="String" setter="set_font_name" getter="get_font_name" default=""""> Font family name. </member> - <member name="font_style" type="int" setter="set_font_style" getter="get_font_style" default="0"> + <member name="font_style" type="int" setter="set_font_style" getter="get_font_style" enum="TextServer.FontStyle" default="0"> Font style flags, see [enum TextServer.FontStyle]. </member> <member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="is_force_autohinter" default="false"> @@ -609,9 +591,5 @@ <member name="subpixel_positioning" type="int" setter="set_subpixel_positioning" getter="get_subpixel_positioning" enum="TextServer.SubpixelPositioning" default="1"> Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> - 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. - </member> </members> </class> diff --git a/doc/classes/FontVariation.xml b/doc/classes/FontVariation.xml new file mode 100644 index 0000000000..a1b96fb137 --- /dev/null +++ b/doc/classes/FontVariation.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="FontVariation" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Variation of the [Font]. + </brief_description> + <description> + OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing. + + To use simulated bold font variant: + [codeblocks] + [gdscript] + var fv = FontVariation.new() + fv.set_base_font(load("res://BarlowCondensed-Regular.ttf")) + fv.set_variation_embolden(1.2); + $"Label".set("custom_fonts/font", fv) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var fv = new FontVariation(); + fv.SetBaseFont(ResourceLoader.Load<FontFile>("res://BarlowCondensed-Regular.ttf")); + fv.SetVariationEmbolden(1.2); + GetNode("Label").Set("custom_fonts/font", fv); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] + </description> + <tutorials> + </tutorials> + <methods> + <method name="set_spacing"> + <return type="void" /> + <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="1" name="value" type="int" /> + <description> + Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + </description> + </method> + </methods> + <members> + <member name="base_font" type="Font" setter="set_base_font" getter="get_base_font"> + Base font used to create a variation. If not set, default [Theme] font is used. + </member> + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. If not set [member base_font] fallback are ussed. + </member> + <member name="opentype_features" type="Dictionary" setter="set_opentype_features" getter="get_opentype_features" default="{}"> + A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </member> + <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the bottom of the line in pixels. + </member> + <member name="spacing_glyph" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing between graphical glyphs + </member> + <member name="spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra width of the space glyphs. + </member> + <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the top of the line in pixels. + </member> + <member name="variation_embolden" type="float" setter="set_variation_embolden" getter="get_variation_embolden" default="0.0"> + If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + [b]Note:[/b] Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [TextMesh] from working correctly. + </member> + <member name="variation_face_index" type="int" setter="set_variation_face_index" getter="get_variation_face_index" default="0"> + Active face index in the TrueType / OpenType collection file. + </member> + <member name="variation_opentype" type="Dictionary" setter="set_variation_opentype" getter="get_variation_opentype" default="{}"> + Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url]. + </member> + <member name="variation_transform" type="Transform2D" setter="set_variation_transform" getter="get_variation_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> + 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. + For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. + </member> + </members> +</class> diff --git a/doc/classes/GPUParticlesAttractor3D.xml b/doc/classes/GPUParticlesAttractor3D.xml index 5577b47c89..e69255cc31 100644 --- a/doc/classes/GPUParticlesAttractor3D.xml +++ b/doc/classes/GPUParticlesAttractor3D.xml @@ -1,19 +1,31 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesAttractor3D" inherits="VisualInstance3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Abstract class for 3D particle attractors affecting [GPUParticles3D] nodes. </brief_description> <description> + Particle attractors can be used to attract particles towards the attractor's origin, or to push them away from the attractor's origin. + Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported. + Attractors can be temporarily disabled by hiding them, or by setting their [member strength] to [code]0.0[/code]. + [b]Note:[/b] Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" default="1.0"> + The particle attractor's attenuation. Higher values result in more gradual pushing of particles as they come closer to the attractor's origin. Zero or negative values will cause particles to be pushed very fast as soon as the touch the attractor's edges. </member> <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295"> + The particle rendering layers ([member VisualInstance3D.layers]) that will be affected by the attractor. By default, all particles are affected by an attractor. + After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position. + Particle attraction can also be disabled on a per-process material basis by setting [member ParticlesMaterial.attractor_interaction_enabled] on the [GPUParticles3D] node. </member> <member name="directionality" type="float" setter="set_directionality" getter="get_directionality" default="0.0"> + Adjusts how directional the attractor is. At [code]0.0[/code], the attractor is not directional at all: it will attract particles towards its center. At [code]1.0[/code], the attractor is fully directional: particles will always be pushed towards local -Z (or +Z if [member strength] is negative). + [b]Note:[/b] If [member directionality] is greater than [code]0.0[/code], the direction in which particles are pushed can be changed by rotating the [GPUParticlesAttractor3D] node. </member> <member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0"> + If [member strength] is negative, particles will be pushed in the reverse direction. Particles will be pushed [i]away[/i] from the attractor's origin if [member directionality] is [code]0.0[/code], or towards local +Z if [member directionality] is greater than [code]0.0[/code]. </member> </members> </class> diff --git a/doc/classes/GPUParticlesAttractorBox3D.xml b/doc/classes/GPUParticlesAttractorBox3D.xml index 3fa8276579..6595428cc2 100644 --- a/doc/classes/GPUParticlesAttractorBox3D.xml +++ b/doc/classes/GPUParticlesAttractorBox3D.xml @@ -1,13 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesAttractorBox3D" inherits="GPUParticlesAttractor3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Box-shaped 3D particle attractor affecting [GPUParticles3D] nodes. </brief_description> <description> + Box-shaped 3D particle attractor affecting [GPUParticles3D] nodes. + [b]Note:[/b] Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> + The attractor box's extents in 3D units. </member> </members> </class> diff --git a/doc/classes/GPUParticlesAttractorSphere3D.xml b/doc/classes/GPUParticlesAttractorSphere3D.xml index 2b68637b38..4077937ef3 100644 --- a/doc/classes/GPUParticlesAttractorSphere3D.xml +++ b/doc/classes/GPUParticlesAttractorSphere3D.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesAttractorSphere3D" inherits="GPUParticlesAttractor3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Ellipse-shaped 3D particle attractor affecting [GPUParticles3D] nodes. </brief_description> <description> + Ellipse-shaped 3D particle attractor affecting [GPUParticles3D] nodes. + [b]Note:[/b] Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> + The attractor sphere's radius in 3D units. + [b]Note:[/b] Stretched ellipses can be obtained by using non-uniform scaling on the [GPUParticlesAttractorSphere3D] node. </member> </members> </class> diff --git a/doc/classes/GPUParticlesAttractorVectorField3D.xml b/doc/classes/GPUParticlesAttractorVectorField3D.xml index cbf817f407..aeadfaf4ab 100644 --- a/doc/classes/GPUParticlesAttractorVectorField3D.xml +++ b/doc/classes/GPUParticlesAttractorVectorField3D.xml @@ -1,15 +1,22 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesAttractorVectorField3D" inherits="GPUParticlesAttractor3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Box-shaped 3D particle attractor with strength varying within the box, affecting [GPUParticles3D] nodes. </brief_description> <description> + Box-shaped 3D particle attractor with strength varying within the box, affecting [GPUParticles3D] nodes. + Unlike [GPUParticlesAttractorBox3D], [GPUParticlesAttractorVectorField3D] uses a [member texture] to affect attraction strength within the box. This can be used to create complex attraction scenarios where particles travel in different directions depending on their location. This can be useful for weather effects such as sandstorms. + [b]Note:[/b] Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> + The extents of the vector field box in 3D units. </member> <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture"> + The 3D texture to be used. Values are linearly interpolated between the texture's pixels. + [b]Note:[/b] To get better performance, the 3D texture's resolution should reflect the [member extents] of the attractor. Since particle attraction is usually low-frequency data, the texture can be kept at a low resolution such as 64×64×64. </member> </members> </class> diff --git a/doc/classes/GPUParticlesCollision3D.xml b/doc/classes/GPUParticlesCollision3D.xml index 45bc9b402b..435f9781f0 100644 --- a/doc/classes/GPUParticlesCollision3D.xml +++ b/doc/classes/GPUParticlesCollision3D.xml @@ -1,13 +1,23 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesCollision3D" inherits="VisualInstance3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Abstract class for 3D particle collision shapes affecting [GPUParticles3D] nodes. </brief_description> <description> + Particle collision shapes can be used to make particles stop or bounce against them. + Particle collision shapes in real-time and can be moved, rotated and scaled during gameplay. Unlike attractors, non-uniform scaling of collision shapes is [i]not[/i] supported. + Particle collision shapes can be temporarily disabled by hiding them. + [b]Note:[/b] [member ParticlesMaterial.collision_enabled] must be [code]true[/code] on the [GPUParticles3D]'s process material for collision to work. + [b]Note:[/b] Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. + [b]Note:[/b] Particles pushed by a collider that is being moved will not be interpolated, which can result in visible stuttering. This can be alleviated by setting [member GPUParticles3D.fixed_fps] to [code]0[/code] or a value that matches or exceeds the target framerate. </description> <tutorials> </tutorials> <members> <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295"> + The particle rendering layers ([member VisualInstance3D.layers]) that will be affected by the collision shape. By default, all particles that have [member ParticlesMaterial.collision_enabled] set to [code]true[/code] will be affected by a collision shape. + After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position. + Particle attraction can also be disabled on a per-process material basis by setting [member ParticlesMaterial.attractor_interaction_enabled] on the [GPUParticles3D] node. </member> </members> </class> diff --git a/doc/classes/GPUParticlesCollisionBox3D.xml b/doc/classes/GPUParticlesCollisionBox3D.xml index 091b4ca730..60d66ca682 100644 --- a/doc/classes/GPUParticlesCollisionBox3D.xml +++ b/doc/classes/GPUParticlesCollisionBox3D.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesCollisionBox3D" inherits="GPUParticlesCollision3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. </brief_description> <description> + Box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. + [b]Note:[/b] [member ParticlesMaterial.collision_enabled] must be [code]true[/code] on the [GPUParticles3D]'s process material for collision to work. + [b]Note:[/b] Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> + The collision box's extents in 3D units. </member> </members> </class> diff --git a/doc/classes/GPUParticlesCollisionHeightField3D.xml b/doc/classes/GPUParticlesCollisionHeightField3D.xml index a7b59ea684..3fcad43efb 100644 --- a/doc/classes/GPUParticlesCollisionHeightField3D.xml +++ b/doc/classes/GPUParticlesCollisionHeightField3D.xml @@ -1,39 +1,59 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesCollisionHeightField3D" inherits="GPUParticlesCollision3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Real-time heightmap-shaped 3D particle attractor affecting [GPUParticles3D] nodes. </brief_description> <description> + Real-time heightmap-shaped 3D particle attractor affecting [GPUParticles3D] nodes. + Heightmap shapes allow for efficiently representing collisions for convex and concave objects with a single "floor" (such as terrain). This is less flexible than [GPUParticlesCollisionSDF3D], but it doesn't require a baking step. + [GPUParticlesCollisionHeightField3D] can also be regenerated in real-time when it is moved, when the camera moves, or even continuously. This makes [GPUParticlesCollisionHeightField3D] a good choice for weather effects such as rain and snow and games with highly dynamic geometry. However, since heightmaps cannot represent overhangs, [GPUParticlesCollisionHeightField3D] is not suited for indoor particle collision. + [b]Note:[/b] [member ParticlesMaterial.collision_enabled] must be [code]true[/code] on the [GPUParticles3D]'s process material for collision to work. + [b]Note:[/b] Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> + The collision heightmap's extents in 3D units. To improve heightmap quality, [member extents] should be set as small as possible while covering the parts of the scene you need. </member> <member name="follow_camera_enabled" type="bool" setter="set_follow_camera_enabled" getter="is_follow_camera_enabled" default="false"> + If [code]true[/code], the [GPUParticlesCollisionHeightField3D] will follow the current camera in global space. The [GPUParticlesCollisionHeightField3D] does not need to be a child of the [Camera3D] node for this to work. + Following the camera has a performance cost, as it will force the heightmap to update whenever the camera moves. Consider lowering [member resolution] to improve performance if [member follow_camera_enabled] is [code]true[/code]. </member> <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionHeightField3D.Resolution" default="2"> + Higher resolutions can represent small details more accurately in large scenes, at the cost of lower performance. If [member update_mode] is [constant UPDATE_MODE_ALWAYS], consider using the lowest resolution possible. </member> <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="GPUParticlesCollisionHeightField3D.UpdateMode" default="0"> + The update policy to use for the generated heightmap. </member> </members> <constants> <constant name="RESOLUTION_256" value="0" enum="Resolution"> + Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no distant particles. </constant> <constant name="RESOLUTION_512" value="1" enum="Resolution"> + Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no distant particles. </constant> <constant name="RESOLUTION_1024" value="2" enum="Resolution"> + Generate a 1024×1024 heightmap. Intended for large scenes with distant particles. </constant> <constant name="RESOLUTION_2048" value="3" enum="Resolution"> + Generate a 2048×2048 heightmap. Intended for very large scenes with distant particles. </constant> <constant name="RESOLUTION_4096" value="4" enum="Resolution"> + Generate a 4096×4096 heightmap. Intended for huge scenes with distant particles. </constant> <constant name="RESOLUTION_8192" value="5" enum="Resolution"> + Generate a 8192×8192 heightmap. Intended for gigantic scenes with distant particles. </constant> <constant name="RESOLUTION_MAX" value="6" enum="Resolution"> + Represents the size of the [enum Resolution] enum. </constant> <constant name="UPDATE_MODE_WHEN_MOVED" value="0" enum="UpdateMode"> + Only update the heightmap when the [GPUParticlesCollisionHeightField3D] node is moved, or when the camera moves if [member follow_camera_enabled] is [code]true[/code]. An update can be forced by slightly moving the [GPUParticlesCollisionHeightField3D] in any direction. </constant> <constant name="UPDATE_MODE_ALWAYS" value="1" enum="UpdateMode"> + Update the heightmap every frame. This has a significant performance cost. This update should only be used when geometry that particles can collide with changes significantly during gameplay. </constant> </constants> </class> diff --git a/doc/classes/GPUParticlesCollisionSDF3D.xml b/doc/classes/GPUParticlesCollisionSDF3D.xml index 6f59a18eb5..c9af07288e 100644 --- a/doc/classes/GPUParticlesCollisionSDF3D.xml +++ b/doc/classes/GPUParticlesCollisionSDF3D.xml @@ -1,35 +1,53 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesCollisionSDF3D" inherits="GPUParticlesCollision3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Baked signed distance field 3D particle attractor affecting [GPUParticles3D] nodes. </brief_description> <description> + Baked signed distance field 3D particle attractor affecting [GPUParticles3D] nodes. + Signed distance fields (SDF) allow for efficiently representing approximate collision shapes for convex and concave objects of any shape. This is more flexible than [GPUParticlesCollisionHeightField3D], but it requires a baking step. + [b]Baking:[/b] The signed distance field texture can be baked by selecting the [GPUParticlesCollisionSDF3D] node in the editor, then clicking [b]Bake SDF[/b] at the top of the 3D viewport. Any [i]visible[/i] [MeshInstance3D]s touching the [member extents] will be taken into account for baking, regardless of their [member GeometryInstance3D.gi_mode]. + [b]Note:[/b] Baking a [GPUParticlesCollisionSDF3D]'s [member texture] is only possible within the editor, as there is no bake method exposed for use in exported projects. However, it's still possible to load pre-baked [Texture3D]s into its [member texture] property in an exported project. + [b]Note:[/b] [member ParticlesMaterial.collision_enabled] must be [code]true[/code] on the [GPUParticles3D]'s process material for collision to work. + [b]Note:[/b] Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> + The collision SDF's extents in 3D units. To improve SDF quality, the [member extents] should be set as small as possible while covering the parts of the scene you need. </member> <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF3D.Resolution" default="2"> + The bake resolution to use for the signed distance field [member texture]. The texture must be baked again for changes to the [member resolution] property to be effective. Higher resolutions have a greater performance cost and take more time to bake. Higher resolutions also result in larger baked textures, leading to increased VRAM and storage space requirements. To improve performance and reduce bake times, use the lowest resolution possible for the object you're representing the collision of. </member> <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture"> + The 3D texture representing the signed distance field. </member> <member name="thickness" type="float" setter="set_thickness" getter="get_thickness" default="1.0"> + The collision shape's thickness. Unlike other particle colliders, [GPUParticlesCollisionSDF3D] is actually hollow on the inside. [member thickness] can be increased to prevent particles from tunneling through the collision shape at high speeds, or when the [GPUParticlesCollisionSDF3D] is moved. </member> </members> <constants> <constant name="RESOLUTION_16" value="0" enum="Resolution"> + Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise. </constant> <constant name="RESOLUTION_32" value="1" enum="Resolution"> + Bake a 32×32×32 signed distance field. </constant> <constant name="RESOLUTION_64" value="2" enum="Resolution"> + Bake a 64×64×64 signed distance field. </constant> <constant name="RESOLUTION_128" value="3" enum="Resolution"> + Bake a 128×128×128 signed distance field. </constant> <constant name="RESOLUTION_256" value="4" enum="Resolution"> + Bake a 256×256×256 signed distance field. </constant> <constant name="RESOLUTION_512" value="5" enum="Resolution"> + Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise. </constant> <constant name="RESOLUTION_MAX" value="6" enum="Resolution"> + Represents the size of the [enum Resolution] enum. </constant> </constants> </class> diff --git a/doc/classes/GPUParticlesCollisionSphere3D.xml b/doc/classes/GPUParticlesCollisionSphere3D.xml index b78e114d09..6651a732da 100644 --- a/doc/classes/GPUParticlesCollisionSphere3D.xml +++ b/doc/classes/GPUParticlesCollisionSphere3D.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GPUParticlesCollisionSphere3D" inherits="GPUParticlesCollision3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Sphere-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. </brief_description> <description> + Sphere-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. + [b]Note:[/b] [member ParticlesMaterial.collision_enabled] must be [code]true[/code] on the [GPUParticles3D]'s process material for collision to work. + [b]Note:[/b] Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. </description> <tutorials> </tutorials> <members> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> + The collision sphere's radius in 3D units. </member> </members> </class> diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index cbd83e8d7d..b84e221d1c 100644 --- a/doc/classes/Geometry2D.xml +++ b/doc/classes/Geometry2D.xml @@ -118,7 +118,7 @@ <argument index="2" name="from_b" type="Vector2" /> <argument index="3" name="dir_b" type="Vector2" /> <description> - Checks if the two lines ([code]from_a[/code], [code]dir_a[/code]) and ([code]from_b[/code], [code]dir_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns an empty [Variant]. + Checks if the two lines ([code]from_a[/code], [code]dir_a[/code]) and ([code]from_b[/code], [code]dir_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns [code]null[/code]. [b]Note:[/b] The lines are specified using direction vectors, not end points. </description> </method> @@ -195,7 +195,7 @@ <argument index="2" name="from_b" type="Vector2" /> <argument index="3" name="to_b" type="Vector2" /> <description> - Checks if the two segments ([code]from_a[/code], [code]to_a[/code]) and ([code]from_b[/code], [code]to_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns an empty [Variant]. + Checks if the two segments ([code]from_a[/code], [code]to_a[/code]) and ([code]from_b[/code], [code]to_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns [code]null[/code]. </description> </method> <method name="triangulate_delaunay"> diff --git a/doc/classes/Geometry3D.xml b/doc/classes/Geometry3D.xml index 0bf6f880c2..c05d7df53f 100644 --- a/doc/classes/Geometry3D.xml +++ b/doc/classes/Geometry3D.xml @@ -81,7 +81,7 @@ <argument index="3" name="b" type="Vector3" /> <argument index="4" name="c" type="Vector3" /> <description> - Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. + Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns [code]null[/code]. </description> </method> <method name="segment_intersects_convex"> @@ -121,7 +121,7 @@ <argument index="3" name="b" type="Vector3" /> <argument index="4" name="c" type="Vector3" /> <description> - Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. + Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns [code]null[/code]. </description> </method> </methods> diff --git a/doc/classes/GradientTexture1D.xml b/doc/classes/GradientTexture1D.xml index a124753a9f..3254754ac1 100644 --- a/doc/classes/GradientTexture1D.xml +++ b/doc/classes/GradientTexture1D.xml @@ -4,7 +4,7 @@ Gradient-filled texture. </brief_description> <description> - GradientTexture1D uses a [Gradient] to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [member width]). + GradientTexture1D uses a [Gradient] to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [member width]). See also [GradientTexture2D], [CurveTexture] and [CurveXYZTexture]. </description> <tutorials> </tutorials> diff --git a/doc/classes/GradientTexture2D.xml b/doc/classes/GradientTexture2D.xml index 4362578932..7561f1b947 100644 --- a/doc/classes/GradientTexture2D.xml +++ b/doc/classes/GradientTexture2D.xml @@ -4,7 +4,7 @@ Gradient-filled 2D texture. </brief_description> <description> - The texture uses a [Gradient] to fill the texture data in 2D space. The gradient is filled according to the specified [member fill] and [member repeat] types using colors obtained from the gradient. The texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [member width] and [member height]). + The texture uses a [Gradient] to fill the texture data in 2D space. The gradient is filled according to the specified [member fill] and [member repeat] types using colors obtained from the gradient. The texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [member width] and [member height]). See also [GradientTexture1D], [CurveTexture] and [CurveXYZTexture]. </description> <tutorials> </tutorials> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index e699a40ea0..965dbe7449 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -202,6 +202,9 @@ <member name="connection_lines_antialiased" type="bool" setter="set_connection_lines_antialiased" getter="is_connection_lines_antialiased" default="true"> If [code]true[/code], the lines between nodes will use antialiasing. </member> + <member name="connection_lines_curvature" type="float" setter="set_connection_lines_curvature" getter="get_connection_lines_curvature" default="0.5"> + The curvature of the lines between the nodes. 0 results in straight lines. + </member> <member name="connection_lines_thickness" type="float" setter="set_connection_lines_thickness" getter="get_connection_lines_thickness" default="2.0"> The thickness of the lines between the nodes. </member> @@ -296,8 +299,9 @@ </description> </signal> <signal name="delete_nodes_request"> + <argument index="0" name="nodes" type="StringName[]" /> <description> - Emitted when a GraphNode is attempted to be removed from the GraphEdit. + Emitted when a GraphNode is attempted to be removed from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button). </description> </signal> <signal name="disconnection_request"> @@ -371,15 +375,11 @@ <theme_item name="selection_stroke" data_type="color" type="Color" default="Color(1, 1, 1, 0.8)"> The outline color of the selection rectangle. </theme_item> - <theme_item name="bezier_len_neg" data_type="constant" type="int" default="160"> - </theme_item> - <theme_item name="bezier_len_pos" data_type="constant" type="int" default="80"> - </theme_item> - <theme_item name="port_grab_distance_horizontal" data_type="constant" type="int" default="24"> - The horizontal range within which a port can be grabbed (on both sides). + <theme_item name="port_hotzone_inner_extent" data_type="constant" type="int" default="22"> + The horizontal range within which a port can be grabbed (inner side). </theme_item> - <theme_item name="port_grab_distance_vertical" data_type="constant" type="int" default="26"> - The vertical range within which a port can be grabbed (on both sides). + <theme_item name="port_hotzone_outer_extent" data_type="constant" type="int" default="26"> + The horizontal range within which a port can be grabbed (outer side). </theme_item> <theme_item name="layout" data_type="icon" type="Texture2D"> </theme_item> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 173da63a15..36dbae1d74 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -17,12 +17,6 @@ Disables all input and output slots of the GraphNode. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -43,6 +37,13 @@ Returns the number of enabled input slots (connections) to the GraphNode. </description> </method> + <method name="get_connection_input_height"> + <return type="int" /> + <argument index="0" name="idx" type="int" /> + <description> + Returns the height of the input connection [code]idx[/code]. + </description> + </method> <method name="get_connection_input_position"> <return type="Vector2" /> <argument index="0" name="idx" type="int" /> @@ -70,6 +71,13 @@ Returns the number of enabled output slots (connections) of the GraphNode. </description> </method> + <method name="get_connection_output_height"> + <return type="int" /> + <argument index="0" name="idx" type="int" /> + <description> + Returns the height of the output connection [code]idx[/code]. + </description> + </method> <method name="get_connection_output_position"> <return type="Vector2" /> <argument index="0" name="idx" type="int" /> @@ -84,13 +92,6 @@ Returns the type of the output connection [code]idx[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_slot_color_left" qualifiers="const"> <return type="Color" /> <argument index="0" name="idx" type="int" /> @@ -119,6 +120,13 @@ Returns the right (output) type of the slot [code]idx[/code]. </description> </method> + <method name="is_slot_draw_stylebox" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="idx" type="int" /> + <description> + Returns true if the background [StyleBox] of the slot [code]idx[/code] is drawn. + </description> + </method> <method name="is_slot_enabled_left" qualifiers="const"> <return type="bool" /> <argument index="0" name="idx" type="int" /> @@ -133,14 +141,6 @@ Returns [code]true[/code] if right (output) side of the slot [code]idx[/code] is enabled. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -152,6 +152,7 @@ <argument index="6" name="color_right" type="Color" /> <argument index="7" name="custom_left" type="Texture2D" default="null" /> <argument index="8" name="custom_right" type="Texture2D" default="null" /> + <argument index="9" name="enable" type="bool" default="true" /> <description> Sets properties of the slot with ID [code]idx[/code]. If [code]enable_left[/code]/[code]right[/code], a port will appear and the slot will be able to be connected from this side. @@ -178,6 +179,14 @@ Sets the [Color] of the right (output) side of the slot [code]idx[/code] to [code]color_right[/code]. </description> </method> + <method name="set_slot_draw_stylebox"> + <return type="void" /> + <argument index="0" name="idx" type="int" /> + <argument index="1" name="draw_stylebox" type="bool" /> + <description> + Toggles the background [StyleBox] of the slot [code]idx[/code]. + </description> + </method> <method name="set_slot_enabled_left"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -301,6 +310,8 @@ <theme_item name="title_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> Color of the title text. </theme_item> + <theme_item name="close_h_offset" data_type="constant" type="int" default="22"> + </theme_item> <theme_item name="close_offset" data_type="constant" type="int" default="22"> The vertical offset of the close button. </theme_item> @@ -343,5 +354,8 @@ <theme_item name="selected_frame" data_type="style" type="StyleBox"> The background used when the [GraphNode] is selected. </theme_item> + <theme_item name="slot" data_type="style" type="StyleBox"> + The [StyleBox] used for each slot of the [GraphNode]. + </theme_item> </theme_items> </class> diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml index fa60a7eb58..f2b946cab7 100644 --- a/doc/classes/HMACContext.xml +++ b/doc/classes/HMACContext.xml @@ -50,7 +50,6 @@ [/csharp] [/codeblocks] - [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 641d73e333..3d2e9449e2 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -15,7 +15,7 @@ # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) - http_request.connect("request_completed", self, "_http_request_completed") + http_request.request_completed.connect(self._http_request_completed) # Perform a GET request. The URL below returns JSON as of writing. var error = http_request.request("https://httpbin.org/get") @@ -25,7 +25,7 @@ # Perform a POST request. The URL below returns JSON as of writing. # Note: Don't make simultaneous requests using a single HTTPRequest node. # The snippet below is provided for reference only. - var body = {"name": "Godette"} + var body = JSON.new().stringify({"name": "Godette"}) error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) if error != OK: push_error("An error occurred in the HTTP request.") @@ -33,7 +33,9 @@ # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): - var response = parse_json(body.get_string_from_utf8()) + var json = JSON.new() + json.parse(body.get_string_from_utf8()) + var response = json.get_data() # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). print(response.headers["User-Agent"]) @@ -44,7 +46,7 @@ // Create an HTTP request node and connect its completion signal. var httpRequest = new HTTPRequest(); AddChild(httpRequest); - httpRequest.Connect("request_completed", this, nameof(HttpRequestCompleted)); + httpRequest.RequestCompleted += HttpRequestCompleted; // Perform a GET request. The URL below returns JSON as of writing. Error error = httpRequest.Request("https://httpbin.org/get"); @@ -56,21 +58,24 @@ // Perform a POST request. The URL below returns JSON as of writing. // Note: Don't make simultaneous requests using a single HTTPRequest node. // The snippet below is provided for reference only. - string[] body = { "name", "Godette" }; - // GDScript to_json is non existent, so we use JSON.Print() here. - error = httpRequest.Request("https://httpbin.org/post", null, true, HTTPClient.Method.Post, JSON.Print(body)); + string body = new JSON().Stringify(new Godot.Collections.Dictionary + { + { "name", "Godette" } + }); + error = httpRequest.Request("https://httpbin.org/post", null, true, HTTPClient.Method.Post, body); if (error != Error.Ok) { GD.PushError("An error occurred in the HTTP request."); } } - // Called when the HTTP request is completed. private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body) { - // GDScript parse_json is non existent so we have to use JSON.parse, which has a slightly different syntax. - var response = JSON.Parse(body.GetStringFromUTF8()).Result as Godot.Collections.Dictionary; + var json = new JSON(); + json.Parse(body.GetStringFromUTF8()); + var response = json.GetData() as Godot.Collections.Dictionary; + // Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). GD.Print((response["headers"] as Godot.Collections.Dictionary)["User-Agent"]); } @@ -83,7 +88,7 @@ # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) - http_request.connect("request_completed", self, "_http_request_completed") + http_request.request_completed.connect(self._http_request_completed) # Perform the HTTP request. The URL below returns a PNG image as of writing. var error = http_request.request("https://via.placeholder.com/512") @@ -101,8 +106,7 @@ if error != OK: push_error("Couldn't load the image.") - var texture = ImageTexture.new() - texture.create_from_image(image) + var texture = ImageTexture.create_from_image(image) # Display the image in a TextureRect node. var texture_rect = TextureRect.new() @@ -115,7 +119,7 @@ // Create an HTTP request node and connect its completion signal. var httpRequest = new HTTPRequest(); AddChild(httpRequest); - httpRequest.Connect("request_completed", this, nameof(HttpRequestCompleted)); + httpRequest.RequestCompleted += HttpRequestCompleted; // Perform the HTTP request. The URL below returns a PNG image as of writing. Error error = httpRequest.Request("https://via.placeholder.com/512"); @@ -125,7 +129,6 @@ } } - // Called when the HTTP request is completed. private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body) { @@ -248,6 +251,7 @@ Maximum number of allowed redirects. </member> <member name="timeout" type="float" setter="set_timeout" getter="get_timeout" default="0.0"> + If set to a value greater than [code]0.0[/code] before the request starts, the HTTP request will time out after [code]timeout[/code] seconds have passed and the request is not [i]completed[/i] yet. For small HTTP requests such as REST API usage, set [member timeout] to a value between [code]10.0[/code] and [code]30.0[/code] to prevent the application from getting stuck if the request fails to get a response in a timely manner. For file downloads, leave this to [code]0.0[/code] to prevent the download from failing if it takes too much time. </member> <member name="use_threads" type="bool" setter="set_use_threads" getter="is_using_threads" default="false"> If [code]true[/code], multithreading is used to improve performance. diff --git a/doc/classes/HashingContext.xml b/doc/classes/HashingContext.xml index 9ecf2872f3..c126efcfbb 100644 --- a/doc/classes/HashingContext.xml +++ b/doc/classes/HashingContext.xml @@ -57,7 +57,6 @@ } [/csharp] [/codeblocks] - [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index da5b907fab..a927345e79 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -23,8 +23,8 @@ <method name="blend_rect"> <return type="void" /> <argument index="0" name="src" type="Image" /> - <argument index="1" name="src_rect" type="Rect2" /> - <argument index="2" name="dst" type="Vector2" /> + <argument index="1" name="src_rect" type="Rect2i" /> + <argument index="2" name="dst" type="Vector2i" /> <description> Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dest[/code], clipped accordingly to both image bounds. This image and [code]src[/code] image [b]must[/b] have the same format. [code]src_rect[/code] with not positive size is treated as empty. </description> @@ -33,8 +33,8 @@ <return type="void" /> <argument index="0" name="src" type="Image" /> <argument index="1" name="mask" type="Image" /> - <argument index="2" name="src_rect" type="Rect2" /> - <argument index="3" name="dst" type="Vector2" /> + <argument index="2" name="src_rect" type="Rect2i" /> + <argument index="3" name="dst" type="Vector2i" /> <description> Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image using [code]mask[/code] image at coordinates [code]dst[/code], clipped accordingly to both image bounds. Alpha channels are required for both [code]src[/code] and [code]mask[/code]. [code]dst[/code] pixels and [code]src[/code] pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and [code]src[/code] image [b]must[/b] have the same format. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. [code]src_rect[/code] with not positive size is treated as empty. </description> @@ -42,8 +42,8 @@ <method name="blit_rect"> <return type="void" /> <argument index="0" name="src" type="Image" /> - <argument index="1" name="src_rect" type="Rect2" /> - <argument index="2" name="dst" type="Vector2" /> + <argument index="1" name="src_rect" type="Rect2i" /> + <argument index="2" name="dst" type="Vector2i" /> <description> Copies [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dst[/code], clipped accordingly to both image bounds. This image and [code]src[/code] image [b]must[/b] have the same format. [code]src_rect[/code] with not positive size is treated as empty. </description> @@ -52,8 +52,8 @@ <return type="void" /> <argument index="0" name="src" type="Image" /> <argument index="1" name="mask" type="Image" /> - <argument index="2" name="src_rect" type="Rect2" /> - <argument index="3" name="dst" type="Vector2" /> + <argument index="2" name="src_rect" type="Rect2i" /> + <argument index="3" name="dst" type="Vector2i" /> <description> Blits [code]src_rect[/code] area from [code]src[/code] image to this image at the coordinates given by [code]dst[/code], clipped accordingly to both image bounds. [code]src[/code] pixel is copied onto [code]dst[/code] if the corresponding [code]mask[/code] pixel's alpha value is not 0. This image and [code]src[/code] image [b]must[/b] have the same format. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. [code]src_rect[/code] with not positive size is treated as empty. </description> @@ -168,7 +168,7 @@ </method> <method name="fill_rect"> <return type="void" /> - <argument index="0" name="rect" type="Rect2" /> + <argument index="0" name="rect" type="Rect2i" /> <argument index="1" name="color" type="Color" /> <description> Fills [code]rect[/code] with [code]color[/code]. @@ -244,7 +244,7 @@ </method> <method name="get_rect" qualifiers="const"> <return type="Image" /> - <argument index="0" name="rect" type="Rect2" /> + <argument index="0" name="rect" type="Rect2i" /> <description> Returns a new image that is a copy of the image's area specified with [code]rect[/code]. </description> @@ -256,9 +256,9 @@ </description> </method> <method name="get_used_rect" qualifiers="const"> - <return type="Rect2" /> + <return type="Rect2i" /> <description> - Returns a [Rect2] enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible. + Returns a [Rect2i] enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible. </description> </method> <method name="get_width" qualifiers="const"> @@ -308,6 +308,13 @@ [b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported. </description> </method> + <method name="load_from_file" qualifiers="static"> + <return type="Image" /> + <argument index="0" name="path" type="String" /> + <description> + Creates a new [Image] and loads data from the specified file. + </description> + </method> <method name="load_jpg_from_buffer"> <return type="int" enum="Error" /> <argument index="0" name="buffer" type="PackedByteArray" /> @@ -371,6 +378,19 @@ Converts a standard RGBE (Red Green Blue Exponent) image to an sRGB image. </description> </method> + <method name="rotate_180"> + <return type="void" /> + <description> + Rotates the image by [code]180[/code] degrees. The width and height of the image must be greater than [code]1[/code]. + </description> + </method> + <method name="rotate_90"> + <return type="void" /> + <argument index="0" name="direction" type="int" enum="ClockDirection" /> + <description> + Rotates the image in the specified [code]direction[/code] by [code]90[/code] degrees. The width and height of the image must be greater than [code]1[/code]. If the width and height are not equal, the image will be resized. + </description> + </method> <method name="save_exr" qualifiers="const"> <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> @@ -380,16 +400,59 @@ [b]Note:[/b] The TinyEXR module is disabled in non-editor builds, which means [method save_exr] will return [constant ERR_UNAVAILABLE] when it is called from an exported project. </description> </method> + <method name="save_exr_to_buffer" qualifiers="const"> + <return type="PackedByteArray" /> + <argument index="0" name="grayscale" type="bool" default="false" /> + <description> + Saves the image as an EXR file to a byte array. If [code]grayscale[/code] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return an empty byte array if Godot was compiled without the TinyEXR module. + [b]Note:[/b] The TinyEXR module is disabled in non-editor builds, which means [method save_exr] will return an empty byte array when it is called from an exported project. + </description> + </method> + <method name="save_jpg" qualifiers="const"> + <return type="int" enum="Error" /> + <argument index="0" name="path" type="String" /> + <argument index="1" name="quality" type="float" default="0.75" /> + <description> + Saves the image as a JPEG file to [code]path[/code] with the specified [code]quality[/code] between [code]0.01[/code] and [code]1.0[/code] (inclusive). Higher [code]quality[/code] values result in better-looking output at the cost of larger file sizes. Recommended [code]quality[/code] values are between [code]0.75[/code] and [code]0.90[/code]. Even at quality [code]1.00[/code], JPEG compression remains lossy. + [b]Note:[/b] JPEG does not save an alpha channel. If the [Image] contains an alpha channel, the image will still be saved, but the resulting JPEG file won't contain the alpha channel. + </description> + </method> + <method name="save_jpg_to_buffer" qualifiers="const"> + <return type="PackedByteArray" /> + <argument index="0" name="quality" type="float" default="0.75" /> + <description> + Saves the image as a JPEG file to a byte array with the specified [code]quality[/code] between [code]0.01[/code] and [code]1.0[/code] (inclusive). Higher [code]quality[/code] values result in better-looking output at the cost of larger byte array sizes (and therefore memory usage). Recommended [code]quality[/code] values are between [code]0.75[/code] and [code]0.90[/code]. Even at quality [code]1.00[/code], JPEG compression remains lossy. + [b]Note:[/b] JPEG does not save an alpha channel. If the [Image] contains an alpha channel, the image will still be saved, but the resulting byte array won't contain the alpha channel. + </description> + </method> <method name="save_png" qualifiers="const"> <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Saves the image as a PNG file to [code]path[/code]. + Saves the image as a PNG file to the file at [code]path[/code]. </description> </method> <method name="save_png_to_buffer" qualifiers="const"> <return type="PackedByteArray" /> <description> + Saves the image as a PNG file to a byte array. + </description> + </method> + <method name="save_webp" qualifiers="const"> + <return type="int" enum="Error" /> + <argument index="0" name="path" type="String" /> + <argument index="1" name="lossy" type="bool" default="false" /> + <argument index="2" name="quality" type="float" default="0.75" /> + <description> + Saves the image as a WebP (Web Picture) file to the file at [code]path[/code]. By default it will save lossless. If [code]lossy[/code] is true, the image will be saved lossy, using the [code]quality[/code] setting between 0.0 and 1.0 (inclusive). + </description> + </method> + <method name="save_webp_to_buffer" qualifiers="const"> + <return type="PackedByteArray" /> + <argument index="0" name="lossy" type="bool" default="false" /> + <argument index="1" name="quality" type="float" default="0.75" /> + <description> + Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [code]lossy[/code] is true, the image will be saved lossy, using the [code]quality[/code] setting between 0.0 and 1.0 (inclusive). </description> </method> <method name="set_pixel"> diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index aecb4fc4b6..8b85309dee 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -6,10 +6,8 @@ <description> A [Texture2D] based on an [Image]. For an image to be displayed, an [ImageTexture] has to be created from it using the [method create_from_image] method: [codeblock] - var texture = ImageTexture.new() - var image = Image.new() - image.load("res://icon.png") - texture.create_from_image(image) + var image = Image.load_from_file("res://icon.png") + var texture = ImageTexture.create_from_image(image) $Sprite2D.texture = texture [/codeblock] This way, textures can be created at run-time by loading images both from within the editor and externally. @@ -31,11 +29,11 @@ <link title="Importing images">$DOCS_URL/tutorials/assets_pipeline/importing_images.html</link> </tutorials> <methods> - <method name="create_from_image"> - <return type="void" /> + <method name="create_from_image" qualifiers="static"> + <return type="ImageTexture" /> <argument index="0" name="image" type="Image" /> <description> - Initializes the texture by allocating and setting the data from an [Image]. + Creates a new [ImageTexture] and initializes it by allocating and setting the data from an [Image]. </description> </method> <method name="get_format" qualifiers="const"> @@ -46,7 +44,7 @@ </method> <method name="set_size_override"> <return type="void" /> - <argument index="0" name="size" type="Vector2" /> + <argument index="0" name="size" type="Vector2i" /> <description> Resizes the texture to the specified dimensions. </description> diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml index 90e7df4421..00601cec75 100644 --- a/doc/classes/ImporterMesh.xml +++ b/doc/classes/ImporterMesh.xml @@ -39,6 +39,16 @@ Removes all surfaces and blend shapes from this [ImporterMesh]. </description> </method> + <method name="generate_lods"> + <return type="void" /> + <argument index="0" name="normal_merge_angle" type="float" /> + <argument index="1" name="normal_split_angle" type="float" /> + <description> + Generates all lods for this ImporterMesh. + [code]normal_merge_angle[/code] and [code]normal_split_angle[/code] are in degrees and used in the same way as the importer settings in [code]lods[/code]. As a good default, use 25 and 60 respectively. + The number of generated lods can be accessed using [method get_surface_lod_count], and each LOD is available in [method get_surface_lod_size] and [method get_surface_lod_indices]. + </description> + </method> <method name="get_blend_shape_count" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 948c4b253f..e73021ead4 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -40,7 +40,7 @@ <method name="flush_buffered_events"> <return type="void" /> <description> - Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input ([method set_use_accumulated_input]) or agile input flushing ([member ProjectSettings.input_devices/buffering/agile_event_flushing]). + Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input ([member use_accumulated_input]) or agile input flushing ([member ProjectSettings.input_devices/buffering/agile_event_flushing]). The engine will already do this itself at key execution points (at least once per frame). However, this can be useful in advanced cases where you want precise control over the timing of event handling. </description> </method> @@ -80,7 +80,7 @@ </description> </method> <method name="get_connected_joypads"> - <return type="Array" /> + <return type="int[]" /> <description> Returns an [Array] containing the device IDs of all currently connected joypads. </description> @@ -160,12 +160,6 @@ Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. </description> </method> - <method name="get_mouse_mode" qualifiers="const"> - <return type="int" enum="Input.MouseMode" /> - <description> - Returns the mouse mode. See the constants for more information. - </description> - </method> <method name="get_vector" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="negative_x" type="StringName" /> @@ -338,21 +332,6 @@ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS. </description> </method> - <method name="set_mouse_mode"> - <return type="void" /> - <argument index="0" name="mode" type="int" enum="Input.MouseMode" /> - <description> - Sets the mouse mode. See the constants for more information. - </description> - </method> - <method name="set_use_accumulated_input"> - <return type="void" /> - <argument index="0" name="enable" type="bool" /> - <description> - Enables or disables the accumulation of similar input events sent by the operating system. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. - Input accumulation is enabled by default. It can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. - </description> - </method> <method name="start_joy_vibration"> <return type="void" /> <argument index="0" name="device" type="int" /> @@ -389,6 +368,16 @@ </description> </method> </methods> + <members> + <member name="mouse_mode" type="int" setter="set_mouse_mode" getter="get_mouse_mode" enum="Input.MouseMode"> + Controls the mouse mode. See [enum MouseMode] for more information. + </member> + <member name="use_accumulated_input" type="bool" setter="set_use_accumulated_input" getter="is_using_accumulated_input"> + If [code]true[/code], similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. + Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. + [b]Note:[/b] Input accumulation is [i]enabled[/i] by default. + </member> + </members> <signals> <signal name="joy_connection_changed"> <argument index="0" name="device" type="int" /> @@ -428,10 +417,10 @@ Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. </constant> <constant name="CURSOR_WAIT" value="4" enum="CursorShape"> - Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. + Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). </constant> <constant name="CURSOR_BUSY" value="5" enum="CursorShape"> - Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). + Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. </constant> <constant name="CURSOR_DRAG" value="6" enum="CursorShape"> Drag cursor. Usually displayed when dragging something. diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index 7cc3de8fcb..83aad587a5 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -5,13 +5,17 @@ </brief_description> <description> Contains mouse and pen motion information. Supports relative, absolute positions and velocity. See [method Node._input]. - [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, call [method Input.set_use_accumulated_input] with [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly. + [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, set [member Input.use_accumulated_input] to [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly. </description> <tutorials> <link title="Mouse and input coordinates">$DOCS_URL/tutorials/inputs/mouse_and_input_coordinates.html</link> <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> </tutorials> <members> + <member name="pen_inverted" type="bool" setter="set_pen_inverted" getter="get_pen_inverted" default="false"> + Returns [code]true[/code] when using the eraser end of a stylus pen. + [b]Note:[/b] This property is implemented on Linux, macOS and Windows. + </member> <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. </member> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 83e7eba5e5..15c97b0838 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -8,6 +8,7 @@ Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing [kbd]Enter[/kbd]. Item text only supports single-line strings, newline characters (e.g. [code]\n[/code]) in the string won't produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but column's width is adjusted to fully fit its content by default. You need to set [member fixed_column_width] greater than zero to wrap the text. All [code]set_*[/code] methods allow negative item index, which makes the item accessed from the last one. + [b]Incremental search:[/b] Like [PopupMenu] and [Tree], [ItemList] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [member ProjectSettings.gui/timers/incremental_search_max_interval_msec]. </description> <tutorials> </tutorials> @@ -37,13 +38,6 @@ Removes all items from the list. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="deselect"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -121,14 +115,6 @@ Returns the metadata value of the specified index. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_text" qualifiers="const"> <return type="String" /> <argument index="0" name="idx" type="int" /> @@ -301,15 +287,6 @@ Sets a value (of any type) to be stored with the item associated with the specified index. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_selectable"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -402,8 +379,8 @@ <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" enum="ItemList.SelectMode" default="0"> Allows single or multiple item selection. See the [enum SelectMode] constants. </member> - <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextParagraph.OverrunBehavior" default="3"> - Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextParagraph.OverrunBehavior] for a description of all modes. + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="3"> + Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. </member> </members> <signals> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index d5744bbc42..8448109f02 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -11,12 +11,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="get_line_count" qualifiers="const"> <return type="int" /> <description> @@ -32,13 +26,6 @@ If there're no lines returns font size in pixels. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_total_character_count" qualifiers="const"> <return type="int" /> <description> @@ -51,18 +38,10 @@ Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> - <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="Label.AutowrapMode" default="0"> - If set to something other than [constant AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum AutowrapMode]. + <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="0"> + If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false"> If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. @@ -70,6 +49,9 @@ <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. </member> + <member name="label_settings" type="LabelSettings" setter="set_label_settings" getter="get_label_settings"> + Resource to override [Theme] font, outline and shadow properties. + </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </member> @@ -97,8 +79,8 @@ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> Base text writing direction. </member> - <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="Label.OverrunBehavior" default="0"> - Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum OverrunBehavior] for a description of all modes. + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> + Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. </member> <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false"> If [code]true[/code], all the text displays as UPPERCASE. @@ -110,60 +92,16 @@ Restricts the number of characters to display. Set to -1 to disable. [b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count]. </member> - <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="Label.VisibleCharactersBehavior" default="0"> - Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info. + <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="TextServer.VisibleCharactersBehavior" default="0"> + Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. </member> </members> - <constants> - <constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode"> - Autowrap is disabled. - </constant> - <constant name="AUTOWRAP_ARBITRARY" value="1" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available. - </constant> - <constant name="AUTOWRAP_WORD" value="2" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by soft-breaking between words. - </constant> - <constant name="AUTOWRAP_WORD_SMART" value="3" enum="AutowrapMode"> - Behaves similarly to [constant AUTOWRAP_WORD], but force-breaks a word if that single word does not fit in one line. - </constant> - <constant name="OVERRUN_NO_TRIMMING" value="0" enum="OverrunBehavior"> - No text trimming is performed. - </constant> - <constant name="OVERRUN_TRIM_CHAR" value="1" enum="OverrunBehavior"> - Trims the text per character. - </constant> - <constant name="OVERRUN_TRIM_WORD" value="2" enum="OverrunBehavior"> - Trims the text per word. - </constant> - <constant name="OVERRUN_TRIM_ELLIPSIS" value="3" enum="OverrunBehavior"> - Trims the text per character and adds an ellipsis to indicate that parts are hidden. - </constant> - <constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior"> - Trims the text per word and adds an ellipsis to indicate that parts are hidden. - </constant> - <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> - Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text. - </constant> - <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior"> - Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text. - </constant> - <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. - </constant> - <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the left. - </constant> - <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the right. - </constant> - </constants> <theme_items> <theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Default text [Color] of the [Label]. </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </theme_item> <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. diff --git a/doc/classes/Label3D.xml b/doc/classes/Label3D.xml index 1bd52ab2dc..2c3c27079a 100644 --- a/doc/classes/Label3D.xml +++ b/doc/classes/Label3D.xml @@ -9,12 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh" /> <description> @@ -28,13 +22,6 @@ Returns the value of the specified flag. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="set_draw_flag"> <return type="void" /> <argument index="0" name="flag" type="int" enum="Label3D.DrawFlags" /> @@ -43,14 +30,6 @@ If [code]true[/code], the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="Label3D.AlphaCutMode" default="0"> @@ -59,8 +38,8 @@ <member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold" default="0.5"> Threshold at which the alpha scissor will discard values. </member> - <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="Label3D.AutowrapMode" default="0"> - If set to something other than [constant AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum AutowrapMode]. + <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="0"> + If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. </member> <member name="billboard" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0"> The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible values. @@ -72,13 +51,13 @@ If [code]true[/code], the label is rendered at the same size regardless of distance. </member> <member name="font" type="Font" setter="set_font" getter="get_font"> - [Font] used for the [Label3D]'s text. + Font configuration used to display text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> Font size of the [Label3D]'s text. </member> <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="1"> - Controls the text's horizontal alignment. Supports left, center, right. Set it to one of the [enum HorizontalAlignment] constants. + Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -96,7 +75,7 @@ The text drawing offset (in pixels). </member> <member name="outline_modulate" type="Color" setter="set_outline_modulate" getter="get_outline_modulate" default="Color(0, 0, 0, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </member> <member name="outline_render_priority" type="int" setter="set_outline_render_priority" getter="get_outline_render_priority" default="-1"> Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. @@ -143,18 +122,6 @@ </member> </members> <constants> - <constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode"> - Autowrap is disabled. - </constant> - <constant name="AUTOWRAP_ARBITRARY" value="1" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available. - </constant> - <constant name="AUTOWRAP_WORD" value="2" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by soft-breaking between words. - </constant> - <constant name="AUTOWRAP_WORD_SMART" value="3" enum="AutowrapMode"> - Behaves similarly to [constant AUTOWRAP_WORD], but force-breaks a word if that single word does not fit in one line. - </constant> <constant name="FLAG_SHADED" value="0" enum="DrawFlags"> If set, lights in the environment affect the label. </constant> diff --git a/doc/classes/LabelSettings.xml b/doc/classes/LabelSettings.xml new file mode 100644 index 0000000000..5f7427f4aa --- /dev/null +++ b/doc/classes/LabelSettings.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="LabelSettings" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Resource to override [Theme] font, outline and shadow properties of the [Label]. + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <members> + <member name="font" type="Font" setter="set_font" getter="get_font"> + [Font] of the [Label]'s text. + </member> + <member name="font_color" type="Color" setter="set_font_color" getter="get_font_color" default="Color(0.875, 0.875, 0.875, 1)"> + Default text [Color] of the [Label]. + </member> + <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> + Font size of the [Label]'s text. + </member> + <member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0"> + Vertical space between lines in multiline text. + </member> + <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color(1, 1, 1, 1)"> + The tint of text outline. + </member> + <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0"> + Text outline size. + </member> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(1, 1, 1, 1)"> + The tint of text shadow. + </member> + <member name="shadow_offset" type="Vector2" setter="set_shadow_offset" getter="get_shadow_offset" default="Vector2(1, 1)"> + The offset of the text's shadow. + </member> + <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" default="0"> + The size of the text's shadow. + </member> + </members> +</class> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 4d8fd63257..0ebd83c882 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -73,6 +73,7 @@ </member> <member name="light_projector" type="Texture2D" setter="set_projector" getter="get_projector"> [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with [member ProjectSettings.rendering/textures/light_projectors/filter]. </member> <member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0"> The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent. diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index ee98356962..c0766cd1ec 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -4,80 +4,122 @@ Computes and stores baked lightmaps for fast global illumination. </brief_description> <description> - The [LightmapGI] node is used to compute and store baked lightmaps. Lightmaps are used to provide high-quality indirect lighting with very little light leaking. [LightmapGI] can also provide rough reflections using spherical harmonics if [member directional] is enabled. Dynamic objects can receive indirect lighting thanks to [i]light probes[/i], which can be automatically placed by setting [member generate_probes_subdiv]. Additional lightmap probes can also be added by creating [LightmapProbe] nodes. The downside is that lightmaps are fully static and cannot be baked in an exported project. Baking a [LightmapGI] node is also slower compared to [VoxelGI]. + The [LightmapGI] node is used to compute and store baked lightmaps. Lightmaps are used to provide high-quality indirect lighting with very little light leaking. [LightmapGI] can also provide rough reflections using spherical harmonics if [member directional] is enabled. Dynamic objects can receive indirect lighting thanks to [i]light probes[/i], which can be automatically placed by setting [member generate_probes_subdiv] to a value other than [constant GENERATE_PROBES_DISABLED]. Additional lightmap probes can also be added by creating [LightmapProbe] nodes. The downside is that lightmaps are fully static and cannot be baked in an exported project. Baking a [LightmapGI] node is also slower compared to [VoxelGI]. [b]Procedural generation:[/b] Lightmap baking functionality is only available in the editor. This means [LightmapGI] is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use [VoxelGI] or SDFGI instead (see [member Environment.sdfgi_enabled]). [b]Performance:[/b] [LightmapGI] provides the best possible run-time performance for global illumination. It is suitable for low-end hardware including integrated graphics and mobile devices. + [b]Note:[/b] Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again. + [b]Note:[/b] Lightmap baking on [CSGShape3D]s and [PrimitiveMesh]es is not supported, as these cannot store UV2 data required for baking. + [b]Note:[/b] If no custom lightmappers are installed, [LightmapGI] can only be baked when using the Vulkan backend (Clustered or Mobile), not OpenGL. </description> <tutorials> </tutorials> <members> <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0005"> + The bias to use when computing shadows. Increasing [member bias] can fix shadow acne on the resulting baked lightmap, but can introduce peter-panning (shadows not connecting to their casters). Real-time [Light3D] shadows are not affected by this [member bias] property. </member> <member name="bounces" type="int" setter="set_bounces" getter="get_bounces" default="1"> + Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to [code]0[/code], only environment lighting, direct light and emissive lighting is baked. </member> <member name="directional" type="bool" setter="set_directional" getter="is_directional" default="false"> + If [code]true[/code], bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked ([member Light3D.light_bake_mode] set to [constant Light3D.BAKE_STATIC]). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes. + [b]Note:[/b] The property's name has no relationship with [DirectionalLight3D]. [member directional] works with all light types. </member> <member name="environment_custom_color" type="Color" setter="set_environment_custom_color" getter="get_environment_custom_color"> + The color to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. </member> <member name="environment_custom_energy" type="float" setter="set_environment_custom_energy" getter="get_environment_custom_energy"> + The color multiplier to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. </member> <member name="environment_custom_sky" type="Sky" setter="set_environment_custom_sky" getter="get_environment_custom_sky"> + The sky to use as a source of environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_SKY]. </member> <member name="environment_mode" type="int" setter="set_environment_mode" getter="get_environment_mode" enum="LightmapGI.EnvironmentMode" default="0"> + The environment mode to use when baking lightmaps. </member> <member name="generate_probes_subdiv" type="int" setter="set_generate_probes" getter="get_generate_probes" enum="LightmapGI.GenerateProbes" default="0"> + The level of subdivision to use when automatically generating [LightmapProbe]s for dynamic object lighting. Higher values result in more accurate indirect lighting on dynamic objects, at the cost of longer bake times and larger file sizes. + [b]Note:[/b] Automatically generated [LightmapProbe]s are not visible as nodes in the Scene tree dock, and cannot be modified this way after they are generated. + [b]Note:[/b] Regardless of [member generate_probes_subdiv], direct lighting on dynamic objects is always applied using [Light3D] nodes in real-time. </member> <member name="interior" type="bool" setter="set_interior" getter="is_interior" default="false"> + If [code]true[/code], ignore environment lighting when baking lightmaps. </member> <member name="light_data" type="LightmapGIData" setter="set_light_data" getter="get_light_data"> + The [LightmapGIData] associated to this [LightmapGI] node. This resource is automatically created after baking, and is not meant to be created manually. </member> <member name="max_texture_size" type="int" setter="set_max_texture_size" getter="get_max_texture_size" default="16384"> + The maximum texture size for the generated texture atlas. Higher values will result in fewer slices being generated, but may not work on all hardware as a result of hardware limitations on texture sizes. Leave [member max_texture_size] at its default value of [code]16384[/code] if unsure. </member> <member name="quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="LightmapGI.BakeQuality" default="1"> + The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels. + To further speed up bake times, decrease [member bounces], disable [member use_denoiser] and increase the lightmap texel size on 3D scenes in the Import doc. </member> <member name="use_denoiser" type="bool" setter="set_use_denoiser" getter="is_using_denoiser" default="true"> + If [code]true[/code], uses a CPU-based denoising algorithm on the generated lightmap. This eliminates most noise within the generated lightmap at the cost of longer bake times. File sizes are generally not impacted significantly by the use of a denoiser, although lossless compression may do a better job at compressing a denoised image. + [b]Note:[/b] The built-in denoiser (OpenImageDenoise) may crash when denoising lightmaps in large scenes. If you encounter a crash at the end of lightmap baking, try disabling [member use_denoiser]. </member> </members> <constants> <constant name="BAKE_QUALITY_LOW" value="0" enum="BakeQuality"> + Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count]. </constant> <constant name="BAKE_QUALITY_MEDIUM" value="1" enum="BakeQuality"> + Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count]. </constant> <constant name="BAKE_QUALITY_HIGH" value="2" enum="BakeQuality"> + High bake quality (slow bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count]. </constant> <constant name="BAKE_QUALITY_ULTRA" value="3" enum="BakeQuality"> + Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count]. </constant> <constant name="GENERATE_PROBES_DISABLED" value="0" enum="GenerateProbes"> + Don't generate lightmap probes for lighting dynamic objects. </constant> <constant name="GENERATE_PROBES_SUBDIV_4" value="1" enum="GenerateProbes"> + Lowest level of subdivision (fastest bake times, smallest file sizes). </constant> <constant name="GENERATE_PROBES_SUBDIV_8" value="2" enum="GenerateProbes"> + Low level of subdivision (fast bake times, small file sizes). </constant> <constant name="GENERATE_PROBES_SUBDIV_16" value="3" enum="GenerateProbes"> + High level of subdivision (slow bake times, large file sizes). </constant> <constant name="GENERATE_PROBES_SUBDIV_32" value="4" enum="GenerateProbes"> + Highest level of subdivision (slowest bake times, largest file sizes). </constant> <constant name="BAKE_ERROR_OK" value="0" enum="BakeError"> + Lightmap baking was successful. </constant> <constant name="BAKE_ERROR_NO_LIGHTMAPPER" value="1" 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"> + 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"> + 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"> + 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"> + 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"> + 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"> + Ignore environment lighting when baking lightmaps. </constant> <constant name="ENVIRONMENT_MODE_SCENE" value="1" enum="EnvironmentMode"> + Use the scene's environment lighting when baking lightmaps. + [b]Note:[/b] If baking lightmaps in a scene with no [WorldEnvironment] node, this will act like [constant ENVIRONMENT_MODE_DISABLED]. The editor's preview sky and sun is [i]not[/i] taken into account by [LightmapGI] when baking lightmaps. </constant> <constant name="ENVIRONMENT_MODE_CUSTOM_SKY" value="2" enum="EnvironmentMode"> + Use [member environment_custom_sky] as a source of environment lighting when baking lightmaps. </constant> <constant name="ENVIRONMENT_MODE_CUSTOM_COLOR" value="3" enum="EnvironmentMode"> + Use [member environment_custom_color] multiplied by [member environment_custom_energy] as a constant source of environment lighting when baking lightmaps. </constant> </constants> </class> diff --git a/doc/classes/LightmapGIData.xml b/doc/classes/LightmapGIData.xml index c2423daef0..20113ac309 100644 --- a/doc/classes/LightmapGIData.xml +++ b/doc/classes/LightmapGIData.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="LightmapGIData" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Contains baked lightmap and dynamic object probe data for [LightmapGI]. </brief_description> <description> + [LightmapGIData] contains baked lightmap and dynamic object probe data for [LightmapGI]. It is replaced every time lightmaps are baked in [LightmapGI]. </description> <tutorials> </tutorials> @@ -14,38 +16,46 @@ <argument index="2" name="slice_index" type="int" /> <argument index="3" name="sub_instance" type="int" /> <description> + Adds an object that is considered baked within this [LightmapGIData]. </description> </method> <method name="clear_users"> <return type="void" /> <description> + Clear all objects that are considred baked within this [LightmapGIData]. </description> </method> <method name="get_user_count" qualifiers="const"> <return type="int" /> <description> + Returns the number of objects that are considered baked within this [LightmapGIData]. </description> </method> <method name="get_user_path" qualifiers="const"> <return type="NodePath" /> <argument index="0" name="user_idx" type="int" /> <description> + Returns the [NodePath] of the baked object at index [code]user_idx[/code]. </description> </method> <method name="is_using_spherical_harmonics" qualifiers="const"> <return type="bool" /> <description> + If [code]true[/code], lightmaps were baked with directional information. See also [member LightmapGI.directional]. </description> </method> <method name="set_uses_spherical_harmonics"> <return type="void" /> <argument index="0" name="uses_spherical_harmonics" type="bool" /> <description> + If [code]uses_spherical_harmonics[/code] is [code]true[/code], tells the engine to treat the lightmap data as if it was baked with directional information. + [b]Note:[/b] Changing this value on already baked lightmaps will not cause them to be baked again. This means the material appearance will look incorrect until lightmaps are baked again, in which case the value set here is discarded as the entire [LightmapGIData] resource is replaced by the lightmapper. </description> </method> </methods> <members> <member name="light_texture" type="TextureLayered" setter="set_light_texture" getter="get_light_texture"> + The lightmap atlas texture generated by the lightmapper. </member> </members> </class> diff --git a/doc/classes/LightmapProbe.xml b/doc/classes/LightmapProbe.xml index a5ba6294b9..cb4879b6c7 100644 --- a/doc/classes/LightmapProbe.xml +++ b/doc/classes/LightmapProbe.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="LightmapProbe" inherits="Node3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Represents a single manually placed probe for dynamic object lighting with [LightmapGI]. </brief_description> <description> + [LightmapProbe] represents the position of a single manually placed probe for dynamic object lighting with [LightmapGI]. + Typically, [LightmapGI] probes are placed automatically by setting [member LightmapGI.generate_probes_subdiv] to a value other than [constant LightmapGI.GENERATE_PROBES_DISABLED]. By creating [LightmapProbe] nodes before baking lightmaps, you can add more probes in specific areas for greater detail, or disable automatic generation and rely only on manually placed probes instead. </description> <tutorials> </tutorials> diff --git a/doc/classes/Lightmapper.xml b/doc/classes/Lightmapper.xml index f9a1e2fa99..58ef2ed0cf 100644 --- a/doc/classes/Lightmapper.xml +++ b/doc/classes/Lightmapper.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Lightmapper" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Abstract class extended by lightmappers, for use in [LightmapGI]. </brief_description> <description> + This class should be extended by custom lightmapper classes. Lightmappers can then be used with [LightmapGI] to provide fast baked global illumination in 3D. + Godot contains a built-in GPU-based lightmapper [LightmapperRD] that uses compute shaders, but custom lightmappers can be implemented by C++ modules. </description> <tutorials> </tutorials> diff --git a/doc/classes/LightmapperRD.xml b/doc/classes/LightmapperRD.xml index 29d95244ce..e4b68a7ef8 100644 --- a/doc/classes/LightmapperRD.xml +++ b/doc/classes/LightmapperRD.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="LightmapperRD" inherits="Lightmapper" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + The built-in GPU-based lightmapper for use with [LightmapGI]. </brief_description> <description> + LightmapperRD ("RD" stands for [RenderingDevice]) is the built-in GPU-based lightmapper for use with [LightmapGI]. On most dedicated GPUs, it can bake lightmaps much faster than most CPU-based lightmappers. LightmapperRD uses compute shaders to bake lightmaps, so it does not require CUDA or OpenCL libraries to be installed to be usable. + [b]Note:[/b] Only usable when using the Vulkan backend (Clustered or Mobile), not OpenGL. </description> <tutorials> </tutorials> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 55e012ee0c..84471bafc0 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -37,12 +37,6 @@ Erases the [LineEdit]'s [member text]. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="delete_char_at_caret"> <return type="void" /> <description> @@ -70,13 +64,6 @@ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_scroll_offset" qualifiers="const"> <return type="int" /> <description> @@ -149,14 +136,6 @@ Selects the whole [String]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index ba80504caf..7c6ff2d4e1 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -9,29 +9,6 @@ </description> <tutorials> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 2b24901fe2..48fa2754d5 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -123,7 +123,7 @@ <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh" /> <description> - Generate a [TriangleMesh] from the mesh. + Generate a [TriangleMesh] from the mesh. Considers only surfaces using one of these primitive types: [constant PRIMITIVE_TRIANGLES], [constant PRIMITIVE_TRIANGLE_STRIP]. </description> </method> <method name="get_aabb" qualifiers="const"> @@ -215,12 +215,16 @@ [PackedVector2Array] for second UV coordinates. </constant> <constant name="ARRAY_CUSTOM0" value="6" enum="ArrayType"> + Contains custom color channel 0. [PackedByteArray] if [code](format >> [constant ARRAY_FORMAT_CUSTOM0_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. </constant> <constant name="ARRAY_CUSTOM1" value="7" enum="ArrayType"> + Contains custom color channel 1. [PackedByteArray] if [code](format >> [constant ARRAY_FORMAT_CUSTOM1_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. </constant> <constant name="ARRAY_CUSTOM2" value="8" enum="ArrayType"> + Contains custom color channel 2. [PackedByteArray] if [code](format >> [constant ARRAY_FORMAT_CUSTOM2_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. </constant> <constant name="ARRAY_CUSTOM3" value="9" enum="ArrayType"> + Contains custom color channel 3. [PackedByteArray] if [code](format >> [constant ARRAY_FORMAT_CUSTOM3_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. </constant> <constant name="ARRAY_BONES" value="10" enum="ArrayType"> [PackedFloat32Array] or [PackedInt32Array] of bone indices. Each element is a group of 4 numbers. @@ -236,20 +240,28 @@ Represents the size of the [enum ArrayType] enum. </constant> <constant name="ARRAY_CUSTOM_RGBA8_UNORM" value="0" enum="ArrayCustomFormat"> + Indicates this custom channel contains unsigned normalized byte colors from 0 to 1, encoded as [PackedByteArray]. </constant> <constant name="ARRAY_CUSTOM_RGBA8_SNORM" value="1" enum="ArrayCustomFormat"> + Indicates this custom channel contains signed normalized byte colors from -1 to 1, encoded as [PackedByteArray]. </constant> <constant name="ARRAY_CUSTOM_RG_HALF" value="2" enum="ArrayCustomFormat"> + Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. Only red and green channels are used. </constant> <constant name="ARRAY_CUSTOM_RGBA_HALF" value="3" enum="ArrayCustomFormat"> + Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. </constant> <constant name="ARRAY_CUSTOM_R_FLOAT" value="4" enum="ArrayCustomFormat"> + Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only the red green channel is used. </constant> <constant name="ARRAY_CUSTOM_RG_FLOAT" value="5" enum="ArrayCustomFormat"> + Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red and green channels are used. </constant> <constant name="ARRAY_CUSTOM_RGB_FLOAT" value="6" enum="ArrayCustomFormat"> + Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red, green and blue channels are used. </constant> <constant name="ARRAY_CUSTOM_RGBA_FLOAT" value="7" enum="ArrayCustomFormat"> + Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. </constant> <constant name="ARRAY_CUSTOM_MAX" value="8" enum="ArrayCustomFormat"> Represents the size of the [enum ArrayCustomFormat] enum. @@ -273,12 +285,16 @@ Mesh array contains second UV. </constant> <constant name="ARRAY_FORMAT_CUSTOM0" value="64" enum="ArrayFormat"> + Mesh array contains custom channel index 0. </constant> <constant name="ARRAY_FORMAT_CUSTOM1" value="128" enum="ArrayFormat"> + Mesh array contains custom channel index 1. </constant> <constant name="ARRAY_FORMAT_CUSTOM2" value="256" enum="ArrayFormat"> + Mesh array contains custom channel index 2. </constant> <constant name="ARRAY_FORMAT_CUSTOM3" value="512" enum="ArrayFormat"> + Mesh array contains custom channel index 3. </constant> <constant name="ARRAY_FORMAT_BONES" value="1024" enum="ArrayFormat"> Mesh array contains bones. @@ -290,29 +306,40 @@ Mesh array uses indices. </constant> <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="7" enum="ArrayFormat"> + Mask of mesh channels permitted in blend shapes. </constant> <constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat"> + Shift of first custom channel. </constant> <constant name="ARRAY_FORMAT_CUSTOM_BITS" value="3" enum="ArrayFormat"> + Number of format bits per custom channel. See [enum ArrayCustomFormat]. </constant> <constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat"> + Amount to shift [enum ArrayCustomFormat] for custom channel index 0. </constant> <constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat"> + Amount to shift [enum ArrayCustomFormat] for custom channel index 1. </constant> <constant name="ARRAY_FORMAT_CUSTOM2_SHIFT" value="19" enum="ArrayFormat"> + Amount to shift [enum ArrayCustomFormat] for custom channel index 2. </constant> <constant name="ARRAY_FORMAT_CUSTOM3_SHIFT" value="22" enum="ArrayFormat"> + Amount to shift [enum ArrayCustomFormat] for custom channel index 3. </constant> <constant name="ARRAY_FORMAT_CUSTOM_MASK" value="7" enum="ArrayFormat"> + Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See [enum ArrayCustomFormat]. </constant> <constant name="ARRAY_COMPRESS_FLAGS_BASE" value="25" enum="ArrayFormat"> + Shift of first compress flag. Compress flags should be passed to [method ArrayMesh.add_surface_from_arrays] and [method SurfaceTool.commit]. </constant> <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="33554432" enum="ArrayFormat"> Flag used to mark that the array contains 2D vertices. </constant> <constant name="ARRAY_FLAG_USE_DYNAMIC_UPDATE" value="67108864" enum="ArrayFormat"> + Flag indices that the mesh data will use [code]GL_DYNAMIC_DRAW[/code] on GLES. Unused on Vulkan. </constant> <constant name="ARRAY_FLAG_USE_8_BONE_WEIGHTS" value="134217728" enum="ArrayFormat"> + Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that [constant ARRAY_BONES] and [constant ARRAY_WEIGHTS] elements will have double length. </constant> <constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode"> Blend shapes are normalized. diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index 96e66f850a..e9666337a1 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -4,7 +4,7 @@ Node used for displaying a [Mesh] in 2D. </brief_description> <description> - Node used for displaying a [Mesh] in 2D. Can be constructed from an existing [Sprite2D] via a tool in the editor toolbar. Select "Sprite2D" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". + Node used for displaying a [Mesh] in 2D. A [MeshInstance2D] can be automatically created from an existing [Sprite2D] via a tool in the editor toolbar. Select the [Sprite2D] node, then choose [b]Sprite2D > Convert to MeshInstance2D[/b] at the top of the 2D editor viewport. </description> <tutorials> <link title="2D meshes">$DOCS_URL/tutorials/2d/2d_meshes.html</link> diff --git a/doc/classes/MovieWriter.xml b/doc/classes/MovieWriter.xml new file mode 100644 index 0000000000..bc702adde6 --- /dev/null +++ b/doc/classes/MovieWriter.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MovieWriter" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Abstract class for non-real-time video recording encoders. + </brief_description> + <description> + Godot can record videos with non-real-time simulation. Like the [code]--fixed-fps[/code] command line argument, this forces the reported [code]delta[/code] in [method Node._process] functions to be identical across frames, regardless of how long it actually took to render the frame. This can be used to record high-quality videos with perfect frame pacing regardless of your hardware's capabilities. + Godot has 2 built-in [MovieWriter]s: + - AVI container with MJPEG for video and uncompressed audio ([code].avi[/code] file extension). Lossy compression, medium file sizes, fast encoding. The lossy compression quality can be adjusted by changing [member ProjectSettings.editor/movie_writer/mjpeg_quality]. The resulting file can be viewed in most video players, but it must be converted to another format for viewing on the web or by Godot with [VideoStreamPlayer]. MJPEG does not support transparency. AVI output is currently limited to a file of 4 GB in size at most. + - PNG image sequence for video and WAV for audio ([code].png[/code] file extension). Lossless compression, large file sizes, slow encoding. Designed to be encoded to a video file with another tool such as [url=https://ffmpeg.org/]FFmpeg[/url] after recording. Transparency is currently not supported, even if the root viewport is set to be transparent. + If you need to encode to a different format or pipe a stream through third-party software, you can extend the [MovieWriter] class to create your own movie writers. This should typically be done using GDExtension for performance reasons. + [b]Editor usage:[/b] A default movie file path can be specified in [member ProjectSettings.editor/movie_writer/movie_file]. Alternatively, for running single scenes, a [code]movie_path[/code] metadata can be added to the root node, specifying the path to a movie file that will be used when recording that scene. Once a path is set, click the video reel icon in the top-right corner of the editor to enable Movie Maker mode, then run any scene as usual. The engine will start recording as soon as the splash screen is finished, and it will only stop recording when the engine quits. Click the video reel icon again to disable Movie Maker mode. Note that toggling Movie Maker mode does not affect project instances that are already running. + [b]Note:[/b] MovieWriter is available for use in both the editor and exported projects, but it is [i]not[/i] designed for use by end users to record videos while playing. Players wishing to record gameplay videos should install tools such as [url=https://obsproject.com/]OBS Studio[/url] or [url=https://www.maartenbaert.be/simplescreenrecorder/]SimpleScreenRecorder[/url] instead. + </description> + <tutorials> + </tutorials> + <methods> + <method name="_get_audio_mix_rate" qualifiers="virtual const"> + <return type="int" /> + <description> + Called when the audio sample rate used for recording the audio is requested by the engine. The value returned must be specified in Hz. Defaults to 48000 Hz if [method _get_audio_mix_rate] is not overridden. + </description> + </method> + <method name="_get_audio_speaker_mode" qualifiers="virtual const"> + <return type="int" enum="AudioServer.SpeakerMode" /> + <description> + Called when the audio speaker mode used for recording the audio is requested by the engine. This can affect the number of output channels in the resulting audio file/stream. Defaults to [constant AudioServer.SPEAKER_MODE_STEREO] if [method _get_audio_speaker_mode] is not overridden. + </description> + </method> + <method name="_handles_file" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="path" type="String" /> + <description> + Called when the engine determines whether this [MovieWriter] is able to handle the file at [code]path[/code]. Must return [code]true[/code] if this [MovieWriter] is able to handle the given file path, [code]false[/code] otherwise. Typically, [method _handles_file] is overridden as follows to allow the user to record a file at any path with a given file extension: + [codeblock] + func _handles_file(path): + # Allows specifying an output file with a `.mkv` file extension (case-insensitive), + # either in the Project Settings or with the `--write-movie <path>` command line argument. + return path.get_extension().to_lower() == "mkv" + [/codeblock] + </description> + </method> + <method name="_write_begin" qualifiers="virtual"> + <return type="int" enum="Error" /> + <argument index="0" name="movie_size" type="Vector2i" /> + <argument index="1" name="fps" type="int" /> + <argument index="2" name="base_path" type="String" /> + <description> + Called once before the engine starts writing video and audio data. [code]movie_size[/code] is the width and height of the video to save. [code]fps[/code] is the number of frames per second specified in the project settings or using the [code]--fixed-fps <fps>[/code] command line argument. + </description> + </method> + <method name="_write_end" qualifiers="virtual"> + <return type="void" /> + <description> + Called when the engine finishes writing. This occurs when the engine quits by pressing the window manager's close button, or when [method SceneTree.quit] is called. + [b]Note:[/b] Pressing [kbd]Ctrl + C[/kbd] on the terminal running the editor/project does [i]not[/i] result in [method _write_end] being called. + </description> + </method> + <method name="_write_frame" qualifiers="virtual"> + <return type="int" enum="Error" /> + <argument index="0" name="frame_image" type="Image" /> + <argument index="1" name="audio_frame_block" type="const void*" /> + <description> + Called at the end of every rendered frame. The [code]frame_image[/code] and [code]audio_frame_block[/code] function arguments should be written to. + </description> + </method> + <method name="add_writer" qualifiers="static"> + <return type="void" /> + <argument index="0" name="writer" type="MovieWriter" /> + <description> + Adds a writer to be usable by the engine. The supported file extensions can be set by overridding [method _handles_file]. + [b]Note:[/b] [method add_writer] must be called early enough in the engine initialization to work, as movie writing is designed to start at the same time as the rest of the engine. + </description> + </method> + </methods> +</class> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 631b2ea050..9d8f1e1e5d 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -91,7 +91,8 @@ <member name="custom_data_array" type="PackedColorArray" setter="_set_custom_data_array" getter="_get_custom_data_array"> </member> <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" default="0"> - Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with [member visible_instance_count]. + Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect. + By default, all instances are drawn but you can limit this with [member visible_instance_count]. </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Mesh to be drawn. diff --git a/doc/classes/MultiplayerSpawner.xml b/doc/classes/MultiplayerSpawner.xml index 465db85455..4ca92728ff 100644 --- a/doc/classes/MultiplayerSpawner.xml +++ b/doc/classes/MultiplayerSpawner.xml @@ -13,6 +13,28 @@ <description> </description> </method> + <method name="add_spawnable_scene"> + <return type="void" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="clear_spawnable_scenes"> + <return type="void" /> + <description> + </description> + </method> + <method name="get_spawnable_scene" qualifiers="const"> + <return type="String" /> + <argument index="0" name="path" type="int" /> + <description> + </description> + </method> + <method name="get_spawnable_scene_count" qualifiers="const"> + <return type="int" /> + <description> + </description> + </method> <method name="spawn"> <return type="Node" /> <argument index="0" name="data" type="Variant" default="null" /> @@ -23,8 +45,6 @@ <members> <member name="auto_spawn" type="bool" setter="set_auto_spawning" getter="is_auto_spawning" default="false"> </member> - <member name="replication" type="PackedScene[]" setter="set_spawnable_scenes" getter="get_spawnable_scenes" default="[]"> - </member> <member name="spawn_limit" type="int" setter="set_spawn_limit" getter="get_spawn_limit" default="0"> </member> <member name="spawn_path" type="NodePath" setter="set_spawn_path" getter="get_spawn_path" default="NodePath("")"> diff --git a/doc/classes/MultiplayerSynchronizer.xml b/doc/classes/MultiplayerSynchronizer.xml index e1f0948346..ac067791e6 100644 --- a/doc/classes/MultiplayerSynchronizer.xml +++ b/doc/classes/MultiplayerSynchronizer.xml @@ -7,11 +7,11 @@ <tutorials> </tutorials> <members> - <member name="replication_interval" type="float" setter="set_replication_interval" getter="get_replication_interval" default="0.0"> + <member name="replication_config" type="SceneReplicationConfig" setter="set_replication_config" getter="get_replication_config"> </member> - <member name="resource" type="SceneReplicationConfig" setter="set_replication_config" getter="get_replication_config"> + <member name="replication_interval" type="float" setter="set_replication_interval" getter="get_replication_interval" default="0.0"> </member> - <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath("")"> + <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath("..")"> </member> </members> </class> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index baab91569a..058f1032cb 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -5,6 +5,7 @@ </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 [method set_target_location] is used 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. </description> <tutorials> </tutorials> @@ -24,7 +25,7 @@ <method name="get_nav_path" qualifiers="const"> <return type="PackedVector2Array" /> <description> - Returns the path from start to finish in global coordinates. + 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. </description> </method> <method name="get_nav_path_index" qualifiers="const"> @@ -33,15 +34,29 @@ Returns which index the agent is currently on in the navigation path's [PackedVector2Array]. </description> </method> + <method name="get_navigation_layer_value" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_number" type="int" /> + <description> + Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> + <method name="get_navigation_map" qualifiers="const"> + <return type="RID" /> + <description> + 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"> <return type="Vector2" /> <description> - Returns a [Vector2] 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. + 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. </description> </method> <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> + Returns the [RID] of this agent on the [NavigationServer2D]. </description> </method> <method name="get_target_location" qualifiers="const"> @@ -68,6 +83,21 @@ Returns true if the target location is reached. The target location is set using [method set_target_location]. 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]. </description> </method> + <method name="set_navigation_layer_value"> + <return type="void" /> + <argument index="0" name="layer_number" type="int" /> + <argument index="1" name="value" type="bool" /> + <description> + Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> + <method name="set_navigation_map"> + <return type="void" /> + <argument index="0" name="navigation_map" type="RID" /> + <description> + Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the [code]agent[/code] on the NavigationServer. + </description> + </method> <method name="set_target_location"> <return type="void" /> <argument index="0" name="location" type="Vector2" /> @@ -84,26 +114,33 @@ </method> </methods> <members> + <member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false"> + If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [method NavigationAgent2D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. + </member> <member name="max_neighbors" type="int" setter="set_max_neighbors" getter="get_max_neighbors" default="10"> The maximum number of neighbors for the agent to consider. </member> <member name="max_speed" type="float" setter="set_max_speed" getter="get_max_speed" default="200.0"> The maximum speed that an agent can move. </member> - <member name="navigable_layers" type="int" setter="set_navigable_layers" getter="get_navigable_layers" default="1"> - A bitfield determining what layers of navigation regions this agent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new layers. + <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> + A bitfield determining what navigation layers of navigation regions this agent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers. </member> <member name="neighbor_dist" type="float" setter="set_neighbor_dist" getter="get_neighbor_dist" default="500.0"> The distance to search for other agents. </member> + <member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0"> + 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. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="10.0"> - The radius of the agent. + The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_dist]). + Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> - The distance threshold before a target is considered to be reached. This will allow an agent to not have to hit a point on the path exactly, but in the area. + 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="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="20.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. diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index 04b148c70d..c689ddc345 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -5,6 +5,7 @@ </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 [method set_target_location] is used 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. </description> <tutorials> </tutorials> @@ -24,7 +25,7 @@ <method name="get_nav_path" qualifiers="const"> <return type="PackedVector3Array" /> <description> - Returns the path from start to finish in global coordinates. + 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. </description> </method> <method name="get_nav_path_index" qualifiers="const"> @@ -33,15 +34,29 @@ Returns which index the agent is currently on in the navigation path's [PackedVector3Array]. </description> </method> + <method name="get_navigation_layer_value" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_number" type="int" /> + <description> + Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> + <method name="get_navigation_map" qualifiers="const"> + <return type="RID" /> + <description> + 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"> <return type="Vector3" /> <description> - Returns a [Vector3] 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 origin of the agent's parent. + 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. </description> </method> <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> + Returns the [RID] of this agent on the [NavigationServer3D]. </description> </method> <method name="get_target_location" qualifiers="const"> @@ -68,6 +83,21 @@ Returns true if the target location is reached. The target location is set using [method set_target_location]. 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]. </description> </method> + <method name="set_navigation_layer_value"> + <return type="void" /> + <argument index="0" name="layer_number" type="int" /> + <argument index="1" name="value" type="bool" /> + <description> + Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> + <method name="set_navigation_map"> + <return type="void" /> + <argument index="0" name="navigation_map" type="RID" /> + <description> + Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the [code]agent[/code] on the NavigationServer. + </description> + </method> <method name="set_target_location"> <return type="void" /> <argument index="0" name="location" type="Vector3" /> @@ -85,7 +115,10 @@ </methods> <members> <member name="agent_height_offset" type="float" setter="set_agent_height_offset" getter="get_agent_height_offset" default="0.0"> - The agent height offset to match the navigation mesh height. + The NavigationAgent height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. + </member> + <member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false"> + If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [method NavigationAgent3D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. </member> <member name="ignore_y" type="bool" setter="set_ignore_y" getter="get_ignore_y" default="true"> Ignores collisions on the Y axis. Must be true to move on a horizontal plane. @@ -96,20 +129,24 @@ <member name="max_speed" type="float" setter="set_max_speed" getter="get_max_speed" default="10.0"> The maximum speed that an agent can move. </member> - <member name="navigable_layers" type="int" setter="set_navigable_layers" getter="get_navigable_layers" default="1"> - A bitfield determining what layers of navigation regions this agent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new layers. + <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> + A bitfield determining what navigation layers of navigation regions this NavigationAgent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers. </member> <member name="neighbor_dist" type="float" setter="set_neighbor_dist" getter="get_neighbor_dist" default="50.0"> The distance to search for other agents. </member> + <member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0"> + 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. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> - The radius of the agent. + The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_dist]). + Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> - The distance threshold before a target is considered to be reached. This will allow an agent to not have to hit a point on the path exactly, but in the area. + 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="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. diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index bcf2cfc507..966f964b12 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -34,7 +34,7 @@ <return type="bool" /> <argument index="0" name="layer_number" type="int" /> <description> - Returns whether or not the specified layer of the [member geometry/collision_mask] is enabled, given a [code]layer_number[/code] between 1 and 32. + Returns whether or not the specified layer of the [member geometry_collision_mask] is enabled, given a [code]layer_number[/code] between 1 and 32. </description> </method> <method name="get_polygon"> @@ -61,7 +61,7 @@ <argument index="0" name="layer_number" type="int" /> <argument index="1" name="value" type="bool" /> <description> - Based on [code]value[/code], enables or disables the specified layer in the [member geometry/collision_mask], given a [code]layer_number[/code] between 1 and 32. + Based on [code]value[/code], enables or disables the specified layer in the [member geometry_collision_mask], given a [code]layer_number[/code] between 1 and 32. </description> </method> <method name="set_vertices"> @@ -73,75 +73,81 @@ </method> </methods> <members> - <member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="2.0"> + <member name="agent_height" type="float" setter="set_agent_height" getter="get_agent_height" default="1.5"> The minimum floor to ceiling height that will still allow the floor area to be considered walkable. - [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/height]. + [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_height]. </member> - <member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.9"> + <member name="agent_max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.25"> The minimum ledge height that is considered to still be traversable. - [b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell/height]. + [b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell_height]. </member> - <member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0"> + <member name="agent_max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0"> The maximum slope that is considered walkable, in degrees. </member> - <member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="1.0"> + <member name="agent_radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.5"> The distance to erode/shrink the walkable area of the heightfield away from obstructions. - [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/size]. + [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size]. </member> - <member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.2"> + <member name="cell_height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.25"> The Y axis cell size to use for fields. </member> - <member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3"> + <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.25"> The XZ plane cell size to use for fields. </member> - <member name="detail/sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0"> + <member name="detail_sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0"> The sampling distance to use when generating the detail mesh, in cell unit. </member> - <member name="detail/sample_max_error" type="float" setter="set_detail_sample_max_error" getter="get_detail_sample_max_error" default="1.0"> + <member name="detail_sample_max_error" type="float" setter="set_detail_sample_max_error" getter="get_detail_sample_max_error" default="1.0"> The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. </member> - <member name="edge/max_error" type="float" setter="set_edge_max_error" getter="get_edge_max_error" default="1.3"> + <member name="edge_max_error" type="float" setter="set_edge_max_error" getter="get_edge_max_error" default="1.3"> The maximum distance a simplfied contour's border edges should deviate the original raw contour. </member> - <member name="edge/max_length" type="float" setter="set_edge_max_length" getter="get_edge_max_length" default="12.0"> + <member name="edge_max_length" type="float" setter="set_edge_max_length" getter="get_edge_max_length" default="12.0"> The maximum allowed length for contour edges along the border of the mesh. - [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/size]. + [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size]. </member> - <member name="filter/filter_walkable_low_height_spans" type="bool" setter="set_filter_walkable_low_height_spans" getter="get_filter_walkable_low_height_spans" default="false"> - If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent/height]. + <member name="filter_baking_aabb" type="AABB" setter="set_filter_baking_aabb" getter="get_filter_baking_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> + If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area. </member> - <member name="filter/ledge_spans" type="bool" setter="set_filter_ledge_spans" getter="get_filter_ledge_spans" default="false"> + <member name="filter_baking_aabb_offset" type="Vector3" setter="set_filter_baking_aabb_offset" getter="get_filter_baking_aabb_offset" default="Vector3(0, 0, 0)"> + The position offset applied to the [member filter_baking_aabb] [AABB]. + </member> + <member name="filter_ledge_spans" type="bool" setter="set_filter_ledge_spans" getter="get_filter_ledge_spans" default="false"> If [code]true[/code], marks spans that are ledges as non-walkable. </member> - <member name="filter/low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false"> - If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent/max_climb] of a walkable neighbor. + <member name="filter_low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false"> + If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor. + </member> + <member name="filter_walkable_low_height_spans" type="bool" setter="set_filter_walkable_low_height_spans" getter="get_filter_walkable_low_height_spans" default="false"> + If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent_height]. </member> - <member name="geometry/collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask"> + <member name="geometry_collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295"> The physics layers to scan for static colliders. - Only used when [member geometry/parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. + Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. </member> - <member name="geometry/parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="0"> + <member name="geometry_parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="0"> Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. </member> - <member name="geometry/source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" enum="NavigationMesh.SourceGeometryMode" default="0"> + <member name="geometry_source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" enum="NavigationMesh.SourceGeometryMode" default="0"> The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. </member> - <member name="geometry/source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name"> + <member name="geometry_source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name" default="&"navmesh""> The name of the group to scan for geometry. - Only used when [member geometry/source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. + Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. </member> - <member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0"> + <member name="polygon_verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0"> The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. </member> - <member name="region/merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0"> + <member name="region_merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0"> Any regions with a size smaller than this will be merged with larger regions if possible. [b]Note:[/b] This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. </member> - <member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="8.0"> + <member name="region_min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="2.0"> The minimum size of a region for it to be created. [b]Note:[/b] This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. </member> - <member name="sample_partition_type/sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" enum="NavigationMesh.SamplePartitionType" default="0"> + <member name="sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" enum="NavigationMesh.SamplePartitionType" default="0"> Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. </member> </members> @@ -162,7 +168,7 @@ Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes. </constant> <constant name="PARSED_GEOMETRY_STATIC_COLLIDERS" value="1" enum="ParsedGeometryType"> - Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry/collision_mask]. + Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask]. </constant> <constant name="PARSED_GEOMETRY_BOTH" value="2" enum="ParsedGeometryType"> Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. @@ -174,10 +180,10 @@ Scans the child nodes of [NavigationRegion3D] recursively for geometry. </constant> <constant name="SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN" value="1" enum="SourceGeometryMode"> - Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry/source_group_name]. + Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name]. </constant> <constant name="SOURCE_GEOMETRY_GROUPS_EXPLICIT" value="2" enum="SourceGeometryMode"> - Uses nodes in a group for geometry. The group is specified by [member geometry/source_group_name]. + Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name]. </constant> <constant name="SOURCE_GEOMETRY_MAX" value="3" enum="SourceGeometryMode"> Represents the size of the [enum SourceGeometryMode] enum. diff --git a/doc/classes/NavigationMeshGenerator.xml b/doc/classes/NavigationMeshGenerator.xml index 1cffb1a627..612ce54d34 100644 --- a/doc/classes/NavigationMeshGenerator.xml +++ b/doc/classes/NavigationMeshGenerator.xml @@ -1,8 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="NavigationMeshGenerator" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Helper class for creating and clearing navigation meshes. </brief_description> <description> + This class is responsible for creating and clearing 3D navigation meshes used as [NavigationMesh] resources inside [NavigationRegion3D]. The [NavigationMeshGenerator] has very limited to no use for 2D as the navigation mesh baking process expects 3D node types and 3D source geometry to parse. + The entire navigation mesh baking is best done in a separate thread as the voxelization, collision tests and mesh optimization steps involved are very performance and time hungry operations. + Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and properties of the [NavigationMesh] resource. In the first step, starting from a root node and depending on [NavigationMesh] properties all valid 3D source geometry nodes are collected from the [SceneTree]. Second, all collected nodes are parsed for their relevant 3D geometry data and a combined 3D mesh is build. Due to the many different types of parsable objects, from normal [MeshInstance3D]s to [CSGShape3D]s or various [CollisionObject3D]s, some operations to collect geometry data can trigger [RenderingServer] and [PhysicsServer3D] synchronizations. Server synchronization can have a negative effect on baking time or framerate as it often involves [Mutex] locking for thread security. Many parsable objects and the continuous synchronization with other threaded Servers can increase the baking time significantly. On the other hand only a few but very large and complex objects will take some time to prepare for the Servers which can noticeably stall the next frame render. As a general rule the total amount of parsable objects and their individual size and complexity should be balanced to avoid framerate issues or very long baking times. The combined mesh is then passed to the Recast Navigation Object to test the source geometry for walkable terrain suitable to [NavigationMesh] agent properties by creating a voxel world around the meshes bounding area. + The finalized navigation mesh is then returned and stored inside the [NavigationMesh] for use as a resource inside [NavigationRegion3D] nodes. + [b]Note:[/b] Using meshes to not only define walkable surfaces but also obstruct navigation baking does not always work. The navigation baking has no concept of what is a geometry "inside" when dealing with mesh source geometry and this is intentional. Depending on current baking parameters, as soon as the obstructing mesh is large enough to fit a navigation mesh area inside, the baking will generate navigation mesh areas that are inside the obstructing source geometry mesh. </description> <tutorials> </tutorials> @@ -12,12 +18,14 @@ <argument index="0" name="nav_mesh" type="NavigationMesh" /> <argument index="1" name="root_node" type="Node" /> <description> + Bakes navigation data to the provided [code]nav_mesh[/code] by parsing child nodes under the provided [code]root_node[/code] or a specific group of nodes for potential source geometry. The parse behavior can be controlled with the [member NavigationMesh.geometry_parsed_geometry_type] and [member NavigationMesh.geometry_source_geometry_mode] properties on the [NavigationMesh] resource. </description> </method> <method name="clear"> <return type="void" /> <argument index="0" name="nav_mesh" type="NavigationMesh" /> <description> + Removes all polygons and vertices from the provided [code]nav_mesh[/code] resource. </description> </method> </methods> diff --git a/doc/classes/NavigationObstacle2D.xml b/doc/classes/NavigationObstacle2D.xml index 2540c56258..4ecdc06645 100644 --- a/doc/classes/NavigationObstacle2D.xml +++ b/doc/classes/NavigationObstacle2D.xml @@ -5,9 +5,18 @@ </brief_description> <description> 2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle2D] is physics safe. + [b]Note:[/b] Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. </description> <tutorials> </tutorials> + <methods> + <method name="get_rid" qualifiers="const"> + <return type="RID" /> + <description> + Returns the [RID] of this obstacle on the [NavigationServer2D]. + </description> + </method> + </methods> <members> <member name="estimate_radius" type="bool" setter="set_estimate_radius" getter="is_radius_estimated" default="true"> Enables radius estimation algorithm which uses parent's collision shapes to determine the obstacle radius. diff --git a/doc/classes/NavigationObstacle3D.xml b/doc/classes/NavigationObstacle3D.xml index f9489db5f1..ed8af3883c 100644 --- a/doc/classes/NavigationObstacle3D.xml +++ b/doc/classes/NavigationObstacle3D.xml @@ -5,9 +5,18 @@ </brief_description> <description> 3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle3D] is physics safe. + [b]Note:[/b] Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. </description> <tutorials> </tutorials> + <methods> + <method name="get_rid" qualifiers="const"> + <return type="RID" /> + <description> + Returns the [RID] of this obstacle on the [NavigationServer3D]. + </description> + </method> + </methods> <members> <member name="estimate_radius" type="bool" setter="set_estimate_radius" getter="is_radius_estimated" default="true"> Enables radius estimation algorithm which uses parent's collision shapes to determine the obstacle radius. diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index ee57d8f26b..0a2ceeedc5 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -80,6 +80,12 @@ Clears the array of polygons, but it doesn't clear the array of outlines and vertices. </description> </method> + <method name="get_mesh"> + <return type="NavigationMesh" /> + <description> + Returns the [NavigationMesh] resulting from this navigation polygon. This navmesh can be used to update the navmesh of a region with the [method NavigationServer3D.region_set_navmesh] API directly (as 2D uses the 3D server behind the scene). + </description> + </method> <method name="get_outline" qualifiers="const"> <return type="PackedVector2Array" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml index 5cd2e035b6..c48ca18e9e 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -7,26 +7,50 @@ A region of the navigation map. It tells the [NavigationServer2D] what can be navigated and what cannot, based on its [NavigationPolygon] resource. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer2D.map_set_edge_connection_margin]. [b]Note:[/b] Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge. + The pathfinding cost of entering this region from another region can be controlled with the [member enter_cost] value. + [b]Note[/b]: This value is not added to the path cost when the start position is already inside this region. + The pathfinding cost of traveling distances inside this region can be controlled with the [member travel_cost] multiplier. </description> <tutorials> </tutorials> <methods> + <method name="get_navigation_layer_value" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_number" type="int" /> + <description> + Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> <method name="get_region_rid" qualifiers="const"> <return type="RID" /> <description> Returns the [RID] of this region on the [NavigationServer2D]. Combined with [method NavigationServer2D.map_get_closest_point_owner] can be used to identify the [NavigationRegion2D] closest to a point on the merged navigation map. </description> </method> + <method name="set_navigation_layer_value"> + <return type="void" /> + <argument index="0" name="layer_number" type="int" /> + <argument index="1" name="value" type="bool" /> + <description> + Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> </methods> <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> Determines if the [NavigationRegion2D] is enabled or disabled. </member> - <member name="layers" type="int" setter="set_layers" getter="get_layers" default="1"> - A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. + <member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0"> + When pathfinding enters this region's navmesh from another regions navmesh the [code]enter_cost[/code] value is added to the path distance for determining the shortest path. + </member> + <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> + A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. </member> <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon"> The [NavigationPolygon] resource to use. </member> + <member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0"> + When pathfinding moves inside this region's navmesh the traveled distances are multiplied with [code]travel_cost[/code] for determining the shortest path. + </member> </members> </class> diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml index 60f1020286..9f4feee072 100644 --- a/doc/classes/NavigationRegion3D.xml +++ b/doc/classes/NavigationRegion3D.xml @@ -6,6 +6,10 @@ <description> A region of the navigation map. It tells the [NavigationServer3D] what can be navigated and what cannot, based on its [NavigationMesh] resource. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer3D.map_set_edge_connection_margin]. + [b]Note:[/b] Overlapping two regions' navmeshes is not enough for connecting two regions. They must share a similar edge. + The cost of entering this region from another region can be controlled with the [member enter_cost] value. + [b]Note[/b]: This value is not added to the path cost when the start position is already inside this region. + The cost of traveling distances inside this region can be controlled with the [member travel_cost] multiplier. </description> <tutorials> </tutorials> @@ -14,7 +18,14 @@ <return type="void" /> <argument index="0" name="on_thread" type="bool" default="true" /> <description> - Bakes the [NavigationMesh]. If [code]on_thread[/code] is set to [code]true[/code] (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh]. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. + Bakes the [NavigationMesh]. If [code]on_thread[/code] is set to [code]true[/code] (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh]. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as HTML5 with threads disabled). + </description> + </method> + <method name="get_navigation_layer_value" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_number" type="int" /> + <description> + Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. </description> </method> <method name="get_region_rid" qualifiers="const"> @@ -23,17 +34,31 @@ Returns the [RID] of this region on the [NavigationServer3D]. Combined with [method NavigationServer3D.map_get_closest_point_owner] can be used to identify the [NavigationRegion3D] closest to a point on the merged navigation map. </description> </method> + <method name="set_navigation_layer_value"> + <return type="void" /> + <argument index="0" name="layer_number" type="int" /> + <argument index="1" name="value" type="bool" /> + <description> + Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. + </description> + </method> </methods> <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> Determines if the [NavigationRegion3D] is enabled or disabled. </member> - <member name="layers" type="int" setter="set_layers" getter="get_layers" default="1"> - A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. + <member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0"> + When pathfinding enters this region's navmesh from another regions navmesh the [code]enter_cost[/code] value is added to the path distance for determining the shortest path. + </member> + <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> + A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. </member> <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh"> The [NavigationMesh] resource to use. </member> + <member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0"> + When pathfinding moves inside this region's navmesh the traveled distances are multiplied with [code]travel_cost[/code] for determining the shortest path. + </member> </members> <signals> <signal name="bake_finished"> diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index e007dfd9b5..36379d2531 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -5,8 +5,10 @@ </brief_description> <description> NavigationServer2D is the server responsible for all 2D navigation. It handles several objects, namely maps, regions and agents. - Maps are made up of regions, which are made of navigation polygons. Together, they define the navigable areas in the 2D world. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. - You may assign navigation layers to regions with [method NavigationServer2D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. This allows allowing or forbidding some areas to 2D objects. + Maps are made up of regions, which are made of navigation polygons. Together, they define the navigable areas in the 2D world. + [b]Note:[/b] Most NavigationServer changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation related Nodes in the SceneTree or made through scripts. + For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer2D.region_set_navigation_layers], which then can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. This allows allowing or forbidding some areas to 2D objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. [b]Note:[/b] The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. @@ -21,6 +23,13 @@ Creates the agent. </description> </method> + <method name="agent_get_map" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="agent" type="RID" /> + <description> + Returns the navigation map [RID] the requested [code]agent[/code] is currently assigned to. + </description> + </method> <method name="agent_is_map_changed" qualifiers="const"> <return type="bool" /> <argument index="0" name="agent" type="RID" /> @@ -35,7 +44,8 @@ <argument index="2" name="method" type="StringName" /> <argument index="3" name="userdata" type="Variant" default="null" /> <description> - Callback called at the end of the RVO process. + Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated [code]safe_velocity[/code] to the [code]receiver[/code] object with a signal to the chosen [code]method[/code] name. + [b]Note:[/b] Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use [method agent_set_callback] again with a [code]null[/code] object as the [code]receiver[/code]. </description> </method> <method name="agent_set_map" qualifiers="const"> @@ -117,12 +127,35 @@ Destroys the given RID. </description> </method> + <method name="get_maps" qualifiers="const"> + <return type="Array" /> + <description> + Returns all created navigation map [RID]s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. + </description> + </method> <method name="map_create" qualifiers="const"> <return type="RID" /> <description> Create a new map. </description> </method> + <method name="map_force_update"> + <return type="void" /> + <argument index="0" name="map" type="RID" /> + <description> + This function immediately forces synchronization of the specified navigation [code]map[/code] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). + Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. + Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. + [b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. + </description> + </method> + <method name="map_get_agents" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="map" type="RID" /> + <description> + Returns all navigation agents [RID]s that are currently assigned to the requested navigation [code]map[/code]. + </description> + </method> <method name="map_get_cell_size" qualifiers="const"> <return type="float" /> <argument index="0" name="map" type="RID" /> @@ -159,9 +192,16 @@ <argument index="1" name="origin" type="Vector2" /> <argument index="2" name="destination" type="Vector2" /> <argument index="3" name="optimize" type="bool" /> - <argument index="4" name="layers" type="int" default="1" /> + <argument index="4" name="navigation_layers" type="int" default="1" /> <description> - Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. + Returns the navigation path to reach the destination from the origin. [code]navigation_layers[/code] is a bitmask of all region navigation layers that are allowed to be in the path. + </description> + </method> + <method name="map_get_regions" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="map" type="RID" /> + <description> + Returns all navigation regions [RID]s that are currently assigned to the requested navigation [code]map[/code]. </description> </method> <method name="map_is_active" qualifiers="const"> @@ -224,19 +264,50 @@ Returns how many connections this [code]region[/code] has with other regions in the map. </description> </method> - <method name="region_get_layers" qualifiers="const"> + <method name="region_get_enter_cost" qualifiers="const"> + <return type="float" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the [code]enter_cost[/code] of this [code]region[/code]. + </description> + </method> + <method name="region_get_map" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the navigation map [RID] the requested [code]region[/code] is currently assigned to. + </description> + </method> + <method name="region_get_navigation_layers" qualifiers="const"> <return type="int" /> <argument index="0" name="region" type="RID" /> <description> - Returns the region's layers. + Returns the region's navigation layers. </description> </method> - <method name="region_set_layers" qualifiers="const"> + <method name="region_get_travel_cost" qualifiers="const"> + <return type="float" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the [code]travel_cost[/code] of this [code]region[/code]. + </description> + </method> + <method name="region_owns_point" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="point" type="Vector2" /> + <description> + Returns [code]true[/code] if the provided [code]point[/code] in world space is currently owned by the provided navigation [code]region[/code]. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region. + If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer. + [b]Note:[/b] If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected. + </description> + </method> + <method name="region_set_enter_cost" qualifiers="const"> <return type="void" /> <argument index="0" name="region" type="RID" /> - <argument index="1" name="layers" type="int" /> + <argument index="1" name="enter_cost" type="float" /> <description> - Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer2D.map_get_path]). + Sets the [code]enter_cost[/code] for this [code]region[/code]. </description> </method> <method name="region_set_map" qualifiers="const"> @@ -247,6 +318,14 @@ Sets the map for the region. </description> </method> + <method name="region_set_navigation_layers" qualifiers="const"> + <return type="void" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="navigation_layers" type="int" /> + <description> + Set the region's navigation layers. This allows selecting regions from a path request (when using [method NavigationServer2D.map_get_path]). + </description> + </method> <method name="region_set_navpoly" qualifiers="const"> <return type="void" /> <argument index="0" name="region" type="RID" /> @@ -263,6 +342,14 @@ Sets the global transformation for the region. </description> </method> + <method name="region_set_travel_cost" qualifiers="const"> + <return type="void" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="travel_cost" type="float" /> + <description> + Sets the [code]travel_cost[/code] for this [code]region[/code]. + </description> + </method> </methods> <signals> <signal name="map_changed"> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index c987bc9042..5185b353bc 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -5,8 +5,10 @@ </brief_description> <description> NavigationServer3D is the server responsible for all 3D navigation. It handles several objects, namely maps, regions and agents. - Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. - You may assign navigation layers to regions with [method NavigationServer3D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. This allows allowing or forbidding some areas to 3D objects. + Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world. + [b]Note:[/b] Most NavigationServer changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation related Nodes in the SceneTree or made through scripts. + For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer3D.region_set_navigation_layers], which then can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. This allows allowing or forbidding some areas to 3D objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. [b]Note:[/b] The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. @@ -21,6 +23,13 @@ Creates the agent. </description> </method> + <method name="agent_get_map" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="agent" type="RID" /> + <description> + Returns the navigation map [RID] the requested [code]agent[/code] is currently assigned to. + </description> + </method> <method name="agent_is_map_changed" qualifiers="const"> <return type="bool" /> <argument index="0" name="agent" type="RID" /> @@ -35,7 +44,8 @@ <argument index="2" name="method" type="StringName" /> <argument index="3" name="userdata" type="Variant" default="null" /> <description> - Callback called at the end of the RVO process. + Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated [code]safe_velocity[/code] to the [code]receiver[/code] object with a signal to the chosen [code]method[/code] name. + [b]Note:[/b] Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use [method agent_set_callback] again with a [code]null[/code] object as the [code]receiver[/code]. </description> </method> <method name="agent_set_map" qualifiers="const"> @@ -117,12 +127,35 @@ Destroys the given RID. </description> </method> + <method name="get_maps" qualifiers="const"> + <return type="Array" /> + <description> + Returns all created navigation map [RID]s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. + </description> + </method> <method name="map_create" qualifiers="const"> <return type="RID" /> <description> Create a new map. </description> </method> + <method name="map_force_update"> + <return type="void" /> + <argument index="0" name="map" type="RID" /> + <description> + This function immediately forces synchronization of the specified navigation [code]map[/code] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). + Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. + Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. + [b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. + </description> + </method> + <method name="map_get_agents" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="map" type="RID" /> + <description> + Returns all navigation agents [RID]s that are currently assigned to the requested navigation [code]map[/code]. + </description> + </method> <method name="map_get_cell_size" qualifiers="const"> <return type="float" /> <argument index="0" name="map" type="RID" /> @@ -177,9 +210,16 @@ <argument index="1" name="origin" type="Vector3" /> <argument index="2" name="destination" type="Vector3" /> <argument index="3" name="optimize" type="bool" /> - <argument index="4" name="layers" type="int" default="1" /> + <argument index="4" name="navigation_layers" type="int" default="1" /> <description> - Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. + Returns the navigation path to reach the destination from the origin. [code]navigation_layers[/code] is a bitmask of all region navigation layers that are allowed to be in the path. + </description> + </method> + <method name="map_get_regions" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="map" type="RID" /> + <description> + Returns all navigation regions [RID]s that are currently assigned to the requested navigation [code]map[/code]. </description> </method> <method name="map_get_up" qualifiers="const"> @@ -274,19 +314,50 @@ Returns how many connections this [code]region[/code] has with other regions in the map. </description> </method> - <method name="region_get_layers" qualifiers="const"> + <method name="region_get_enter_cost" qualifiers="const"> + <return type="float" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the [code]enter_cost[/code] of this [code]region[/code]. + </description> + </method> + <method name="region_get_map" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the navigation map [RID] the requested [code]region[/code] is currently assigned to. + </description> + </method> + <method name="region_get_navigation_layers" qualifiers="const"> <return type="int" /> <argument index="0" name="region" type="RID" /> <description> - Returns the region's layers. + Returns the region's navigation layers. </description> </method> - <method name="region_set_layers" qualifiers="const"> + <method name="region_get_travel_cost" qualifiers="const"> + <return type="float" /> + <argument index="0" name="region" type="RID" /> + <description> + Returns the [code]travel_cost[/code] of this [code]region[/code]. + </description> + </method> + <method name="region_owns_point" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="point" type="Vector3" /> + <description> + Returns [code]true[/code] if the provided [code]point[/code] in world space is currently owned by the provided navigation [code]region[/code]. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region. + If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer. + [b]Note:[/b] If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected. + </description> + </method> + <method name="region_set_enter_cost" qualifiers="const"> <return type="void" /> <argument index="0" name="region" type="RID" /> - <argument index="1" name="layers" type="int" /> + <argument index="1" name="enter_cost" type="float" /> <description> - Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer3D.map_get_path]). + Sets the [code]enter_cost[/code] for this [code]region[/code]. </description> </method> <method name="region_set_map" qualifiers="const"> @@ -297,6 +368,14 @@ Sets the map for the region. </description> </method> + <method name="region_set_navigation_layers" qualifiers="const"> + <return type="void" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="navigation_layers" type="int" /> + <description> + Set the region's navigation layers. This allows selecting regions from a path request (when using [method NavigationServer3D.map_get_path]). + </description> + </method> <method name="region_set_navmesh" qualifiers="const"> <return type="void" /> <argument index="0" name="region" type="RID" /> @@ -313,6 +392,14 @@ Sets the global transformation for the region. </description> </method> + <method name="region_set_travel_cost" qualifiers="const"> + <return type="void" /> + <argument index="0" name="region" type="RID" /> + <argument index="1" name="travel_cost" type="float" /> + <description> + Sets the [code]travel_cost[/code] for this [code]region[/code]. + </description> + </method> <method name="set_active" qualifiers="const"> <return type="void" /> <argument index="0" name="active" type="bool" /> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index c9795856d5..b7591ed4f4 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -625,7 +625,7 @@ <return type="void" /> <argument index="0" name="method" type="StringName" /> <description> - Sends a remote procedure call request for the given [code]method[/code] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behaviour depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. Returns an empty [Variant]. + Sends a remote procedure call request for the given [code]method[/code] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behaviour depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. Returns [code]null[/code]. [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [code]server_disconnected[/code] or by checking [code]get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED[/code]. </description> </method> @@ -637,7 +637,7 @@ <argument index="3" name="transfer_mode" type="int" enum="TransferMode" default="2" /> <argument index="4" name="channel" type="int" default="0" /> <description> - Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum RPCMode] and [enum TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs). + Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum RPCMode] and [enum 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"> @@ -645,7 +645,7 @@ <argument index="0" name="peer_id" type="int" /> <argument index="1" name="method" type="StringName" /> <description> - Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). Returns an empty [Variant]. + Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). Returns [code]null[/code]. </description> </method> <method name="set_display_folded"> @@ -778,12 +778,14 @@ <argument index="0" name="node" type="Node" /> <description> Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it. + This signal is emitted [i]after[/i] the child node's own [constant NOTIFICATION_ENTER_TREE] and [signal tree_entered]. </description> </signal> - <signal name="child_exited_tree"> + <signal name="child_exiting_tree"> <argument index="0" name="node" type="Node" /> <description> - Emitted when a child node exits the scene tree, either because it exited on its own or because this node exited. + Emitted when a child node is about to exit the scene tree, either because it is being removed or freed directly, or because this node is exiting the tree. + When this signal is received, the child [code]node[/code] is still in the tree and valid. This signal is emitted [i]after[/i] the child node's own [signal tree_exiting] and [constant NOTIFICATION_EXIT_TREE]. </description> </signal> <signal name="ready"> @@ -799,6 +801,7 @@ <signal name="tree_entered"> <description> Emitted when the node enters the tree. + This signal is emitted [i]after[/i] the related [constant NOTIFICATION_ENTER_TREE] notification. </description> </signal> <signal name="tree_exited"> @@ -809,15 +812,18 @@ <signal name="tree_exiting"> <description> Emitted when the node is still active but about to exit the tree. This is the right place for de-initialization (or a "destructor", if you will). + This signal is emitted [i]before[/i] the related [constant NOTIFICATION_EXIT_TREE] notification. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_ENTER_TREE" value="10"> Notification received when the node enters a [SceneTree]. + This notification is emitted [i]before[/i] the related [signal tree_entered]. </constant> <constant name="NOTIFICATION_EXIT_TREE" value="11"> Notification received when the node is about to exit a [SceneTree]. + This notification is emitted [i]after[/i] the related [signal tree_exiting]. </constant> <constant name="NOTIFICATION_MOVED_IN_PARENT" value="12"> Notification received when the node is moved in the parent. diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index bb73019668..2238be4ece 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -102,6 +102,9 @@ <member name="global_scale" type="Vector2" setter="set_global_scale" getter="get_global_scale"> Global scale. </member> + <member name="global_skew" type="float" setter="set_global_skew" getter="get_global_skew"> + Global skew in radians. + </member> <member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform"> Global [Transform2D]. </member> @@ -113,6 +116,7 @@ </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale. Unscaled value: [code](1, 1)[/code]. + [b]Note:[/b] Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. </member> <member name="skew" type="float" setter="set_skew" getter="get_skew" default="0.0"> </member> diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 4444416a06..ff2afd595a 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -281,6 +281,13 @@ <member name="basis" type="Basis" setter="set_basis" getter="get_basis"> Direct access to the 3x3 basis of the [Transform3D] property. </member> + <member name="global_position" type="Vector3" setter="set_global_position" getter="get_global_position"> + Global position of this node. This is equivalent to [code]global_transform.origin[/code]. + </member> + <member name="global_rotation" type="Vector3" setter="set_global_rotation" getter="get_global_rotation"> + Rotation part of the global transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). + [b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. + </member> <member name="global_transform" type="Transform3D" setter="set_global_transform" getter="get_global_transform"> World3D space (global) [Transform3D] of this node. </member> @@ -302,6 +309,7 @@ </member> <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> Scale part of the local transformation. + [b]Note:[/b] Mixed negative scales in 3D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, the scale values will either be all positive or all negative. </member> <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false"> If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space. diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 3319e5d822..d9e0680a38 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -87,6 +87,12 @@ [/codeblocks] </description> </method> + <method name="get_concatenated_names" qualifiers="const"> + <return type="StringName" /> + <description> + Returns all paths concatenated with a slash character ([code]/[/code]) as separator without subnames. + </description> + </method> <method name="get_concatenated_subnames" qualifiers="const"> <return type="StringName" /> <description> @@ -107,7 +113,7 @@ <return type="StringName" /> <argument index="0" name="idx" type="int" /> <description> - Gets the node name indicated by [code]idx[/code] (0 to [method get_name_count]). + Gets the node name indicated by [code]idx[/code] (0 to [method get_name_count] - 1). [codeblocks] [gdscript] var node_path = NodePath("Path2D/PathFollow2D/Sprite2D") @@ -157,6 +163,12 @@ For example, [code]"Path2D/PathFollow2D/Sprite2D:texture:load_path"[/code] has 2 subnames. </description> </method> + <method name="hash" qualifiers="const"> + <return type="int" /> + <description> + Returns the 32-bit hash value representing the [NodePath]'s contents. + </description> + </method> <method name="is_absolute" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/ORMMaterial3D.xml b/doc/classes/ORMMaterial3D.xml index 69d238ceff..656594a3c3 100644 --- a/doc/classes/ORMMaterial3D.xml +++ b/doc/classes/ORMMaterial3D.xml @@ -1,9 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ORMMaterial3D" inherits="BaseMaterial3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Physically based rendering (PBR) material that can be applied to 3D objects, can use an ORM texture. </brief_description> <description> + ORMMaterial3D's properties are inherited from [BaseMaterial3D]. Unlike [StandardMaterial3D], ORMMaterial3D uses a single texture for ambient occlusion, roughness and metallic maps, known as an ORM texture. </description> <tutorials> + <link title="Standard Material 3D and ORM Material 3D">$DOCS_URL/tutorials/3d/standard_material_3d.html</link> </tutorials> </class> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 266a2573de..aaf08dec2f 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -175,6 +175,10 @@ if argument.find("=") > -1: var key_value = argument.split("=") arguments[key_value[0].lstrip("--")] = key_value[1] + else: + # Options without an argument will be present in the dictionary, + # with the value set to an empty string. + arguments[argument.lstrip("--")] = "" [/gdscript] [csharp] var arguments = new Godot.Collections.Dictionary(); @@ -185,6 +189,12 @@ string[] keyValue = argument.Split("="); arguments[keyValue[0].LStrip("--")] = keyValue[1]; } + else + { + // Options without an argument will be present in the dictionary, + // with the value set to an empty string. + arguments[keyValue[0].LStrip("--")] = ""; + } } [/csharp] [/codeblocks] @@ -469,7 +479,12 @@ <argument index="0" name="path" type="String" /> <description> Moves the file or directory to the system's recycle bin. See also [method Directory.remove]. + The method takes only global paths, so you may need to use [method ProjectSettings.globalize_path]. Do not use it for files in [code]res://[/code] as it will not work in exported project. [b]Note:[/b] If the user has disabled the recycle bin on their system, the file will be permanently deleted instead. + [codeblock] + var file_to_remove = "user://slot1.sav" + OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove)) + [/codeblock] </description> </method> <method name="open_midi_inputs"> @@ -550,7 +565,7 @@ Requests the OS to open a resource with the most appropriate program. For example: - [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the user's Downloads folder. - [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website. - - [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://blog.escapecreative.com/customizing-mailto-links/]Customizing [code]mailto:[/code] Links[/url] for a list of fields that can be added. + - [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://datatracker.ietf.org/doc/html/rfc2368]RFC 2368 - The [code]mailto[/code] URL scheme[/url] for a list of fields that can be added. Use [method ProjectSettings.globalize_path] to convert a [code]res://[/code] or [code]user://[/code] path into a system path for use with this method. [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows. </description> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 42844794b0..11ae7cc2b0 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -325,7 +325,7 @@ </method> <method name="get" qualifiers="const"> <return type="Variant" /> - <argument index="0" name="property" type="String" /> + <argument index="0" name="property" type="StringName" /> <description> Returns the [Variant] value of the given [code]property[/code]. If the [code]property[/code] doesn't exist, this will return [code]null[/code]. [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). @@ -399,7 +399,7 @@ </method> <method name="get_signal_connection_list" qualifiers="const"> <return type="Array" /> - <argument index="0" name="signal" type="String" /> + <argument index="0" name="signal" type="StringName" /> <description> Returns an [Array] of connections for the given [code]signal[/code]. </description> @@ -490,7 +490,7 @@ </method> <method name="set"> <return type="void" /> - <argument index="0" name="property" type="String" /> + <argument index="0" name="property" type="StringName" /> <argument index="1" name="value" type="Variant" /> <description> Assigns a new value to the given property. If the [code]property[/code] does not exist or the given value's type doesn't match, nothing will happen. diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 5d0861bcf3..3af3bb8697 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -409,7 +409,7 @@ <return type="PackedFloat32Array" /> <description> Returns a copy of the data converted to a [PackedFloat32Array], where each block of 4 bytes has been converted to a 32-bit float (C++ [code]float[/code]). - The size of the new array will be [code]byte_array.size() / 4[/code]. + The size of the input array must be a multiple of 4 (size of 32-bit float). The size of the new array will be [code]byte_array.size() / 4[/code]. If the original data can't be converted to 32-bit floats, the resulting data is undefined. </description> </method> @@ -417,7 +417,7 @@ <return type="PackedFloat64Array" /> <description> Returns a copy of the data converted to a [PackedFloat64Array], where each block of 8 bytes has been converted to a 64-bit float (C++ [code]double[/code], Godot [float]). - The size of the new array will be [code]byte_array.size() / 8[/code]. + The size of the input array must be a multiple of 8 (size of 64-bit double). The size of the new array will be [code]byte_array.size() / 8[/code]. If the original data can't be converted to 64-bit floats, the resulting data is undefined. </description> </method> @@ -425,15 +425,15 @@ <return type="PackedInt32Array" /> <description> Returns a copy of the data converted to a [PackedInt32Array], where each block of 4 bytes has been converted to a signed 32-bit integer (C++ [code]int32_t[/code]). - The size of the new array will be [code]byte_array.size() / 4[/code]. + The size of the input array must be a multiple of 4 (size of 32-bit integer). The size of the new array will be [code]byte_array.size() / 4[/code]. If the original data can't be converted to signed 32-bit integers, the resulting data is undefined. </description> </method> <method name="to_int64_array" qualifiers="const"> <return type="PackedInt64Array" /> <description> - Returns a copy of the data converted to a [PackedInt64Array], where each block of 4 bytes has been converted to a signed 64-bit integer (C++ [code]int64_t[/code], Godot [int]). - The size of the new array will be [code]byte_array.size() / 8[/code]. + Returns a copy of the data converted to a [PackedInt64Array], where each block of 8 bytes has been converted to a signed 64-bit integer (C++ [code]int64_t[/code], Godot [int]). + The size of the input array must be a multiple of 8 (size of 64-bit integer). The size of the new array will be [code]byte_array.size() / 8[/code]. If the original data can't be converted to signed 64-bit integers, the resulting data is undefined. </description> </method> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 885bedbc04..354fbd462c 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -77,28 +77,30 @@ Each particle's rotation will be animated along this [CurveTexture]. </member> <member name="angle_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum angle. + Maximum initial rotation applied to each particle, in degrees. + Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. </member> <member name="angle_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum angle. + Minimum equivalent of [member angle_max]. </member> <member name="angular_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's angular velocity (rotation speed) will vary along this [CurveTexture] over its lifetime. </member> <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. + Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. </member> <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. + Minimum equivalent of [member angular_velocity_max]. </member> <member name="anim_offset_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's animation offset will vary along this [CurveTexture]. </member> <member name="anim_offset_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum animation offset. + Maximum animation offset that corresponds to frame index in the texture. [code]0[/code] is the first frame, [code]1[/code] is the last one. See [member CanvasItemMaterial.particles_animation]. </member> <member name="anim_offset_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum animation offset. + Minimum equivalent of [member anim_offset_max]. </member> <member name="anim_speed_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's animation speed will vary along this [CurveTexture]. @@ -108,7 +110,7 @@ With animation speed greater than [code]1[/code], remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. </member> <member name="anim_speed_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum particle animation speed. + Minimum equivalent of [member anim_speed_max]. </member> <member name="attractor_interaction_enabled" type="bool" setter="set_attractor_interaction_enabled" getter="is_attractor_interaction_enabled" default="true"> True if the interaction with particle attractors is enabled. @@ -138,8 +140,10 @@ Damping will vary along this [CurveTexture]. </member> <member name="damping_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> + The maximum rate at which particles lose velocity. For example value of [code]100[/code] means that the particle will go from [code]100[/code] velocity to [code]0[/code] in [code]1[/code] second. </member> <member name="damping_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> + Minimum equivalent of [member damping_max]. </member> <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3(1, 0, 0)"> Unit vector specifying the particles' emission direction. @@ -187,16 +191,16 @@ Each particle's hue will vary along this [CurveTexture]. </member> <member name="hue_variation_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum hue variation. + Maximum initial hue variation applied to each particle. It will shift the particle color's hue. </member> <member name="hue_variation_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum hue variation. + Minimum equivalent of [member hue_variation_max]. </member> <member name="initial_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum initial velocity. + Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. </member> <member name="initial_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum initial velocity. + Minimum equivalent of [member initial_velocity_max]. </member> <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> Particle lifetime randomness ratio. The lifetime will be multiplied by a value interpolated between [code]1.0[/code] and a random number less than one. For example a random ratio of [code]0.4[/code] would scale the original lifetime between [code]0.4-1.0[/code] of its original value. @@ -205,19 +209,20 @@ Each particle's linear acceleration will vary along this [CurveTexture]. </member> <member name="linear_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum linear acceleration. + Maximum linear acceleration applied to each particle in the direction of motion. </member> <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum linear acceleration. + Minimum equivalent of [member linear_accel_min]. </member> <member name="orbit_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's orbital velocity will vary along this [CurveTexture]. </member> <member name="orbit_velocity_max" type="float" setter="set_param_max" getter="get_param_max"> - Maximum orbit velocity. + Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + Only available when [member particle_flag_disable_z] is [code]true[/code]. </member> <member name="orbit_velocity_min" type="float" setter="set_param_min" getter="get_param_min"> - Minimum orbit velocity. + Minimum equivalent of [member orbit_velocity_max]. </member> <member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false"> Align Y axis of particle with the direction of its velocity. @@ -232,19 +237,19 @@ Each particle's radial acceleration will vary along this [CurveTexture]. </member> <member name="radial_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum radial acceleration. + Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. </member> <member name="radial_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum radial acceleration. + Minimum equivalent of [member radial_accel_max]. </member> <member name="scale_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's scale will vary along this [CurveTexture]. If a [CurveXYZTexture] is supplied instead, the scale will be separated per-axis. </member> <member name="scale_max" type="float" setter="set_param_max" getter="get_param_max" default="1.0"> - Maximum scale. + Maximum initial scale applied to each particle. </member> <member name="scale_min" type="float" setter="set_param_min" getter="get_param_min" default="1.0"> - Minimum scale. + Minimum equivalent of [member scale_max]. </member> <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0"> Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. @@ -261,10 +266,10 @@ Each particle's tangential acceleration will vary along this [CurveTexture]. </member> <member name="tangential_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum tangential acceleration. + Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> <member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum tangential acceleration. + Minimum equivalent of [member tangential_accel_max]. </member> </members> <constants> diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index bcaf38fd06..01da9cb9a2 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -6,8 +6,8 @@ <description> This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel. By using the [method get_monitor] method of this class, you can access this data from your code. You can add custom monitors using the [method add_custom_monitor] method. Custom monitors are available in [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel together with built-in monitors. - [b]Note:[/b] A few of these monitors are only available in debug mode and will always return 0 when used in a release build. - [b]Note:[/b] Many of these monitors are not updated in real-time, so there may be a short delay between changes. + [b]Note:[/b] Some of the built-in monitors are only available in debug mode and will always return [code]0[/code] when used in a project exported in release mode. + [b]Note:[/b] Some of the built-in monitors are not updated in real-time for performance reasons, so there may be a delay of up to 1 second between changes. [b]Note:[/b] Custom monitors do not support negative values. Negative values are clamped to 0. </description> <tutorials> @@ -19,7 +19,7 @@ <argument index="1" name="callable" type="Callable" /> <argument index="2" name="arguments" type="Array" default="[]" /> <description> - Adds a custom monitor with name same as id. You can specify the category of monitor using '/' in id. If there are more than one '/' then default category is used. Default category is "Custom". + Adds a custom monitor with the name [code]id[/code]. You can specify the category of the monitor using slash delimiters in [code]id[/code] (for example: [code]"Game/NumberOfNPCs"[/code]). If there is more than one slash delimiter, then the default category is used. The default category is [code]"Custom"[/code]. Prints an error if given [code]id[/code] is already present. [codeblocks] [gdscript] func _ready(): @@ -29,11 +29,11 @@ Performance.add_custom_monitor("MyCategory/MyMonitor", monitor_value) # Adds monitor with name "MyName" to category "Custom". - # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid. + # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different IDs, so the code is valid. Performance.add_custom_monitor("MyMonitor", monitor_value) # Adds monitor with name "MyName" to category "Custom". - # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid. + # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different IDs, so the code is valid. Performance.add_custom_monitor("Custom/MyMonitor", monitor_value) # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom". @@ -67,30 +67,28 @@ } [/csharp] [/codeblocks] - The debugger calls the callable to get the value of custom monitor. The callable must return a number. + The debugger calls the callable to get the value of custom monitor. The callable must return a zero or positive integer or floating-point number. Callables are called with arguments supplied in argument array. - [b]Note:[/b] It prints an error if given id is already present. </description> </method> <method name="get_custom_monitor"> <return type="Variant" /> <argument index="0" name="id" type="StringName" /> <description> - Returns the value of custom monitor with given id. The callable is called to get the value of custom monitor. - [b]Note:[/b] It prints an error if the given id is absent. + Returns the value of custom monitor with given [code]id[/code]. The callable is called to get the value of custom monitor. See also [method has_custom_monitor]. Prints an error if the given [code]id[/code] is absent. </description> </method> <method name="get_custom_monitor_names"> <return type="Array" /> <description> - Returns the names of active custom monitors in an array. + Returns the names of active custom monitors in an [Array]. </description> </method> <method name="get_monitor" qualifiers="const"> <return type="float" /> <argument index="0" name="monitor" type="int" enum="Performance.Monitor" /> <description> - Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this: + Returns the value of one of the available built-in monitors. You should provide one of the [enum Monitor] constants as the argument, like this: [codeblocks] [gdscript] print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console. @@ -99,95 +97,99 @@ GD.Print(Performance.GetMonitor(Performance.Monitor.TimeFps)); // Prints the FPS to the console. [/csharp] [/codeblocks] + See [method get_custom_monitor] to query custom performance monitors' values. </description> </method> <method name="get_monitor_modification_time"> <return type="int" /> <description> - Returns the last tick in which custom monitor was added/removed. + Returns the last tick in which custom monitor was added/removed (in microseconds since the engine started). This is set to [method Time.get_ticks_usec] when the monitor is updated. </description> </method> <method name="has_custom_monitor"> <return type="bool" /> <argument index="0" name="id" type="StringName" /> <description> - Returns true if custom monitor with the given id is present otherwise returns false. + Returns [code]true[/code] if custom monitor with the given [code]id[/code] is present, [code]false[/code] otherwise. </description> </method> <method name="remove_custom_monitor"> <return type="void" /> <argument index="0" name="id" type="StringName" /> <description> - Removes the custom monitor with given id. - [b]Note:[/b] It prints an error if the given id is already absent. + Removes the custom monitor with given [code]id[/code]. Prints an error if the given [code]id[/code] is already absent. </description> </method> </methods> <constants> <constant name="TIME_FPS" value="0" enum="Monitor"> - Number of frames per second. + The number of frames rendered in the last second. This metric is only updated once per second, even if queried more often. [i]Higher is better.[/i] </constant> <constant name="TIME_PROCESS" value="1" enum="Monitor"> - Time it took to complete one frame, in seconds. + Time it took to complete one frame, in seconds. [i]Lower is better.[/i] </constant> <constant name="TIME_PHYSICS_PROCESS" value="2" enum="Monitor"> - Time it took to complete one physics frame, in seconds. + Time it took to complete one physics frame, in seconds. [i]Lower is better.[/i] </constant> <constant name="MEMORY_STATIC" value="3" enum="Monitor"> - Static memory currently used, in bytes. Not available in release builds. + Static memory currently used, in bytes. Not available in release builds. [i]Lower is better.[/i] </constant> <constant name="MEMORY_STATIC_MAX" value="4" enum="Monitor"> - Available static memory. Not available in release builds. + Available static memory. Not available in release builds. [i]Lower is better.[/i] </constant> <constant name="MEMORY_MESSAGE_BUFFER_MAX" value="5" enum="Monitor"> - Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. + Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. [i]Lower is better.[/i] </constant> <constant name="OBJECT_COUNT" value="6" enum="Monitor"> - Number of objects currently instantiated (including nodes). + Number of objects currently instantiated (including nodes). [i]Lower is better.[/i] </constant> <constant name="OBJECT_RESOURCE_COUNT" value="7" enum="Monitor"> - Number of resources currently used. + Number of resources currently used. [i]Lower is better.[/i] </constant> <constant name="OBJECT_NODE_COUNT" value="8" enum="Monitor"> - Number of nodes currently instantiated in the scene tree. This also includes the root node. + Number of nodes currently instantiated in the scene tree. This also includes the root node. [i]Lower is better.[/i] </constant> <constant name="OBJECT_ORPHAN_NODE_COUNT" value="9" enum="Monitor"> - Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. + Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. [i]Lower is better.[/i] </constant> <constant name="RENDER_TOTAL_OBJECTS_IN_FRAME" value="10" enum="Monitor"> + The total number of objects in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling). [i]Lower is better.[/i] </constant> <constant name="RENDER_TOTAL_PRIMITIVES_IN_FRAME" value="11" enum="Monitor"> + The total number of vertices or indices rendered in the last rendered frame. This metric doesn't include primitives from culled objects (either via hiding nodes, frustum culling or occlusion culling). Due to the depth prepass and shadow passes, the number of primitives is always higher than the actual number of vertices in the scene (typically double or triple the original vertex count). [i]Lower is better.[/i] </constant> <constant name="RENDER_TOTAL_DRAW_CALLS_IN_FRAME" value="12" enum="Monitor"> + The total number of draw calls performed in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling), since they do not result in draw calls. [i]Lower is better.[/i] </constant> <constant name="RENDER_VIDEO_MEM_USED" value="13" enum="Monitor"> - The amount of video memory used, i.e. texture and vertex memory combined. + The amount of video memory used (texture and vertex memory combined, in bytes). Since this metric also includes miscellaneous allocations, this value is always greater than the sum of [constant RENDER_TEXTURE_MEM_USED] and [constant RENDER_BUFFER_MEM_USED]. [i]Lower is better.[/i] </constant> <constant name="RENDER_TEXTURE_MEM_USED" value="14" enum="Monitor"> - The amount of texture memory used. + The amount of texture memory used (in bytes). [i]Lower is better.[/i] </constant> <constant name="RENDER_BUFFER_MEM_USED" value="15" enum="Monitor"> + The amount of render buffer memory used (in bytes). [i]Lower is better.[/i] </constant> <constant name="PHYSICS_2D_ACTIVE_OBJECTS" value="16" enum="Monitor"> - Number of active [RigidDynamicBody2D] nodes in the game. + Number of active [RigidDynamicBody2D] nodes in the game. [i]Lower is better.[/i] </constant> <constant name="PHYSICS_2D_COLLISION_PAIRS" value="17" enum="Monitor"> - Number of collision pairs in the 2D physics engine. + Number of collision pairs in the 2D physics engine. [i]Lower is better.[/i] </constant> <constant name="PHYSICS_2D_ISLAND_COUNT" value="18" enum="Monitor"> - Number of islands in the 2D physics engine. + Number of islands in the 2D physics engine. [i]Lower is better.[/i] </constant> <constant name="PHYSICS_3D_ACTIVE_OBJECTS" value="19" enum="Monitor"> - Number of active [RigidDynamicBody3D] and [VehicleBody3D] nodes in the game. + Number of active [RigidDynamicBody3D] and [VehicleBody3D] nodes in the game. [i]Lower is better.[/i] </constant> <constant name="PHYSICS_3D_COLLISION_PAIRS" value="20" enum="Monitor"> - Number of collision pairs in the 3D physics engine. + Number of collision pairs in the 3D physics engine. [i]Lower is better.[/i] </constant> <constant name="PHYSICS_3D_ISLAND_COUNT" value="21" enum="Monitor"> - Number of islands in the 3D physics engine. + Number of islands in the 3D physics engine. [i]Lower is better.[/i] </constant> <constant name="AUDIO_OUTPUT_LATENCY" value="22" enum="Monitor"> - Output latency of the [AudioServer]. + Output latency of the [AudioServer]. [i]Lower is better.[/i] </constant> <constant name="MONITOR_MAX" value="23" enum="Monitor"> Represents the size of the [enum Monitor] enum. diff --git a/doc/classes/PhysicalSkyMaterial.xml b/doc/classes/PhysicalSkyMaterial.xml index 716eaaeeba..7c2ea088c8 100644 --- a/doc/classes/PhysicalSkyMaterial.xml +++ b/doc/classes/PhysicalSkyMaterial.xml @@ -11,9 +11,6 @@ <tutorials> </tutorials> <members> - <member name="dither_strength" type="float" setter="set_dither_strength" getter="get_dither_strength" default="1.0"> - The amount of dithering to use. Dithering helps reduce banding that appears from the smooth changes in color in the sky. Use the lowest value possible for your given sky settings, as higher amounts may add fuzziness to the sky. - </member> <member name="exposure" type="float" setter="set_exposure" getter="get_exposure" default="0.1"> Sets the exposure of the sky. Higher exposure values make the entire sky brighter. </member> @@ -44,5 +41,8 @@ <member name="turbidity" type="float" setter="set_turbidity" getter="get_turbidity" default="10.0"> Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere. </member> + <member name="use_debanding" type="bool" setter="set_use_debanding" getter="get_use_debanding" default="true"> + If [code]true[/code], enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. + </member> </members> </class> diff --git a/doc/classes/PhysicsTestMotionParameters2D.xml b/doc/classes/PhysicsTestMotionParameters2D.xml index c22a49edf7..00f21a2058 100644 --- a/doc/classes/PhysicsTestMotionParameters2D.xml +++ b/doc/classes/PhysicsTestMotionParameters2D.xml @@ -28,5 +28,9 @@ <member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2(0, 0)"> Motion vector to define the length and direction of the motion to test. </member> + <member name="recovery_as_collision" type="bool" setter="set_recovery_as_collision_enabled" getter="is_recovery_as_collision_enabled" default="false"> + If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [method CharacterBody2D.move_and_slide] for improving floor detection when floor snapping is disabled. + If set to [code]false[/code], only collisions resulting from the motion are reported; this is used e.g. by [method PhysicsBody2D.move_and_collide]. + </member> </members> </class> diff --git a/doc/classes/PhysicsTestMotionParameters3D.xml b/doc/classes/PhysicsTestMotionParameters3D.xml index 4ff07de7aa..5b07796a10 100644 --- a/doc/classes/PhysicsTestMotionParameters3D.xml +++ b/doc/classes/PhysicsTestMotionParameters3D.xml @@ -31,5 +31,9 @@ <member name="motion" type="Vector3" setter="set_motion" getter="get_motion" default="Vector3(0, 0, 0)"> Motion vector to define the length and direction of the motion to test. </member> + <member name="recovery_as_collision" type="bool" setter="set_recovery_as_collision_enabled" getter="is_recovery_as_collision_enabled" default="false"> + If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [method CharacterBody3D.move_and_slide] for improving floor detection when floor snapping is disabled. + If set to [code]false[/code], only collisions resulting from the motion are detected; this is used e.g. by [method PhysicsBody3D.move_and_collide]. + </member> </members> </class> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index a42ceba777..6fefcef0a1 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -77,7 +77,7 @@ <return type="float" /> <argument index="0" name="point" type="Vector3" /> <description> - Returns the shortest distance from the plane to the position [code]point[/code]. + Returns the shortest distance from the plane to the position [code]point[/code]. If the point is above the plane, the distance will be positive. If below, the distance will be negative. </description> </method> <method name="has_point" qualifiers="const"> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index bf80aa94a5..5da2196f29 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -8,6 +8,7 @@ The size of a [PopupMenu] can be limited by using [member Window.max_size]. If the height of the list of items is larger than the maximum height of the [PopupMenu], a [ScrollContainer] within the popup will allow the user to scroll the contents. If no maximum size is set, or if it is set to 0, the [PopupMenu] height will be limited by its parent rect. All [code]set_*[/code] methods allow negative item index, which makes the item accessed from the last one. + [b]Incremental search:[/b] Like [ItemList] and [Tree], [PopupMenu] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [member ProjectSettings.gui/timers/incremental_search_max_interval_msec]. </description> <tutorials> </tutorials> @@ -181,13 +182,6 @@ Removes all items from the [PopupMenu]. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <description> - Removes all OpenType features form the item's text. - </description> - </method> <method name="get_current_index" qualifiers="const"> <return type="int" /> <description> @@ -201,6 +195,13 @@ Returns the accelerator of the item at the given [code]index[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. </description> </method> + <method name="get_item_horizontal_offset" qualifiers="const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + Returns the horizontal offset of the item at the given [code]index[/code]. + </description> + </method> <method name="get_item_icon" qualifiers="const"> <return type="Texture2D" /> <argument index="0" name="index" type="int" /> @@ -236,14 +237,6 @@ Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_shortcut" qualifiers="const"> <return type="Shortcut" /> <argument index="0" name="index" type="int" /> @@ -395,6 +388,14 @@ Enables/disables the item at the given [code]index[/code]. When it is disabled, it can't be selected and its action can't be invoked. </description> </method> + <method name="set_item_horizontal_offset"> + <return type="void" /> + <argument index="0" name="index" type="int" /> + <argument index="1" name="offset" type="int" /> + <description> + Sets the horizontal offset of the item at the given [code]index[/code]. + </description> + </method> <method name="set_item_icon"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -436,15 +437,6 @@ Sets the state of a multistate item. See [method add_multistate_item] for details. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_shortcut"> <return type="void" /> <argument index="0" name="index" type="int" /> diff --git a/doc/classes/ProceduralSkyMaterial.xml b/doc/classes/ProceduralSkyMaterial.xml index 88283bcf24..3cc4bd71f7 100644 --- a/doc/classes/ProceduralSkyMaterial.xml +++ b/doc/classes/ProceduralSkyMaterial.xml @@ -11,9 +11,6 @@ <tutorials> </tutorials> <members> - <member name="dither_strength" type="float" setter="set_dither_strength" getter="get_dither_strength" default="1.0"> - The amount of dithering to use. Dithering helps reduce banding that appears from the smooth changes in color in the sky. Use the lowest value possible for your given sky settings, as higher amounts may add fuzziness to the sky. - </member> <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color(0.2, 0.169, 0.133, 1)"> Color of the ground at the bottom. Blends with [member ground_horizon_color]. </member> @@ -50,5 +47,8 @@ <member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve" default="0.15"> How quickly the sun fades away between the edge of the sun disk and [member sun_angle_max]. </member> + <member name="use_debanding" type="bool" setter="set_use_debanding" getter="get_use_debanding" default="true"> + If [code]true[/code], enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. + </member> </members> </class> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index b54c129369..898d34b385 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -203,6 +203,9 @@ Path to an image used as the boot splash. If left empty, the default Godot Engine splash will be displayed instead. [b]Note:[/b] Only effective if [member application/boot_splash/show_image] is [code]true[/code]. </member> + <member name="application/boot_splash/minimum_display_time" type="int" setter="" getter="" default="0"> + Minimum boot splash display time (in milliseconds). It is not recommended to set too high values for this setting. + </member> <member name="application/boot_splash/show_image" type="bool" setter="" getter="" default="true"> If [code]true[/code], displays the image specified in [member application/boot_splash/image] when the engine starts. If [code]false[/code], only displays the plain color specified in [member application/boot_splash/bg_color]. </member> @@ -216,6 +219,9 @@ <member name="application/config/description" type="String" setter="" getter="" default=""""> The project's description, displayed as a tooltip in the Project Manager when hovering the project. </member> + <member name="application/config/features" type="PackedStringArray" setter="" getter=""> + List of internal features associated with the project, like [code]Double Precision[/code] or [code]C#[/code]. Not to be confused with feature tags. + </member> <member name="application/config/icon" type="String" setter="" getter="" default=""""> Icon used for the project, set when project loads. Exporters will also use this icon when possible. </member> @@ -304,6 +310,12 @@ <member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50"> Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. </member> + <member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="1.0"> + The base strength of the panning effect for all AudioStreamPlayer2D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. + </member> + <member name="audio/general/3d_panning_strength" type="float" setter="" getter="" default="1.0"> + The base strength of the panning effect for all AudioStreamPlayer3D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer3D.panning_strength]. + </member> <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. </member> @@ -334,18 +346,20 @@ <member name="debug/file_logging/max_log_files" type="int" setter="" getter="" default="5"> Specifies the maximum amount of log files allowed (used for rotation). </member> - <member name="debug/gdscript/warnings/assert_always_false" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/assert_always_false" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when an [code]assert[/code] call always returns false. </member> - <member name="debug/gdscript/warnings/assert_always_true" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/assert_always_true" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when an [code]assert[/code] call always returns true. </member> - <member name="debug/gdscript/warnings/constant_used_as_function" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when a constant is used as a function. + <member name="debug/gdscript/warnings/constant_used_as_function" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a constant is used as a function. </member> - <member name="debug/gdscript/warnings/deprecated_keyword" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when deprecated keywords are used. + <member name="debug/gdscript/warnings/deprecated_keyword" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when deprecated keywords are used. </member> - <member name="debug/gdscript/warnings/empty_file" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when an empty file is parsed. + <member name="debug/gdscript/warnings/empty_file" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when an empty file is parsed. </member> <member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings. @@ -353,85 +367,94 @@ <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true"> If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings. </member> - <member name="debug/gdscript/warnings/function_used_as_property" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when using a function as if it was a property. + <member name="debug/gdscript/warnings/function_used_as_property" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when using a function as if it was a property. </member> - <member name="debug/gdscript/warnings/incompatible_ternary" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when a ternary operator may emit values with incompatible types. + <member name="debug/gdscript/warnings/incompatible_ternary" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a ternary operator may emit values with incompatible types. </member> - <member name="debug/gdscript/warnings/int_assigned_to_enum" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/int_assigned_to_enum" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when trying to assign an integer to a variable that expects an enum value. </member> - <member name="debug/gdscript/warnings/integer_division" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when dividing an integer by another integer (the decimal part will be discarded). + <member name="debug/gdscript/warnings/integer_division" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when dividing an integer by another integer (the decimal part will be discarded). </member> - <member name="debug/gdscript/warnings/narrowing_conversion" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when passing a floating-point value to a function that expects an integer (it will be converted and lose precision). + <member name="debug/gdscript/warnings/narrowing_conversion" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when passing a floating-point value to a function that expects an integer (it will be converted and lose precision). </member> - <member name="debug/gdscript/warnings/property_used_as_function" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when using a property as if it was a function. + <member name="debug/gdscript/warnings/property_used_as_function" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when using a property as if it was a function. </member> - <member name="debug/gdscript/warnings/redundant_await" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/redundant_await" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a function that is not a coroutine is called with await. </member> - <member name="debug/gdscript/warnings/return_value_discarded" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum. + <member name="debug/gdscript/warnings/return_value_discarded" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum. </member> - <member name="debug/gdscript/warnings/shadowed_global_identifier" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when defining a local or subclass member variable, signal, or enum that would have the same name as a built-in function or global class name, which possibly shadow it. + <member name="debug/gdscript/warnings/shadowed_global_identifier" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when defining a local or subclass member variable, signal, or enum that would have the same name as a built-in function or global class name, which possibly shadow it. </member> - <member name="debug/gdscript/warnings/shadowed_variable" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable). + <member name="debug/gdscript/warnings/shadowed_variable" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable). </member> - <member name="debug/gdscript/warnings/shadowed_variable_base_class" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/shadowed_variable_base_class" type="int" setter="" getter="" default="1"> </member> - <member name="debug/gdscript/warnings/standalone_expression" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement. + <member name="debug/gdscript/warnings/standalone_expression" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement. </member> - <member name="debug/gdscript/warnings/standalone_ternary" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when calling a ternary expression that has no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement. + <member name="debug/gdscript/warnings/standalone_ternary" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when calling a ternary expression that has no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement. </member> <member name="debug/gdscript/warnings/treat_warnings_as_errors" type="bool" setter="" getter="" default="false"> If [code]true[/code], all warnings will be reported as if they were errors. </member> - <member name="debug/gdscript/warnings/unassigned_variable" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when using a variable that wasn't previously assigned. + <member name="debug/gdscript/warnings/unassigned_variable" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when using a variable that wasn't previously assigned. + </member> + <member name="debug/gdscript/warnings/unassigned_variable_op_assign" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when assigning a variable using an assignment operator like [code]+=[/code] if the variable wasn't previously assigned. </member> - <member name="debug/gdscript/warnings/unassigned_variable_op_assign" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when assigning a variable using an assignment operator like [code]+=[/code] if the variable wasn't previously assigned. + <member name="debug/gdscript/warnings/unreachable_code" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when unreachable code is detected (such as after a [code]return[/code] statement that will always be executed). </member> - <member name="debug/gdscript/warnings/unreachable_code" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when unreachable code is detected (such as after a [code]return[/code] statement that will always be executed). + <member name="debug/gdscript/warnings/unreachable_pattern" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when an unreachable [code]match[/code] pattern is detected. </member> - <member name="debug/gdscript/warnings/unreachable_pattern" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/unsafe_call_argument" type="int" setter="" getter="" default="0"> + If [code]enabled[/code], prints a warning or an error when using an expression whose type may not be compatible with the function parameter expected. </member> - <member name="debug/gdscript/warnings/unsafe_call_argument" type="bool" setter="" getter="" default="false"> - If [code]true[/code], enables warnings when using an expression whose type may not be compatible with the function parameter expected. + <member name="debug/gdscript/warnings/unsafe_cast" type="int" setter="" getter="" default="0"> + If [code]enabled[/code], prints a warning or an error when performing an unsafe cast. </member> - <member name="debug/gdscript/warnings/unsafe_cast" type="bool" setter="" getter="" default="false"> - If [code]true[/code], enables warnings when performing an unsafe cast. + <member name="debug/gdscript/warnings/unsafe_method_access" type="int" setter="" getter="" default="0"> + If [code]enabled[/code], prints a warning or an error when calling a method whose presence is not guaranteed at compile-time in the class. </member> - <member name="debug/gdscript/warnings/unsafe_method_access" type="bool" setter="" getter="" default="false"> - If [code]true[/code], enables warnings when calling a method whose presence is not guaranteed at compile-time in the class. + <member name="debug/gdscript/warnings/unsafe_property_access" type="int" setter="" getter="" default="0"> + If [code]enabled[/code], prints a warning or an error when accessing a property whose presence is not guaranteed at compile-time in the class. </member> - <member name="debug/gdscript/warnings/unsafe_property_access" type="bool" setter="" getter="" default="false"> - If [code]true[/code], enables warnings when accessing a property whose presence is not guaranteed at compile-time in the class. + <member name="debug/gdscript/warnings/unused_local_constant" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a local constant is never used. </member> - <member name="debug/gdscript/warnings/unused_local_constant" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/unused_parameter" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a function parameter is never used. </member> - <member name="debug/gdscript/warnings/unused_parameter" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/unused_private_class_variable" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a class variable is never used. </member> - <member name="debug/gdscript/warnings/unused_private_class_variable" type="bool" setter="" getter="" default="true"> + <member name="debug/gdscript/warnings/unused_signal" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a signal is unused. </member> - <member name="debug/gdscript/warnings/unused_signal" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when a signal is unused. + <member name="debug/gdscript/warnings/unused_variable" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when a local variable is unused. </member> - <member name="debug/gdscript/warnings/unused_variable" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when a local variable is unused. + <member name="debug/gdscript/warnings/void_assignment" type="int" setter="" getter="" default="1"> + If [code]enabled[/code], prints a warning or an error when assigning the result of a function that returns [code]void[/code] to a variable. </member> - <member name="debug/gdscript/warnings/void_assignment" type="bool" setter="" getter="" default="true"> - If [code]true[/code], enables warnings when assigning the result of a function that returns [code]void[/code] to a variable. + <member name="debug/settings/crash_handler/message" type="String" setter="" getter="" default=""Please include this when reporting the bug to the project developer.""> + Message to be displayed before the backtrace when the engine crashes. By default, this message is only used in exported projects due to the editor-only override applied to this setting. </member> - <member name="debug/settings/crash_handler/message" type="String" setter="" getter="" default=""Please include this when reporting the bug on https://github.com/godotengine/godot/issues""> - Message to be displayed before the backtrace when the engine crashes. + <member name="debug/settings/crash_handler/message.editor" type="String" setter="" getter="" default=""Please include this when reporting the bug on: https://github.com/godotengine/godot/issues""> + Editor-only override for [member debug/settings/crash_handler/message]. Does not affect exported projects in debug or release mode. </member> <member name="debug/settings/fps/force_fps" type="int" setter="" getter="" default="0"> Maximum number of frames per second allowed. The actual number of frames per second may still be below this value if the game is lagging. @@ -474,6 +497,12 @@ <member name="debug/shapes/navigation/geometry_color" type="Color" setter="" getter="" default="Color(0.1, 1, 0.7, 0.4)"> Color of the navigation geometry, visible when "Visible Navigation" is enabled in the Debug menu. </member> + <member name="debug/shapes/paths/geometry_color" type="Color" setter="" getter="" default="Color(0.1, 1, 0.7, 0.4)"> + Color of the curve path geometry, visible when "Visible Paths" is enabled in the Debug menu. + </member> + <member name="debug/shapes/paths/geometry_width" type="float" setter="" getter="" default="2.0"> + Line width of the curve path geometry, visible when "Visible Paths" is enabled in the Debug menu. + </member> <member name="display/mouse_cursor/custom_image" type="String" setter="" getter="" default=""""> Custom image for the mouse cursor (limited to 256×256). </member> @@ -533,6 +562,32 @@ 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. </member> + <member name="editor/movie_writer/disable_vsync" type="bool" setter="" getter="" default="false"> + If [code]true[/code], requests V-Sync to be disabled when writing a movie (similar to setting [member display/window/vsync/vsync_mode] to [b]Disabled[/b]). This can speed up video writing if the hardware is fast enough to render, encode and save the video at a framerate higher than the monitor's refresh rate. + [b]Note:[/b] [member editor/movie_writer/disable_vsync] has no effect if the operating system or graphics driver forces V-Sync with no way for applications to disable it. + </member> + <member name="editor/movie_writer/fps" type="int" setter="" getter="" default="60"> + The number of frames per second to record in the video when writing a movie. Simulation speed will adjust to always match the specified framerate, which means the engine will appear to run slower at higher [member editor/movie_writer/fps] values. Certain FPS values will require you to adjust [member editor/movie_writer/mix_rate] to prevent audio from desynchronizing over time. + This can be specified manually on the command line using the [code]--fixed-fps <fps>[/code] command line argument. + </member> + <member name="editor/movie_writer/mix_rate" type="int" setter="" getter="" default="48000"> + The audio mix rate to use in the recorded audio when writing a movie (in Hz). This can be different from [member audio/driver/mix_rate], but this value must be divisible by [member editor/movie_writer/fps] to prevent audio from desynchronizing over time. + </member> + <member name="editor/movie_writer/mjpeg_quality" type="float" setter="" getter="" default="0.75"> + The JPEG quality to use when writing a video to an AVI file, between [code]0.01[/code] and [code]1.0[/code] (inclusive). Higher [code]quality[/code] values result in better-looking output at the cost of larger file sizes. Recommended [code]quality[/code] values are between [code]0.75[/code] and [code]0.9[/code]. Even at quality [code]1.0[/code], JPEG compression remains lossy. + [b]Note:[/b] This does not affect the audio quality or writing PNG image sequences. + </member> + <member name="editor/movie_writer/movie_file" type="String" setter="" getter="" default=""""> + The output path for the movie. The file extension determines the [MovieWriter] that will be used. + Godot has 2 built-in [MovieWriter]s: + - AVI container with MJPEG for video and uncompressed audio ([code].avi[/code] file extension). Lossy compression, medium file sizes, fast encoding. The lossy compression quality can be adjusted by changing [member ProjectSettings.editor/movie_writer/mjpeg_quality]. The resulting file can be viewed in most video players, but it must be converted to another format for viewing on the web or by Godot with [VideoStreamPlayer]. MJPEG does not support transparency. AVI output is currently limited to a file of 4 GB in size at most. + - PNG image sequence for video and WAV for audio ([code].png[/code] file extension). Lossless compression, large file sizes, slow encoding. Designed to be encoded to a video file with another tool such as [url=https://ffmpeg.org/]FFmpeg[/url] after recording. Transparency is currently not supported, even if the root viewport is set to be transparent. + If you need to encode to a different format or pipe a stream through third-party software, you can extend this [MovieWriter] class to create your own movie writers. + When using PNG output, the frame number will be appended at the end of the file name. It starts from 0 and is padded with 8 digits to ensure correct sorting and easier processing. For example, if the output path is [code]/tmp/hello.png[/code], the first two frames will be [code]/tmp/hello00000000.png[/code] and [code]/tmp/hello00000001.png[/code]. The audio will be saved at [code]/tmp/hello.wav[/code]. + </member> + <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"> When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. </member> @@ -576,7 +631,7 @@ Path to a custom [Font] resource to use as default for all GUI elements of the project. </member> <member name="gui/theme/default_font_antialiased" type="bool" setter="" getter="" default="true"> - If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontData.antialiased]. + If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontFile.antialiased]. </member> <member name="gui/theme/default_font_generate_mipmaps" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will have mipmaps generated. This prevents text from looking grainy when a [Control] is scaled down, or when a [Label3D] is viewed from a long distance (if [member Label3D.texture_filter] is set to a mode that displays mipmaps). @@ -584,7 +639,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_hinting" type="int" setter="" getter="" default="1"> - Default font hinting mode. See [member FontData.hinting]. + Default font hinting mode. See [member FontFile.hinting]. </member> <member name="gui/theme/default_font_multichannel_signed_distance_field" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will use multichannel signed distance field (MSDF) for crisp rendering at any size. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). @@ -592,7 +647,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_subpixel_positioning" type="int" setter="" getter="" default="1"> - Default font glyph sub-pixel positioning mode. See [member FontData.subpixel_positioning]. + Default font glyph sub-pixel positioning mode. See [member FontFile.subpixel_positioning]. </member> <member name="gui/theme/default_theme_scale" type="float" setter="" getter="" default="1.0"> </member> @@ -803,6 +858,12 @@ <member name="internationalization/locale/test" type="String" setter="" getter="" default=""""> If non-empty, this locale will be used when running the project from the editor. </member> + <member name="internationalization/locale/translation_remaps" type="PackedStringArray" setter="" getter=""> + Locale-dependent resource remaps. Edit them in the "Localization" tab of Project Settings editor. + </member> + <member name="internationalization/locale/translations" type="PackedStringArray" setter="" getter=""> + List of translation files available in the project. Edit them in the "Localization" tab of Project Settings editor. + </member> <member name="internationalization/pseudolocalization/double_vowels" type="bool" setter="" getter="" default="false"> Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization. </member> @@ -1367,10 +1428,10 @@ <member name="navigation/2d/default_edge_connection_margin" type="int" setter="" getter="" default="1"> Default edge connection margin for 2D navigation maps. See [method NavigationServer2D.map_set_edge_connection_margin]. </member> - <member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.3"> + <member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.25"> Default cell size for 3D navigation maps. See [method NavigationServer3D.map_set_cell_size]. </member> - <member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="0.3"> + <member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="0.25"> Default edge connection margin for 3D navigation maps. See [method NavigationServer3D.map_set_edge_connection_margin]. </member> <member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768"> @@ -1576,6 +1637,10 @@ </member> <member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false"> </member> + <member name="rendering/anti_aliasing/quality/use_taa" type="bool" setter="" getter="" default="false"> + Enables Temporal Anti-Aliasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. + [b]Note:[/b] The implementation is not complete yet, some visual instances such as particles and skinned meshes may show artifacts. + </member> <member name="rendering/anti_aliasing/screen_space_roughness_limiter/amount" type="float" setter="" getter="" default="0.25"> </member> <member name="rendering/anti_aliasing/screen_space_roughness_limiter/enabled" type="bool" setter="" getter="" default="true"> @@ -1592,7 +1657,7 @@ If [code]true[/code], jitters DOF samples to make effect slightly blurrier and hide lines created from low sample rates. This can result in a slightly grainy appearance when used with a low number of samples. </member> <member name="rendering/driver/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default=""PowerVR,Mali,Adreno,Apple""> - Disables [member rendering/driver/depth_prepass/enable] conditionally for certain venders. By default, disables the depth prepass for mobile devices as mobile devices do not benefit from the depth prepass due to their unique architecture. + Disables [member rendering/driver/depth_prepass/enable] conditionally for certain vendors. By default, disables the depth prepass for mobile devices as mobile devices do not benefit from the depth prepass due to their unique architecture. </member> <member name="rendering/driver/depth_prepass/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], performs a previous depth pass before rendering 3D materials. This increases performance significantly in scenes with high overdraw, when complex materials and lighting are used. However, in scenes with few occluded surfaces, the depth prepass may reduce performance. If your game is viewed from a fixed angle that makes it easy to avoid overdraw (such as top-down or side-scrolling perspective), consider disabling the depth prepass to improve performance. This setting can be changed at run-time to optimize performance depending on the scene currently being viewed. @@ -1693,28 +1758,40 @@ <member name="rendering/global_illumination/voxel_gi/quality" type="int" setter="" getter="" default="0"> </member> <member name="rendering/lightmapping/bake_performance/max_rays_per_pass" type="int" setter="" getter="" default="32"> + The maximum number of rays that can be thrown per pass when baking lightmaps with [LightmapGI]. Depending on the scene, adjusting this value may result in higher GPU utilization when baking lightmaps, leading to faster bake times. </member> <member name="rendering/lightmapping/bake_performance/max_rays_per_probe_pass" type="int" setter="" getter="" default="64"> + The maximum number of rays that can be thrown per pass when baking dynamic object lighting in [LightmapProbe]s with [LightmapGI]. Depending on the scene, adjusting this value may result in higher GPU utilization when baking lightmaps, leading to faster bake times. </member> <member name="rendering/lightmapping/bake_performance/region_size" type="int" setter="" getter="" default="512"> + The region size to use when baking lightmaps with [LightmapGI]. </member> <member name="rendering/lightmapping/bake_quality/high_quality_probe_ray_count" type="int" setter="" getter="" default="512"> + The number of rays to use for baking dynamic object lighting in [LightmapProbe]s when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_HIGH]. </member> <member name="rendering/lightmapping/bake_quality/high_quality_ray_count" type="int" setter="" getter="" default="256"> + The number of rays to use for baking lightmaps with [LightmapGI] when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_HIGH]. </member> <member name="rendering/lightmapping/bake_quality/low_quality_probe_ray_count" type="int" setter="" getter="" default="64"> + The number of rays to use for baking dynamic object lighting in [LightmapProbe]s when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_LOW]. </member> <member name="rendering/lightmapping/bake_quality/low_quality_ray_count" type="int" setter="" getter="" default="16"> + The number of rays to use for baking lightmaps with [LightmapGI] when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_LOW]. </member> <member name="rendering/lightmapping/bake_quality/medium_quality_probe_ray_count" type="int" setter="" getter="" default="256"> + The number of rays to use for baking dynamic object lighting in [LightmapProbe]s when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_MEDIUM]. </member> <member name="rendering/lightmapping/bake_quality/medium_quality_ray_count" type="int" setter="" getter="" default="64"> + The number of rays to use for baking lightmaps with [LightmapGI] when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_MEDIUM]. </member> <member name="rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count" type="int" setter="" getter="" default="2048"> + The number of rays to use for baking dynamic object lighting in [LightmapProbe]s when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_ULTRA]. </member> <member name="rendering/lightmapping/bake_quality/ultra_quality_ray_count" type="int" setter="" getter="" default="1024"> + The number of rays to use for baking lightmaps with [LightmapGI] when [member LightmapGI.quality] is [constant LightmapGI.BAKE_QUALITY_ULTRA]. </member> <member name="rendering/lightmapping/probe_capture/update_speed" type="float" setter="" getter="" default="15"> + The framerate-independent update speed when representing dynamic object lighting from [LightmapProbe]s. Higher values make dynamic object lighting update faster. Higher values can prevent fast-moving objects from having "outdated" indirect lighting displayed on them, at the cost of possible flickering when an object moves from a bright area to a shaded area. </member> <member name="rendering/limits/cluster_builder/max_clustered_elements" type="float" setter="" getter="" default="512"> </member> @@ -1723,13 +1800,13 @@ <member name="rendering/limits/global_shader_variables/buffer_size" type="int" setter="" getter="" default="65536"> </member> <member name="rendering/limits/opengl/max_lights_per_object" type="int" setter="" getter="" default="8"> - Max number of lights renderable per object. This is further limited by hardware support. Setting this low will slightly reduce memory usage, may decrease shader compile times, and may result in faster rendering on low-end, mobile, or web devices. + Max number of omnilights and spotlights renderable per object. At the default value of 8, this means that each surface can be affected by up to 8 omnilights and 8 spotlights. This is further limited by hardware support and [member rendering/limits/opengl/max_renderable_lights]. Setting this low will slightly reduce memory usage, may decrease shader compile times, and may result in faster rendering on low-end, mobile, or web devices. </member> <member name="rendering/limits/opengl/max_renderable_elements" type="int" setter="" getter="" default="65536"> Max amount of elements renderable in a frame. If more elements than this are visible per frame, they will not be drawn. Keep in mind elements refer to mesh surfaces and not meshes themselves. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. </member> - <member name="rendering/limits/opengl/max_renderable_lights" type="int" setter="" getter="" default="256"> - Max number of lights renderable in a frame. If more lights than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. + <member name="rendering/limits/opengl/max_renderable_lights" type="int" setter="" getter="" default="32"> + Max number of positional lights renderable in a frame. If more lights than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. </member> <member name="rendering/limits/spatial_indexer/threaded_cull_minimum_instances" type="int" setter="" getter="" default="1000"> </member> @@ -1821,41 +1898,41 @@ <member name="rendering/shadows/directional_shadow/size.mobile" type="int" setter="" getter="" default="2048"> Lower-end override for [member rendering/shadows/directional_shadow/size] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/shadows/directional_shadow/soft_shadow_quality" type="int" setter="" getter="" default="2"> + <member name="rendering/shadows/directional_shadow/soft_shadow_filter_quality" type="int" setter="" getter="" default="2"> Quality setting for shadows cast by [DirectionalLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. [b]Note:[/b] The Soft Very Low setting will automatically multiply [i]constant[/i] shadow blur by 0.75x to reduce the amount of noise visible. This automatic blur change only affects the constant blur factor defined in [member Light3D.shadow_blur], not the variable blur performed by [DirectionalLight3D]s' [member Light3D.light_angular_distance]. [b]Note:[/b] The Soft High and Soft Ultra settings will automatically multiply [i]constant[/i] shadow blur by 1.5× and 2× respectively to make better use of the increased sample count. This increased blur also improves stability of dynamic object shadows. </member> - <member name="rendering/shadows/directional_shadow/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> - Lower-end override for [member rendering/shadows/directional_shadow/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. + <member name="rendering/shadows/directional_shadow/soft_shadow_filter_quality.mobile" type="int" setter="" getter="" default="0"> + Lower-end override for [member rendering/shadows/directional_shadow/soft_shadow_filter_quality] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/shadows/shadow_atlas/16_bits" type="bool" setter="" getter="" default="true"> + <member name="rendering/shadows/positional_shadow/atlas_16_bits" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/shadows/shadow_atlas/quadrant_0_subdiv" type="int" setter="" getter="" default="2"> + <member name="rendering/shadows/positional_shadow/atlas_quadrant_0_subdiv" type="int" setter="" getter="" default="2"> Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/shadows/shadow_atlas/quadrant_1_subdiv" type="int" setter="" getter="" default="2"> + <member name="rendering/shadows/positional_shadow/atlas_quadrant_1_subdiv" type="int" setter="" getter="" default="2"> Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/shadows/shadow_atlas/quadrant_2_subdiv" type="int" setter="" getter="" default="3"> + <member name="rendering/shadows/positional_shadow/atlas_quadrant_2_subdiv" type="int" setter="" getter="" default="3"> Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/shadows/shadow_atlas/quadrant_3_subdiv" type="int" setter="" getter="" default="4"> + <member name="rendering/shadows/positional_shadow/atlas_quadrant_3_subdiv" type="int" setter="" getter="" default="4"> Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/shadows/shadow_atlas/size" type="int" setter="" getter="" default="4096"> + <member name="rendering/shadows/positional_shadow/atlas_size" type="int" setter="" getter="" default="4096"> Size for shadow atlas (used for OmniLights and SpotLights). See documentation. </member> - <member name="rendering/shadows/shadow_atlas/size.mobile" type="int" setter="" getter="" default="2048"> - Lower-end override for [member rendering/shadows/shadow_atlas/size] on mobile devices, due to performance concerns or driver support. + <member name="rendering/shadows/positional_shadow/atlas_size.mobile" type="int" setter="" getter="" default="2048"> + Lower-end override for [member rendering/shadows/positional_shadow/atlas_size] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/shadows/shadows/soft_shadow_quality" type="int" setter="" getter="" default="2"> + <member name="rendering/shadows/positional_shadow/soft_shadow_filter_quality" type="int" setter="" getter="" default="2"> Quality setting for shadows cast by [OmniLight3D]s and [SpotLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. [b]Note:[/b] The Soft Very Low setting will automatically multiply [i]constant[/i] shadow blur by 0.75x to reduce the amount of noise visible. This automatic blur change only affects the constant blur factor defined in [member Light3D.shadow_blur], not the variable blur performed by [DirectionalLight3D]s' [member Light3D.light_angular_distance]. [b]Note:[/b] The Soft High and Soft Ultra settings will automatically multiply shadow blur by 1.5× and 2× respectively to make better use of the increased sample count. This increased blur also improves stability of dynamic object shadows. </member> - <member name="rendering/shadows/shadows/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> - Lower-end override for [member rendering/shadows/shadows/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. + <member name="rendering/shadows/positional_shadow/soft_shadow_filter_quality.mobile" type="int" setter="" getter="" default="0"> + Lower-end override for [member rendering/shadows/positional_shadow/soft_shadow_filter_quality] on mobile devices, due to performance concerns or driver support. </member> <member name="rendering/textures/decals/filter" type="int" setter="" getter="" default="3"> </member> @@ -1891,6 +1968,12 @@ If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. [b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]). </member> + <member name="rendering/vrs/mode" type="int" setter="" getter="" default="0"> + Set the default Variable Rate Shading (VRS) mode for the main viewport. See [member Viewport.vrs_mode] to change this at runtime, and [enum Viewport.VRSMode] for possible values. + </member> + <member name="rendering/vrs/texture" type="String" setter="" getter="" default=""""> + If [member rendering/vrs/mode] is set to texture, this is the path to default texture loaded as the VRS image. + </member> <member name="rendering/vulkan/descriptor_pools/max_descriptors_per_pool" type="int" setter="" getter="" default="64"> </member> <member name="rendering/vulkan/rendering/back_end" type="int" setter="" getter="" default="0"> diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index df6efd155a..22793e75d8 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -4,7 +4,7 @@ Abstract base class for range-based controls. </brief_description> <description> - Range is a base class for [Control] nodes that change a floating-point [i]value[/i] between a [i]minimum[/i] and a [i]maximum[/i], using [i]step[/i] and [i]page[/i], for example a [ScrollBar]. + Range is a base class for [Control] nodes that change a floating-point [member value] between a [member min_value] and [member max_value], using a configured [member step] and [member page] size. See e.g. [ScrollBar] and [Slider] for examples of higher level nodes using Range. </description> <tutorials> </tutorials> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 0d121a29d2..6248394b1a 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -395,7 +395,7 @@ <description> </description> </method> - <method name="limit_get"> + <method name="limit_get" qualifiers="const"> <return type="int" /> <argument index="0" name="limit" type="int" enum="RenderingDevice.Limit" /> <description> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index b8f26f75c9..6199c7b4e6 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -890,7 +890,7 @@ <description> </description> </method> - <method name="directional_shadow_quality_set"> + <method name="directional_soft_shadow_filter_set_quality"> <return type="void" /> <argument index="0" name="quality" type="int" enum="RenderingServer.ShadowQuality" /> <description> @@ -1186,7 +1186,7 @@ <argument index="0" name="fog_volume" type="RID" /> <argument index="1" name="extents" type="Vector3" /> <description> - Sets the size of the fog volume when shape is [constant FOG_VOLUME_SHAPE_ELLIPSOID] or [constant FOG_VOLUME_SHAPE_BOX]. + Sets the size of the fog volume when shape is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. </description> </method> <method name="fog_volume_set_material"> @@ -1202,7 +1202,7 @@ <argument index="0" name="fog_volume" type="RID" /> <argument index="1" name="shape" type="int" enum="RenderingServer.FogVolumeShape" /> <description> - Sets the shape of the fog volume to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX], or [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. + Sets the shape of the fog volume to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. </description> </method> <method name="force_draw"> @@ -2519,6 +2519,12 @@ If [code]true[/code], particles use local coordinates. If [code]false[/code] they use global coordinates. Equivalent to [member GPUParticles3D.local_coords]. </description> </method> + <method name="positional_soft_shadow_filter_set_quality"> + <return type="void" /> + <argument index="0" name="quality" type="int" enum="RenderingServer.ShadowQuality" /> + <description> + </description> + </method> <method name="reflection_probe_create"> <return type="RID" /> <description> @@ -2753,12 +2759,6 @@ [b]Note:[/b] If the sampler array is used use [code]index[/code] to access the specified texture. </description> </method> - <method name="shadows_quality_set"> - <return type="void" /> - <argument index="0" name="quality" type="int" enum="RenderingServer.ShadowQuality" /> - <description> - </description> - </method> <method name="skeleton_allocate_data"> <return type="void" /> <argument index="0" name="skeleton" type="RID" /> @@ -3035,7 +3035,7 @@ $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) [/gdscript] [/codeblocks] - Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, [method viewport_set_render_direct_to_screen]. + Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For further optimization, see [method viewport_set_render_direct_to_screen]. </description> </method> <method name="viewport_create"> @@ -3220,6 +3220,25 @@ Sets the viewport's parent to another viewport. </description> </method> + <method name="viewport_set_positional_shadow_atlas_quadrant_subdivision"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="quadrant" type="int" /> + <argument index="2" name="subdivision" type="int" /> + <description> + Sets the shadow atlas quadrant's subdivision. + </description> + </method> + <method name="viewport_set_positional_shadow_atlas_size"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="use_16_bits" type="bool" default="false" /> + <description> + Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2. + [b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at all (including directional shadows). + </description> + </method> <method name="viewport_set_render_direct_to_screen"> <return type="void" /> <argument index="0" name="viewport" type="RID" /> @@ -3269,24 +3288,6 @@ <description> </description> </method> - <method name="viewport_set_shadow_atlas_quadrant_subdivision"> - <return type="void" /> - <argument index="0" name="viewport" type="RID" /> - <argument index="1" name="quadrant" type="int" /> - <argument index="2" name="subdivision" type="int" /> - <description> - Sets the shadow atlas quadrant's subdivision. - </description> - </method> - <method name="viewport_set_shadow_atlas_size"> - <return type="void" /> - <argument index="0" name="viewport" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="use_16_bits" type="bool" default="false" /> - <description> - Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2. - </description> - </method> <method name="viewport_set_size"> <return type="void" /> <argument index="0" name="viewport" type="RID" /> @@ -3340,6 +3341,14 @@ <description> </description> </method> + <method name="viewport_set_use_taa"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="enable" type="bool" /> + <description> + If [code]true[/code], use Temporal Anti-Aliasing. + </description> + </method> <method name="viewport_set_use_xr"> <return type="void" /> <argument index="0" name="viewport" type="RID" /> @@ -3348,6 +3357,22 @@ If [code]true[/code], the viewport uses augmented or virtual reality technologies. See [XRInterface]. </description> </method> + <method name="viewport_set_vrs_mode"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="mode" type="int" enum="RenderingServer.ViewportVRSMode" /> + <description> + Sets the Variable Rate Shading (VRS) mode for the viewport. Note, if hardware does not support VRS this property is ignored. + </description> + </method> + <method name="viewport_set_vrs_texture"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="texture" type="RID" /> + <description> + Texture to use when the VRS mode is set to [constant RenderingServer.VIEWPORT_VRS_TEXTURE]. + </description> + </method> <method name="visibility_notifier_create"> <return type="RID" /> <description> @@ -3931,14 +3956,22 @@ <constant name="PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX" value="6" enum="ParticlesCollisionHeightfieldResolution"> </constant> <constant name="FOG_VOLUME_SHAPE_ELLIPSOID" value="0" enum="FogVolumeShape"> - [FogVolume] will be shaped like an ellipsoid. + [FogVolume] will be shaped like an ellipsoid (stretched sphere). </constant> - <constant name="FOG_VOLUME_SHAPE_BOX" value="1" enum="FogVolumeShape"> + <constant name="FOG_VOLUME_SHAPE_CONE" value="1" enum="FogVolumeShape"> + [FogVolume] will be shaped like a cone pointing upwards (in local coordinates). The cone's angle is set automatically to fill the extents. The cone will be adjusted to fit within the extents. Rotate the [FogVolume] node to reorient the cone. Non-uniform scaling via extents is not supported (scale the [FogVolume] node instead). + </constant> + <constant name="FOG_VOLUME_SHAPE_CYLINDER" value="2" enum="FogVolumeShape"> + [FogVolume] will be shaped like an upright cylinder (in local coordinates). Rotate the [FogVolume] node to reorient the cylinder. The cylinder will be adjusted to fit within the extents. Non-uniform scaling via extents is not supported (scale the [FogVolume] node instead). + </constant> + <constant name="FOG_VOLUME_SHAPE_BOX" value="3" enum="FogVolumeShape"> [FogVolume] will be shaped like a box. </constant> - <constant name="FOG_VOLUME_SHAPE_WORLD" value="2" enum="FogVolumeShape"> + <constant name="FOG_VOLUME_SHAPE_WORLD" value="4" enum="FogVolumeShape"> [FogVolume] will have no shape, will cover the whole world and will not be culled. </constant> + <constant name="FOG_VOLUME_SHAPE_MAX" value="5" enum="FogVolumeShape"> + </constant> <constant name="VIEWPORT_SCALING_3D_MODE_BILINEAR" value="0" enum="ViewportScaling3DMode"> Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. </constant> @@ -4097,6 +4130,20 @@ </constant> <constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="24" enum="ViewportDebugDraw"> </constant> + <constant name="VIEWPORT_DEBUG_DRAW_MOTION_VECTORS" value="25" enum="ViewportDebugDraw"> + </constant> + <constant name="VIEWPORT_VRS_DISABLED" value="0" enum="ViewportVRSMode"> + VRS is disabled. + </constant> + <constant name="VIEWPORT_VRS_TEXTURE" value="1" enum="ViewportVRSMode"> + VRS uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. + </constant> + <constant name="VIEWPORT_VRS_XR" value="2" enum="ViewportVRSMode"> + VRS texture is supplied by the primary [XRInterface]. + </constant> + <constant name="VIEWPORT_VRS_MAX" value="3" enum="ViewportVRSMode"> + Represents the size of the [enum ViewportVRSMode] enum. + </constant> <constant name="SKY_MODE_AUTOMATIC" value="0" enum="SkyMode"> </constant> <constant name="SKY_MODE_QUALITY" value="1" enum="SkyMode"> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 1ffb0dba5c..d6e9a233b0 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -11,6 +11,15 @@ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> <methods> + <method name="add_resource_format_loader"> + <return type="void" /> + <argument index="0" name="format_loader" type="ResourceFormatLoader" /> + <argument index="1" name="at_front" type="bool" default="false" /> + <description> + Registers a new [ResourceFormatLoader]. The ResourceLoader will use the ResourceFormatLoader as described in [method load]. + This method is performed implictly for ResourceFormatLoaders written in GDScript (see [ResourceFormatLoader] for more information). + </description> + </method> <method name="exists"> <return type="bool" /> <argument index="0" name="path" type="String" /> @@ -89,6 +98,13 @@ Loads the resource using threads. If [code]use_sub_threads[/code] is [code]true[/code], multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns). </description> </method> + <method name="remove_resource_format_loader"> + <return type="void" /> + <argument index="0" name="format_loader" type="ResourceFormatLoader" /> + <description> + Unregisters the given [ResourceFormatLoader]. + </description> + </method> <method name="set_abort_on_missing_resources"> <return type="void" /> <argument index="0" name="abort" type="bool" /> diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml index a029fb9acf..213d8c585a 100644 --- a/doc/classes/ResourceSaver.xml +++ b/doc/classes/ResourceSaver.xml @@ -10,6 +10,15 @@ <tutorials> </tutorials> <methods> + <method name="add_resource_format_saver"> + <return type="void" /> + <argument index="0" name="format_saver" type="ResourceFormatSaver" /> + <argument index="1" name="at_front" type="bool" default="false" /> + <description> + Registers a new [ResourceFormatSaver]. The ResourceSaver will use the ResourceFormatSaver as described in [method save]. + This method is performed implictly for ResourceFormatSavers written in GDScript (see [ResourceFormatSaver] for more information). + </description> + </method> <method name="get_recognized_extensions"> <return type="PackedStringArray" /> <argument index="0" name="type" type="Resource" /> @@ -17,11 +26,18 @@ Returns the list of extensions available for saving a resource of a given type. </description> </method> + <method name="remove_resource_format_saver"> + <return type="void" /> + <argument index="0" name="format_saver" type="ResourceFormatSaver" /> + <description> + Unregisters the given [ResourceFormatSaver]. + </description> + </method> <method name="save"> <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <argument index="1" name="resource" type="Resource" /> - <argument index="2" name="flags" type="int" default="0" /> + <argument index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" default="0" /> <description> Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. The [code]flags[/code] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. @@ -30,28 +46,28 @@ </method> </methods> <constants> - <constant name="FLAG_NONE" value="0" enum="SaverFlags"> + <constant name="FLAG_NONE" value="0" enum="SaverFlags" is_bitfield="true"> No resource saving option. </constant> - <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags"> + <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags" is_bitfield="true"> Save the resource with a path relative to the scene which uses it. </constant> - <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags"> + <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags" is_bitfield="true"> Bundles external resources. </constant> - <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags"> + <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags" is_bitfield="true"> Changes the [member Resource.resource_path] of the saved resource to match its new location. </constant> - <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags"> + <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags" is_bitfield="true"> Do not save editor-specific metadata (identified by their [code]__editor[/code] prefix). </constant> - <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags"> + <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags" is_bitfield="true"> Save as big endian (see [member File.big_endian]). </constant> - <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags"> + <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags" is_bitfield="true"> Compress the resource on save using [constant File.COMPRESSION_ZSTD]. Only available for binary resource types. </constant> - <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags"> + <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags" is_bitfield="true"> Take over the paths of the saved subresources (see [method Resource.take_over_path]). </constant> </constants> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 62a692d4a7..3c9e9b1bfc 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -60,6 +60,7 @@ <argument index="0" name="character" type="int" /> <description> Returns the line number of the character position provided. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_character_paragraph"> @@ -67,24 +68,28 @@ <argument index="0" name="character" type="int" /> <description> Returns the paragraph number of the character position provided. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_content_height" qualifiers="const"> <return type="int" /> <description> Returns the height of the content. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_content_width" qualifiers="const"> <return type="int" /> <description> Returns the width of the content. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_line_count" qualifiers="const"> <return type="int" /> <description> Returns the total number of lines in the text. Wrapped text is counted as multiple lines. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_line_offset"> @@ -92,6 +97,7 @@ <argument index="0" name="line" type="int" /> <description> Returns the vertical offset of the line found at the provided index. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_menu" qualifiers="const"> @@ -112,6 +118,7 @@ <argument index="0" name="paragraph" type="int" /> <description> Returns the vertical offset of the paragraph found at the provided index. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_parsed_text" qualifiers="const"> @@ -155,12 +162,14 @@ <return type="int" /> <description> Returns the number of visible lines. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="get_visible_paragraph_count" qualifiers="const"> <return type="int" /> <description> Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible. + [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. </description> </method> <method name="install_effect"> @@ -176,6 +185,12 @@ Returns whether the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided). </description> </method> + <method name="is_ready" qualifiers="const"> + <return type="bool" /> + <description> + If [member threaded] is enabled, returns [code]true[/code] if the background thread has finished text processing, otherwise always return [code]true[/code]. + </description> + </method> <method name="newline"> <return type="void" /> <description> @@ -261,18 +276,10 @@ Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration. </description> </method> - <method name="push_font_features"> - <return type="void" /> - <argument index="0" name="opentype_features" type="Dictionary" /> - <description> - Adds a [code][ot_feature][/code] tag to the tag stack. Overrides default OpenType font feature for its duration. - </description> - </method> <method name="push_font_size"> <return type="void" /> <argument index="0" name="font_size" type="int" /> <description> - Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. </description> </method> <method name="push_hint"> @@ -439,8 +446,8 @@ </method> </methods> <members> - <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="RichTextLabel.AutowrapMode" default="3"> - If set to something other than [constant AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. To see how each mode behaves, see [enum AutowrapMode]. + <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="3"> + If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. To see how each mode behaves, see [enum TextServer.AutowrapMode]. </member> <member name="bbcode_enabled" type="bool" setter="set_use_bbcode" getter="is_using_bbcode" default="false"> If [code]true[/code], the label uses BBCode formatting. @@ -476,6 +483,10 @@ The range of characters to display, as a [float] between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0. [b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count]. </member> + <member name="progress_bar_delay" type="int" setter="set_progress_bar_delay" getter="get_progress_bar_delay" default="1000"> + The delay after which the loading progress bar is displayed, in milliseconds. Set to [code]-1[/code] to disable progress bar entirely. + [b]Note:[/b] Progress bar is displayed only if [member threaded] is enabled. + </member> <member name="scroll_active" type="bool" setter="set_scroll_active" getter="is_scroll_active" default="true"> If [code]true[/code], the scrollbar is visible. Setting this to [code]false[/code] does not block scrolling completely. See [method scroll_to_line]. </member> @@ -504,15 +515,23 @@ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> Base text writing direction. </member> + <member name="threaded" type="bool" setter="set_threaded" getter="is_threaded" default="false"> + If [code]true[/code], text processing is done in a background thread. + </member> <member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1"> The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed. [b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count]. </member> - <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="RichTextLabel.VisibleCharactersBehavior" default="0"> - Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info. + <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="TextServer.VisibleCharactersBehavior" default="0"> + Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. </member> </members> <signals> + <signal name="finished"> + <description> + Triggered when the document is fully loaded. + </description> + </signal> <signal name="meta_clicked"> <argument index="0" name="meta" type="Variant" /> <description> @@ -533,18 +552,6 @@ </signal> </signals> <constants> - <constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode"> - Autowrap is disabled. - </constant> - <constant name="AUTOWRAP_ARBITRARY" value="1" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available. - </constant> - <constant name="AUTOWRAP_WORD" value="2" enum="AutowrapMode"> - Wraps the text inside the node's bounding rectangle by soft-breaking between words. - </constant> - <constant name="AUTOWRAP_WORD_SMART" value="3" enum="AutowrapMode"> - Behaves similarly to [constant AUTOWRAP_WORD], but force-breaks a word if that single word does not fit in one line. - </constant> <constant name="LIST_NUMBERS" value="0" enum="ListType"> Each list item has a number marker. </constant> @@ -611,21 +618,6 @@ </constant> <constant name="ITEM_CUSTOMFX" value="26" enum="ItemType"> </constant> - <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> - Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text. - </constant> - <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior"> - Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text. - </constant> - <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. - </constant> - <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the left. - </constant> - <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the right. - </constant> </constants> <theme_items> <theme_item name="default_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> diff --git a/doc/classes/SceneReplicationConfig.xml b/doc/classes/SceneReplicationConfig.xml index aade8ac3be..62c108a477 100644 --- a/doc/classes/SceneReplicationConfig.xml +++ b/doc/classes/SceneReplicationConfig.xml @@ -19,6 +19,12 @@ <description> </description> </method> + <method name="has_property" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="path" type="NodePath" /> + <description> + </description> + </method> <method name="property_get_index" qualifiers="const"> <return type="int" /> <argument index="0" name="path" type="NodePath" /> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index 3cd2ab0903..cf6ab977db 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -177,14 +177,6 @@ Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] was defined yet, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated. </description> </method> - <method name="set_auto_accept_quit"> - <return type="void" /> - <argument index="0" name="enabled" type="bool" /> - <description> - If [code]true[/code], the application automatically accepts quitting. Enabled by default. - For mobile platforms, see [method set_quit_on_go_back]. - </description> - </method> <method name="set_group"> <return type="void" /> <argument index="0" name="group" type="StringName" /> @@ -214,16 +206,12 @@ Sets a custom [MultiplayerAPI] with the given [code]root_path[/code] (controlling also the relative subpaths), or override the default one if [code]root_path[/code] is empty. </description> </method> - <method name="set_quit_on_go_back"> - <return type="void" /> - <argument index="0" name="enabled" type="bool" /> - <description> - If [code]true[/code], the application quits automatically on going back (e.g. on Android). Enabled by default. - To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. - </description> - </method> </methods> <members> + <member name="auto_accept_quit" type="bool" setter="set_auto_accept_quit" getter="is_auto_accept_quit" default="true"> + If [code]true[/code], the application automatically accepts quitting. + For mobile platforms, see [member quit_on_go_back]. + </member> <member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene"> The current scene. </member> @@ -233,6 +221,9 @@ <member name="debug_navigation_hint" type="bool" setter="set_debug_navigation_hint" getter="is_debugging_navigation_hint" default="false"> If [code]true[/code], navigation polygons will be visible when running the game from the editor for debugging purposes. </member> + <member name="debug_paths_hint" type="bool" setter="set_debug_paths_hint" getter="is_debugging_paths_hint" default="false"> + If [code]true[/code], curves from [Path2D] and [Path3D] nodes will be visible when running the game from the editor for debugging purposes. + </member> <member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root"> The root of the edited scene. </member> @@ -245,6 +236,10 @@ - 2D and 3D physics will be stopped. This includes signals and collision detection. - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes. </member> + <member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true"> + If [code]true[/code], the application quits automatically on going back (e.g. on Android). + To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. + </member> <member name="root" type="Window" setter="" getter="get_root"> The [SceneTree]'s root [Window]. </member> diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml index 427608ead3..f28e65c5bf 100644 --- a/doc/classes/SceneTreeTimer.xml +++ b/doc/classes/SceneTreeTimer.xml @@ -22,7 +22,7 @@ } [/csharp] [/codeblocks] - The timer will be automatically freed after its time elapses. + The timer will be dereferenced after its time elapses. To preserve the timer, you can keep a reference to it. See [RefCounted]. </description> <tutorials> </tutorials> diff --git a/doc/classes/ScriptCreateDialog.xml b/doc/classes/ScriptCreateDialog.xml index e21fac2d32..79ee95719d 100644 --- a/doc/classes/ScriptCreateDialog.xml +++ b/doc/classes/ScriptCreateDialog.xml @@ -40,6 +40,7 @@ </methods> <members> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> + <member name="ok_button_text" type="String" setter="set_ok_button_text" getter="get_ok_button_text" overrides="AcceptDialog" default=""Create"" /> <member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default=""Attach Node Script"" /> </members> <signals> diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml index 0f757cf806..45d4cf44fa 100644 --- a/doc/classes/ScriptLanguageExtension.xml +++ b/doc/classes/ScriptLanguageExtension.xml @@ -174,6 +174,11 @@ <description> </description> </method> + <method name="_get_public_annotations" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> <method name="_get_public_constants" qualifiers="virtual const"> <return type="Dictionary" /> <description> @@ -378,7 +383,9 @@ </constant> <constant name="LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE" value="7" enum="LookupResultType"> </constant> - <constant name="LOOKUP_RESULT_MAX" value="8" enum="LookupResultType"> + <constant name="LOOKUP_RESULT_CLASS_ANNOTATION" value="8" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_MAX" value="9" enum="LookupResultType"> </constant> <constant name="LOCATION_LOCAL" value="0" enum="CodeCompletionLocation"> The option is local to the location of the code completion query - e.g. a local variable. diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 658793c4c0..1bbf5cb91b 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -5,7 +5,7 @@ </brief_description> <description> A ScrollContainer node meant to contain a [Control] child. - ScrollContainers will automatically create a scrollbar child ([HScrollBar], [VScrollBar], or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [member Control.minimum_size] of the Control relative to the ScrollContainer. + ScrollContainers will automatically create a scrollbar child ([HScrollBar], [VScrollBar], or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [member Control.custom_minimum_size] of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set [code]EXPAND[/code] on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). </description> <tutorials> diff --git a/doc/classes/SkeletonProfile.xml b/doc/classes/SkeletonProfile.xml new file mode 100644 index 0000000000..a7f5f7a0a6 --- /dev/null +++ b/doc/classes/SkeletonProfile.xml @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonProfile" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Profile of a virtual skeleton used as a target for retargeting. + </brief_description> + <description> + This resource is used in [EditorScenePostImport]. Some parameters are referring to bones in [Skeleton3D], [Skin], [Animation], and some other nodes are rewritten based on the parameters of [SkeletonProfile]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="find_bone" qualifiers="const"> + <return type="int" /> + <argument index="0" name="bone_name" type="StringName" /> + <description> + Returns the bone index that matches [code]bone_name[/code] as its name. + </description> + </method> + <method name="get_bone_name" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the name of the bone at [code]bone_idx[/code] that will be the key name in the [BoneMap]. + In the retargeting process, the returned bone name is the bone name of the target skeleton. + </description> + </method> + <method name="get_bone_parent" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the name of the bone which is the parent to the bone at [code]bone_idx[/code]. The result is empty if the bone has no parent. + </description> + </method> + <method name="get_bone_tail" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the name of the bone which is the tail of the bone at [code]bone_idx[/code]. + </description> + </method> + <method name="get_group" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the group of the bone at [code]bone_idx[/code]. + </description> + </method> + <method name="get_group_name" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="group_idx" type="int" /> + <description> + Returns the name of the group at [code]group_idx[/code] that will be the drawing group in the [BoneMap] editor. + </description> + </method> + <method name="get_handle_offset" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the offset of the bone at [code]bone_idx[/code] that will be the button position in the [BoneMap] editor. + This is the offset with origin at the top left corner of the square. + </description> + </method> + <method name="get_reference_pose" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the reference pose transform for bone [code]bone_idx[/code]. + </description> + </method> + <method name="get_tail_direction" qualifiers="const"> + <return type="int" enum="SkeletonProfile.TailDirection" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the tail direction of the bone at [code]bone_idx[/code]. + </description> + </method> + <method name="get_texture" qualifiers="const"> + <return type="Texture2D" /> + <argument index="0" name="group_idx" type="int" /> + <description> + Returns the texture of the group at [code]group_idx[/code] that will be the drawing group background image in the [BoneMap] editor. + </description> + </method> + <method name="set_bone_name"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="bone_name" type="StringName" /> + <description> + Sets the name of the bone at [code]bone_idx[/code] that will be the key name in the [BoneMap]. + In the retargeting process, the setting bone name is the bone name of the target skeleton. + </description> + </method> + <method name="set_bone_parent"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="bone_parent" type="StringName" /> + <description> + Sets the bone with name [code]bone_parent[/code] as the parent of the bone at [code]bone_idx[/code]. If an empty string is passed, then the bone has no parent. + </description> + </method> + <method name="set_bone_tail"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="bone_tail" type="StringName" /> + <description> + Sets the bone with name [code]bone_tail[/code] as the tail of the bone at [code]bone_idx[/code]. + </description> + </method> + <method name="set_group"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="group" type="StringName" /> + <description> + Sets the group of the bone at [code]bone_idx[/code]. + </description> + </method> + <method name="set_group_name"> + <return type="void" /> + <argument index="0" name="group_idx" type="int" /> + <argument index="1" name="group_name" type="StringName" /> + <description> + Sets the name of the group at [code]group_idx[/code] that will be the drawing group in the [BoneMap] editor. + </description> + </method> + <method name="set_handle_offset"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="handle_offset" type="Vector2" /> + <description> + Sets the offset of the bone at [code]bone_idx[/code] that will be the button position in the [BoneMap] editor. + This is the offset with origin at the top left corner of the square. + </description> + </method> + <method name="set_reference_pose"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="bone_name" type="Transform3D" /> + <description> + Sets the reference pose transform for bone [code]bone_idx[/code]. + </description> + </method> + <method name="set_tail_direction"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="tail_direction" type="int" enum="SkeletonProfile.TailDirection" /> + <description> + Sets the tail direction of the bone at [code]bone_idx[/code]. + [b]Note:[/b] This only specifies the method of calculation. The actual coordinates required should be stored in an external skeleton, so the calculation itself needs to be done externally. + </description> + </method> + <method name="set_texture"> + <return type="void" /> + <argument index="0" name="group_idx" type="int" /> + <argument index="1" name="texture" type="Texture2D" /> + <description> + Sets the texture of the group at [code]group_idx[/code] that will be the drawing group background image in the [BoneMap] editor. + </description> + </method> + </methods> + <members> + <member name="bone_size" type="int" setter="set_bone_size" getter="get_bone_size" default="0"> + </member> + <member name="group_size" type="int" setter="set_group_size" getter="get_group_size" default="0"> + </member> + </members> + <signals> + <signal name="profile_updated"> + <description> + This signal is emitted when change the value in profile. This is used to update key name in the [BoneMap] and to redraw the [BoneMap] editor. + [b]Note[/b]: This signal is not connected directly to editor to simplify the reference, instead it is passed on to editor through the [BoneMap]. + </description> + </signal> + </signals> + <constants> + <constant name="TAIL_DIRECTION_AVERAGE_CHILDREN" value="0" enum="TailDirection"> + Direction to the average coordinates of bone children. + </constant> + <constant name="TAIL_DIRECTION_SPECIFIC_CHILD" value="1" enum="TailDirection"> + Direction to the coordinates of specified bone child. + </constant> + <constant name="TAIL_DIRECTION_END" value="2" enum="TailDirection"> + Direction is not calculated. + </constant> + </constants> +</class> diff --git a/doc/classes/SkeletonProfileHumanoid.xml b/doc/classes/SkeletonProfileHumanoid.xml new file mode 100644 index 0000000000..065184244e --- /dev/null +++ b/doc/classes/SkeletonProfileHumanoid.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonProfileHumanoid" inherits="SkeletonProfile" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + A [SkeletonProfile] as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. + </description> + <tutorials> + </tutorials> + <members> + <member name="bone_size" type="int" setter="set_bone_size" getter="get_bone_size" overrides="SkeletonProfile" default="56" /> + <member name="group_size" type="int" setter="set_group_size" getter="get_group_size" overrides="SkeletonProfile" default="4" /> + </members> +</class> diff --git a/doc/classes/SphereShape3D.xml b/doc/classes/SphereShape3D.xml index 63084f024e..b4713b1d41 100644 --- a/doc/classes/SphereShape3D.xml +++ b/doc/classes/SphereShape3D.xml @@ -11,7 +11,7 @@ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> </tutorials> <members> - <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> + <member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.5"> The sphere's radius. The shape's diameter is double the radius. </member> </members> diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index b0d1e1efcf..0d423630d4 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -130,9 +130,4 @@ </description> </method> </methods> - <members> - <member name="frames" type="Array" setter="_set_frames" getter="_get_frames"> - Compatibility property, always equals to an empty array. - </member> - </members> </class> diff --git a/doc/classes/StandardMaterial3D.xml b/doc/classes/StandardMaterial3D.xml index 2305a9d325..bd6e5cdfa2 100644 --- a/doc/classes/StandardMaterial3D.xml +++ b/doc/classes/StandardMaterial3D.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="StandardMaterial3D" inherits="BaseMaterial3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Physically based rendering (PBR) material that can be applied to 3D objects. </brief_description> <description> + StandardMaterial3D's properties are inherited from [BaseMaterial3D]. </description> <tutorials> - <link title="Standard Material 3D">$DOCS_URL/tutorials/3d/standard_material_3d.html</link> + <link title="Standard Material 3D and ORM Material 3D">$DOCS_URL/tutorials/3d/standard_material_3d.html</link> </tutorials> </class> diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml index 3aede347a0..70762cbf6c 100644 --- a/doc/classes/StreamPeerSSL.xml +++ b/doc/classes/StreamPeerSSL.xml @@ -44,6 +44,12 @@ Returns the status of the connection. See [enum Status] for values. </description> </method> + <method name="get_stream" qualifiers="const"> + <return type="StreamPeer" /> + <description> + Returns the underlying [StreamPeer] connection, used in [method accept_stream] or [method connect_to_stream]. + </description> + </method> <method name="poll"> <return type="void" /> <description> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 1f3d5596aa..9f197dae02 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -180,7 +180,22 @@ <argument index="0" name="values" type="Variant" /> <argument index="1" name="placeholder" type="String" default=""{_}"" /> <description> - Formats the string by replacing all occurrences of [code]placeholder[/code] with [code]values[/code]. + Formats the string by replacing all occurrences of [code]placeholder[/code] with the elements of [code]values[/code]. + [code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in [code]placeholder[/code] will be replaced with the corresponding keys in advance. Array elements use their index as keys. + [codeblock] + # Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it. + var use_array_values = "Waiting for {0} is a play by {1}, and {0} Engine is named after it." + print(use_array_values.format(["Godot", "Samuel Beckett"])) + + # Prints: User 42 is Godot. + print("User {id} is {name}.".format({"id": 42, "name": "Godot"})) + [/codeblock] + Some additional handling is performed when [code]values[/code] is an array. If [code]placeholder[/code] does not contain an underscore, the elements of the array will be used to replace one occurrence of the placeholder in turn; If an array element is another 2-element array, it'll be interpreted as a key-value pair. + [codeblock] + # Prints: User 42 is Godot. + print("User {} is {}.".format([42, "Godot"], "{}")) + print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) + [/codeblock] </description> </method> <method name="get_base_dir" qualifiers="const"> @@ -412,9 +427,9 @@ </method> <method name="left" qualifiers="const"> <return type="String" /> - <argument index="0" name="position" type="int" /> + <argument index="0" name="length" type="int" /> <description> - Returns a number of characters from the left of the string. If negative [code]position[/code] is used, the characters are counted downwards from [String]'s length. + Returns a number of characters from the left of the string. If negative [code]length[/code] is used, the characters are counted downwards from [String]'s length. Examples: [codeblock] print("sample text".left(3)) #prints "sam" @@ -599,9 +614,9 @@ </method> <method name="right" qualifiers="const"> <return type="String" /> - <argument index="0" name="position" type="int" /> + <argument index="0" name="length" type="int" /> <description> - Returns a number of characters from the right of the string. If negative [code]position[/code] is used, the characters are counted downwards from [String]'s length. + Returns a number of characters from the right of the string. If negative [code]length[/code] is used, the characters are counted downwards from [String]'s length. Examples: [codeblock] print("sample text".right(3)) #prints "ext" diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index ffa1227500..a2bcac9788 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -32,6 +32,14 @@ </description> </constructor> </constructors> + <methods> + <method name="hash" qualifiers="const"> + <return type="int" /> + <description> + Returns the 32-bit hash value representing the [StringName]'s contents. + </description> + </method> + </methods> <operators> <operator name="operator !="> <return type="bool" /> diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index 74d02a84fd..d863e3c652 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -46,8 +46,8 @@ <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="rect" type="Rect2" /> <description> - Draws this stylebox using a [CanvasItem] with given [RID]. - You can get a [RID] value using [method Object.get_instance_id] on a [CanvasItem]-derived node. + Draws this stylebox using a canvas item identified by the given [RID]. + 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"> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 43d34d3890..ad638a680b 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -35,7 +35,7 @@ <return type="void" /> <argument index="0" name="index" type="int" /> <description> - Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices. + Adds a vertex to index array if you are using indexed vertices. Does not need to be called before adding vertices. </description> </method> <method name="add_triangle_fan"> @@ -123,6 +123,8 @@ <argument index="0" name="nd_threshold" type="float" /> <argument index="1" name="target_index_count" type="int" default="3" /> <description> + Generates a LOD for a given [code]nd_threshold[/code] in linear units (square root of quadric error metric), using at most [code]target_index_count[/code] indices. + Deprecated. Unused internally and neglects to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead. </description> </method> <method name="generate_normals"> @@ -139,25 +141,31 @@ Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [method generate_normals]). </description> </method> - <method name="get_custom_format" qualifiers="const"> - <return type="int" enum="SurfaceTool.CustomFormat" /> - <argument index="0" name="index" type="int" /> + <method name="get_aabb" qualifiers="const"> + <return type="AABB" /> <description> + Returns the axis-aligned bounding box of the vertex positions. </description> </method> - <method name="get_max_axis_length" qualifiers="const"> - <return type="float" /> + <method name="get_custom_format" qualifiers="const"> + <return type="int" enum="SurfaceTool.CustomFormat" /> + <argument index="0" name="channel_index" type="int" /> <description> + Returns the format for custom [code]channel_index[/code] (currently up to 4). Returns [constant CUSTOM_MAX] if this custom channel is unused. </description> </method> - <method name="get_primitive" qualifiers="const"> + <method name="get_primitive_type" qualifiers="const"> <return type="int" enum="Mesh.PrimitiveType" /> <description> + Returns the type of mesh geometry, such as [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method> <method name="get_skin_weight_count" qualifiers="const"> <return type="int" enum="SurfaceTool.SkinWeightCount" /> <description> + By default, returns [constant SKIN_4_WEIGHTS] to indicate only 4 bone influences per vertex are used. + Returns [constant SKIN_8_WEIGHTS] if up to 8 influences are used. + [b]Note:[/b] This function returns an enum, not the exact number of weights. </description> </method> <method name="index"> @@ -169,6 +177,7 @@ <method name="optimize_indices_for_cache"> <return type="void" /> <description> + Optimizes triangle sorting for performance. Requires that [method get_primitive_type] is [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method> <method name="set_bones"> @@ -188,16 +197,20 @@ </method> <method name="set_custom"> <return type="void" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="custom" type="Color" /> + <argument index="0" name="channel_index" type="int" /> + <argument index="1" name="custom_color" type="Color" /> <description> + Sets the custom value on this vertex for [code]channel_index[/code]. + [method set_custom_format] must be called first for this [code]channel_index[/code]. Formats which are not RGBA will ignore other color channels. </description> </method> <method name="set_custom_format"> <return type="void" /> - <argument index="0" name="index" type="int" /> + <argument index="0" name="channel_index" type="int" /> <argument index="1" name="format" type="int" enum="SurfaceTool.CustomFormat" /> <description> + Sets the color format for this custom [code]channel_index[/code]. Use [constant CUSTOM_MAX] to disable. + Must be invoked after [method begin] and should be set before [method commit] or [method commit_to_arrays]. </description> </method> <method name="set_material"> @@ -218,6 +231,9 @@ <return type="void" /> <argument index="0" name="count" type="int" enum="SurfaceTool.SkinWeightCount" /> <description> + Set to [constant SKIN_8_WEIGHTS] to indicate that up to 8 bone influences per vertex may be used. + By default, only 4 bone influences are used ([constant SKIN_4_WEIGHTS]) + [b]Note:[/b] This function takes an enum, not the exact number of weights. </description> </method> <method name="set_smooth_group"> @@ -258,26 +274,37 @@ </methods> <constants> <constant name="CUSTOM_RGBA8_UNORM" value="0" enum="CustomFormat"> + Limits range of data passed to `set_custom` to unsigned normalized 0 to 1 stored in 8 bits per channel. See [constant Mesh.ARRAY_CUSTOM_RGBA8_UNORM]. </constant> <constant name="CUSTOM_RGBA8_SNORM" value="1" enum="CustomFormat"> + Limits range of data passed to `set_custom` to signed normalized -1 to 1 stored in 8 bits per channel. See [constant Mesh.ARRAY_CUSTOM_RGBA8_SNORM]. </constant> <constant name="CUSTOM_RG_HALF" value="2" enum="CustomFormat"> + Stores data passed to `set_custom` as half precision floats, and uses only red and green color channels. See [constant Mesh.ARRAY_CUSTOM_RG_HALF]. </constant> <constant name="CUSTOM_RGBA_HALF" value="3" enum="CustomFormat"> + Stores data passed to `set_custom` as half precision floats and uses all color channels. See [constant Mesh.ARRAY_CUSTOM_RGBA_HALF]. </constant> <constant name="CUSTOM_R_FLOAT" value="4" enum="CustomFormat"> + Stores data passed to `set_custom` as full precision floats, and uses only red color channel. See [constant Mesh.ARRAY_CUSTOM_R_FLOAT]. </constant> <constant name="CUSTOM_RG_FLOAT" value="5" enum="CustomFormat"> + Stores data passed to `set_custom` as full precision floats, and uses only red and green color channels. See [constant Mesh.ARRAY_CUSTOM_RG_FLOAT]. </constant> <constant name="CUSTOM_RGB_FLOAT" value="6" enum="CustomFormat"> + Stores data passed to `set_custom` as full precision floats, and uses only red, green and blue color channels. See [constant Mesh.ARRAY_CUSTOM_RGB_FLOAT]. </constant> <constant name="CUSTOM_RGBA_FLOAT" value="7" enum="CustomFormat"> + Stores data passed to `set_custom` as full precision floats, and uses all color channels. See [constant Mesh.ARRAY_CUSTOM_RGBA_FLOAT]. </constant> <constant name="CUSTOM_MAX" value="8" enum="CustomFormat"> + Used to indicate a disabled custom channel. </constant> <constant name="SKIN_4_WEIGHTS" value="0" enum="SkinWeightCount"> + Each individual vertex can be influenced by only 4 bone weights. </constant> <constant name="SKIN_8_WEIGHTS" value="1" enum="SkinWeightCount"> + Each individual vertex can be influenced by up to 8 bone weights. </constant> </constants> </class> diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index a8ed0d4286..79d52b70fb 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -17,13 +17,6 @@ Adds a new tab. </description> </method> - <method name="clear_tab_opentype_features"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <description> - Removes all OpenType features from the tab title. - </description> - </method> <method name="ensure_tab_visible"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -77,14 +70,6 @@ Returns the number of hidden tabs offsetted to the left. </description> </method> - <method name="get_tab_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the tab title. - </description> - </method> <method name="get_tab_rect" qualifiers="const"> <return type="Rect2" /> <argument index="0" name="tab_idx" type="int" /> @@ -175,15 +160,6 @@ Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_tab_opentype_feature"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="values" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the tab title. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_tab_text_direction"> <return type="void" /> <argument index="0" name="tab_idx" type="int" /> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 58fdd2d058..18a4893f03 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -85,12 +85,6 @@ Performs a full reset of [TextEdit], including undo history. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_undo_history"> <return type="void" /> <description> @@ -355,13 +349,6 @@ Returns the count to the next visible line from [code]line[/code] to [code]line + visible_amount[/code]. Can also count backwards. For example if a [TextEdit] has 5 lines with lines 2 and 3 hidden, calling this with [code]line = 1, visible_amount = 1[/code] would return 3. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_pos_at_line_column" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="line" type="int" /> @@ -859,14 +846,6 @@ Sets the text for [code]gutter[/code] on [code]line[/code]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_overtype_mode_enabled"> <return type="void" /> <argument index="0" name="enabled" type="bool" /> @@ -956,6 +935,9 @@ <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="drag_and_drop_selection_enabled" type="bool" setter="set_drag_and_drop_selection_enabled" getter="is_drag_and_drop_selection_enabled" default="true"> + If [code]true[/code], allow drag and drop of selected text. + </member> <member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false"> If [code]true[/code], control characters are displayed. </member> @@ -995,13 +977,16 @@ <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default=""""> Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]). </member> + <member name="scroll_fit_content_height" type="bool" setter="set_fit_content_height_enabled" getter="is_fit_content_height_enabled" default="false"> + If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. + </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. </member> <member name="scroll_past_end_of_file" type="bool" setter="set_scroll_past_end_of_file_enabled" getter="is_scroll_past_end_of_file_enabled" default="false"> Allow scrolling past the last line into "virtual" space. </member> - <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false"> + <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enabled" getter="is_smooth_scroll_enabled" default="false"> Scroll smoothly over the text rather then jumping to the next location. </member> <member name="scroll_v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0"> diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index 5359937db5..601650db2e 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> @@ -149,8 +148,8 @@ <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. </member> - <member name="flags" type="int" setter="set_flags" getter="get_flags" default="3"> - Line Alignment rules. For more info see [TextServer]. + <member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" default="3"> + Line alignment rules. For more info see [TextServer]. </member> <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0"> Text orientation. @@ -161,28 +160,11 @@ <member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true"> If set to [code]true[/code] text will display invalid characters. </member> - <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextLine.OverrunBehavior" default="3"> - Sets the clipping behavior when the text exceeds the text line's set width. See [enum OverrunBehavior] for a description of all modes. + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="3"> + Sets the clipping behavior when the text exceeds the text line's set width. See [enum TextServer.OverrunBehavior] for a description of all modes. </member> <member name="width" type="float" setter="set_width" getter="get_width" default="-1.0"> Text line width. </member> </members> - <constants> - <constant name="OVERRUN_NO_TRIMMING" value="0" enum="OverrunBehavior"> - No text trimming is performed. - </constant> - <constant name="OVERRUN_TRIM_CHAR" value="1" enum="OverrunBehavior"> - Trims the text per character. - </constant> - <constant name="OVERRUN_TRIM_WORD" value="2" enum="OverrunBehavior"> - Trims the text per word. - </constant> - <constant name="OVERRUN_TRIM_ELLIPSIS" value="3" enum="OverrunBehavior"> - Trims the text per character and adds an ellipsis to indicate that parts are hidden. - </constant> - <constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior"> - Trims the text per word and adds an ellipsis to indicate that parts are hidden. - </constant> - </constants> </class> diff --git a/doc/classes/TextMesh.xml b/doc/classes/TextMesh.xml new file mode 100644 index 0000000000..17a0ca32e4 --- /dev/null +++ b/doc/classes/TextMesh.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="TextMesh" inherits="PrimitiveMesh" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Generate an [PrimitiveMesh] from the text. + </brief_description> + <description> + Generate an [PrimitiveMesh] from the text. + TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported. + The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges. + </description> + <tutorials> + </tutorials> + <members> + <member name="curve_step" type="float" setter="set_curve_step" getter="get_curve_step" default="0.5"> + Step (in pixels) used to approximate Bézier curves. + </member> + <member name="depth" type="float" setter="set_depth" getter="get_depth" default="0.05"> + Depths of the mesh, if set to [code]0.0[/code] only front surface, is generated, and UV layout is changed to use full texture for the front face only. + </member> + <member name="font" type="Font" setter="set_font" getter="get_font"> + Font configuration used to display text. + </member> + <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> + Font size of the [TextMesh]'s text. + </member> + <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="1"> + Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. + </member> + <member name="language" type="String" setter="set_language" getter="get_language" default=""""> + Language code used for text shaping algorithms, if left empty current locale is used instead. + </member> + <member name="pixel_size" type="float" setter="set_pixel_size" getter="get_pixel_size" default="0.01"> + The size of one pixel's width on the text to scale it in 3D. + </member> + <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="TextServer.StructuredTextParser" default="0"> + Set BiDi algorithm override for the structured text. + </member> + <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> + Set additional options for BiDi override. + </member> + <member name="text" type="String" setter="set_text" getter="get_text" default=""""> + The text to generate mesh from. + </member> + <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="TextServer.Direction" default="0"> + Base text writing direction. + </member> + <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false"> + If [code]true[/code], all the text displays as UPPERCASE. + </member> + <member name="width" type="float" setter="set_width" getter="get_width" default="500.0"> + Text width (in pixels), used for fill alignment. + </member> + </members> +</class> diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index 964e2c771f..c733d8fcee 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> @@ -217,18 +216,6 @@ Returns the size of the bounding box of the paragraph. </description> </method> - <method name="get_spacing_bottom" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the bottom of the line. See [member Font.spacing_bottom]. - </description> - </method> - <method name="get_spacing_top" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the top of the line. See [member Font.spacing_top]. - </description> - </method> <method name="hit_test" qualifiers="const"> <return type="int" /> <argument index="0" name="coords" type="Vector2" /> @@ -256,11 +243,10 @@ <method name="set_dropcap"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)" /> - <argument index="4" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="5" name="language" type="String" default="""" /> + <argument index="4" name="language" type="String" default="""" /> <description> Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. </description> @@ -277,14 +263,17 @@ <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="HorizontalAlignment" default="0"> Paragraph horizontal alignment. </member> + <member name="break_flags" type="int" setter="set_break_flags" getter="get_break_flags" enum="TextServer.LineBreakFlag" default="3"> + Line breaking rules. For more info see [TextServer]. + </member> <member name="custom_punctuation" type="String" setter="set_custom_punctuation" getter="get_custom_punctuation" default=""""> Custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. </member> <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. </member> - <member name="flags" type="int" setter="set_flags" getter="get_flags" default="99"> - Line breaking and alignment rules. For more info see [TextServer]. + <member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" default="3"> + Line alignment rules. For more info see [TextServer]. </member> <member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" default="-1"> Limits the lines of text shown. @@ -298,28 +287,11 @@ <member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true"> If set to [code]true[/code] text will display invalid characters. </member> - <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextParagraph.OverrunBehavior" default="0"> - Sets the clipping behavior when the text exceeds the paragraph's set width. See [enum OverrunBehavior] for a description of all modes. + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> + Sets the clipping behavior when the text exceeds the paragraph's set width. See [enum TextServer.OverrunBehavior] for a description of all modes. </member> <member name="width" type="float" setter="set_width" getter="get_width" default="-1.0"> Paragraph width. </member> </members> - <constants> - <constant name="OVERRUN_NO_TRIMMING" value="0" enum="OverrunBehavior"> - No text trimming is performed. - </constant> - <constant name="OVERRUN_TRIM_CHAR" value="1" enum="OverrunBehavior"> - Trims the text per character. - </constant> - <constant name="OVERRUN_TRIM_WORD" value="2" enum="OverrunBehavior"> - Trims the text per word. - </constant> - <constant name="OVERRUN_TRIM_ELLIPSIS" value="3" enum="OverrunBehavior"> - Trims the text per character and adds an ellipsis to indicate that parts are hidden. - </constant> - <constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior"> - Trims the text per word and adds an ellipsis to indicate that parts are hidden. - </constant> - </constants> </class> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 2f57b76374..e1b676427b 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -121,6 +121,20 @@ Returns font embolden strength. </description> </method> + <method name="font_get_face_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns number of faces in the TrueType / OpenType collection. + </description> + </method> + <method name="font_get_face_index" qualifiers="const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Recturns an active face index in the TrueType / OpenType collection. + </description> + </method> <method name="font_get_fixed_size" qualifiers="const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -341,17 +355,8 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="const"> - <return type="int" /> + <return type="int" enum="TextServer.FontStyle" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font style flags, see [enum FontStyle]. @@ -528,7 +533,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method font_remove_glyph]. </description> </method> @@ -593,6 +598,14 @@ Sets font embolden strength. If [code]strength[/code] is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. </description> </method> + <method name="font_set_face_index"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="face_index" type="int" /> + <description> + Sets an active face index in the TrueType / OpenType collection. + </description> + </method> <method name="font_set_fixed_size"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -770,20 +783,10 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="style" type="int" /> + <argument index="1" name="style" type="int" enum="TextServer.FontStyle" /> <description> Sets the font style flags, see [enum FontStyle]. </description> @@ -1074,7 +1077,7 @@ <return type="float" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> - <argument index="2" name="jst_flags" type="int" default="3" /> + <argument index="2" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" /> <description> Adjusts text with to fit to specified width, returns new text width. </description> @@ -1181,7 +1184,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> <argument index="2" name="start" type="int" default="0" /> - <argument index="3" name="break_flags" type="int" default="96" /> + <argument index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> <description> Breaks text to the lines and returns character ranges for each line. </description> @@ -1192,7 +1195,7 @@ <argument index="1" name="width" type="PackedFloat32Array" /> <argument index="2" name="start" type="int" default="0" /> <argument index="3" name="once" type="bool" default="true" /> - <argument index="4" name="break_flags" type="int" default="96" /> + <argument index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" default="3" /> <description> Breaks text to the lines and columns. Returns character ranges for each segment. </description> @@ -1264,6 +1267,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1295,7 +1306,7 @@ <method name="shaped_text_get_word_breaks" qualifiers="const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> - <argument index="1" name="grapheme_flags" type="int" default="264" /> + <argument index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" default="264" /> <description> Breaks text into words and returns array of character ranges. Use [code]grapheme_flags[/code] to set what characters are used for breaking (see [enum GraphemeFlag]). </description> @@ -1335,7 +1346,7 @@ <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" default="0" /> - <argument index="2" name="overrun_trim_flags" type="int" default="0" /> + <argument index="2" name="overrun_trim_flags" type="int" enum="TextServer.TextOverrunFlag" default="0" /> <description> Trims text if it exceeds the given width. </description> @@ -1409,6 +1420,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> @@ -1502,87 +1522,128 @@ Left to right text is written vertically from top to bottom. Right to left text is written vertically from bottom to top. </constant> - <constant name="JUSTIFICATION_NONE" value="0" enum="JustificationFlag"> + <constant name="JUSTIFICATION_NONE" value="0" enum="JustificationFlag" is_bitfield="true"> Do not justify text. </constant> - <constant name="JUSTIFICATION_KASHIDA" value="1" enum="JustificationFlag"> + <constant name="JUSTIFICATION_KASHIDA" value="1" enum="JustificationFlag" is_bitfield="true"> Justify text by adding and removing kashidas. </constant> - <constant name="JUSTIFICATION_WORD_BOUND" value="2" enum="JustificationFlag"> + <constant name="JUSTIFICATION_WORD_BOUND" value="2" enum="JustificationFlag" is_bitfield="true"> Justify text by changing width of the spaces between the words. </constant> - <constant name="JUSTIFICATION_TRIM_EDGE_SPACES" value="4" enum="JustificationFlag"> + <constant name="JUSTIFICATION_TRIM_EDGE_SPACES" value="4" enum="JustificationFlag" is_bitfield="true"> Remove trailing and leading spaces from the justified text. </constant> - <constant name="JUSTIFICATION_AFTER_LAST_TAB" value="8" enum="JustificationFlag"> + <constant name="JUSTIFICATION_AFTER_LAST_TAB" value="8" enum="JustificationFlag" is_bitfield="true"> Only apply justification to the part of the text after the last tab. </constant> - <constant name="JUSTIFICATION_CONSTRAIN_ELLIPSIS" value="16" enum="JustificationFlag"> + <constant name="JUSTIFICATION_CONSTRAIN_ELLIPSIS" value="16" enum="JustificationFlag" is_bitfield="true"> Apply justification to the trimmed line with ellipsis. </constant> - <constant name="BREAK_NONE" value="0" enum="LineBreakFlag"> + <constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode"> + Autowrap is disabled. + </constant> + <constant name="AUTOWRAP_ARBITRARY" value="1" enum="AutowrapMode"> + Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available. + </constant> + <constant name="AUTOWRAP_WORD" value="2" enum="AutowrapMode"> + Wraps the text inside the node's bounding rectangle by soft-breaking between words. + </constant> + <constant name="AUTOWRAP_WORD_SMART" value="3" enum="AutowrapMode"> + Behaves similarly to [constant AUTOWRAP_WORD], but force-breaks a word if that single word does not fit in one line. + </constant> + <constant name="BREAK_NONE" value="0" enum="LineBreakFlag" is_bitfield="true"> Do not break the line. </constant> - <constant name="BREAK_MANDATORY" value="32" enum="LineBreakFlag"> + <constant name="BREAK_MANDATORY" value="1" enum="LineBreakFlag" is_bitfield="true"> Break the line at the line mandatory break characters (e.g. [code]"\n"[/code]). </constant> - <constant name="BREAK_WORD_BOUND" value="64" enum="LineBreakFlag"> + <constant name="BREAK_WORD_BOUND" value="2" enum="LineBreakFlag" is_bitfield="true"> Break the line between the words. </constant> - <constant name="BREAK_GRAPHEME_BOUND" value="128" enum="LineBreakFlag"> + <constant name="BREAK_GRAPHEME_BOUND" value="4" enum="LineBreakFlag" is_bitfield="true"> Break the line between any unconnected graphemes. </constant> - <constant name="BREAK_WORD_BOUND_ADAPTIVE" value="320" enum="LineBreakFlag"> - Break the line between the words, or any unconnected graphemes if line is too short to fit the whole word. + <constant name="BREAK_ADAPTIVE" value="8" enum="LineBreakFlag" is_bitfield="true"> + </constant> + <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> + Trims text before the shaping. e.g, increasing [member Label.visible_characters] or [member RichTextLabel.visible_characters] value is visually identical to typing the text. + </constant> + <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior"> + Displays glyphs that are mapped to the first [member Label.visible_characters] or [member RichTextLabel.visible_characters] characters from the beginning of the text. + </constant> + <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> + Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. + </constant> + <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> + Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the left. + </constant> + <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> + Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the right. </constant> - <constant name="OVERRUN_NO_TRIMMING" value="0" enum="TextOverrunFlag"> + <constant name="OVERRUN_NO_TRIMMING" value="0" enum="OverrunBehavior"> + No text trimming is performed. + </constant> + <constant name="OVERRUN_TRIM_CHAR" value="1" enum="OverrunBehavior"> + Trims the text per character. + </constant> + <constant name="OVERRUN_TRIM_WORD" value="2" enum="OverrunBehavior"> + Trims the text per word. + </constant> + <constant name="OVERRUN_TRIM_ELLIPSIS" value="3" enum="OverrunBehavior"> + Trims the text per character and adds an ellipsis to indicate that parts are hidden. + </constant> + <constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior"> + Trims the text per word and adds an ellipsis to indicate that parts are hidden. + </constant> + <constant name="OVERRUN_NO_TRIM" value="0" enum="TextOverrunFlag" is_bitfield="true"> No trimming is performed. </constant> - <constant name="OVERRUN_TRIM" value="1" enum="TextOverrunFlag"> + <constant name="OVERRUN_TRIM" value="1" enum="TextOverrunFlag" is_bitfield="true"> Trims the text when it exceeds the given width. </constant> - <constant name="OVERRUN_TRIM_WORD_ONLY" value="2" enum="TextOverrunFlag"> + <constant name="OVERRUN_TRIM_WORD_ONLY" value="2" enum="TextOverrunFlag" is_bitfield="true"> Trims the text per word instead of per grapheme. </constant> - <constant name="OVERRUN_ADD_ELLIPSIS" value="4" enum="TextOverrunFlag"> + <constant name="OVERRUN_ADD_ELLIPSIS" value="4" enum="TextOverrunFlag" is_bitfield="true"> Determines whether an ellipsis should be added at the end of the text. </constant> - <constant name="OVERRUN_ENFORCE_ELLIPSIS" value="8" enum="TextOverrunFlag"> + <constant name="OVERRUN_ENFORCE_ELLIPSIS" value="8" enum="TextOverrunFlag" is_bitfield="true"> Determines whether the ellipsis at the end of the text is enforced and may not be hidden. </constant> - <constant name="OVERRUN_JUSTIFICATION_AWARE" value="16" enum="TextOverrunFlag"> + <constant name="OVERRUN_JUSTIFICATION_AWARE" value="16" enum="TextOverrunFlag" is_bitfield="true"> </constant> - <constant name="GRAPHEME_IS_VALID" value="1" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_VALID" value="1" enum="GraphemeFlag" is_bitfield="true"> Grapheme is supported by the font, and can be drawn. </constant> - <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag" is_bitfield="true"> Grapheme is part of right-to-left or bottom-to-top run. </constant> - <constant name="GRAPHEME_IS_VIRTUAL" value="4" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_VIRTUAL" value="4" enum="GraphemeFlag" is_bitfield="true"> Grapheme is not part of source text, it was added by justification process. </constant> - <constant name="GRAPHEME_IS_SPACE" value="8" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_SPACE" value="8" enum="GraphemeFlag" is_bitfield="true"> Grapheme is whitespace. </constant> - <constant name="GRAPHEME_IS_BREAK_HARD" value="16" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_BREAK_HARD" value="16" enum="GraphemeFlag" is_bitfield="true"> Grapheme is mandatory break point (e.g. [code]"\n"[/code]). </constant> - <constant name="GRAPHEME_IS_BREAK_SOFT" value="32" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_BREAK_SOFT" value="32" enum="GraphemeFlag" is_bitfield="true"> Grapheme is optional break point (e.g. space). </constant> - <constant name="GRAPHEME_IS_TAB" value="64" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_TAB" value="64" enum="GraphemeFlag" is_bitfield="true"> Grapheme is the tabulation character. </constant> - <constant name="GRAPHEME_IS_ELONGATION" value="128" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_ELONGATION" value="128" enum="GraphemeFlag" is_bitfield="true"> Grapheme is kashida. </constant> - <constant name="GRAPHEME_IS_PUNCTUATION" value="256" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_PUNCTUATION" value="256" enum="GraphemeFlag" is_bitfield="true"> Grapheme is punctuation character. </constant> - <constant name="GRAPHEME_IS_UNDERSCORE" value="512" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_UNDERSCORE" value="512" enum="GraphemeFlag" is_bitfield="true"> Grapheme is underscore character. </constant> - <constant name="GRAPHEME_IS_CONNECTED" value="1024" enum="GraphemeFlag"> + <constant name="GRAPHEME_IS_CONNECTED" value="1024" enum="GraphemeFlag" is_bitfield="true"> Grapheme is connected to the previous grapheme. Breaking line before this grapheme is not safe. </constant> <constant name="HINTING_NONE" value="0" enum="Hinting"> @@ -1675,13 +1736,15 @@ <constant name="SPACING_BOTTOM" value="3" enum="SpacingType"> Spacing at the bottom of the line. </constant> - <constant name="FONT_BOLD" value="1" enum="FontStyle"> + <constant name="SPACING_MAX" value="4" enum="SpacingType"> + </constant> + <constant name="FONT_BOLD" value="1" enum="FontStyle" is_bitfield="true"> Font is bold. </constant> - <constant name="FONT_ITALIC" value="2" enum="FontStyle"> + <constant name="FONT_ITALIC" value="2" enum="FontStyle" is_bitfield="true"> Font is italic or oblique. </constant> - <constant name="FONT_FIXED_WIDTH" value="4" enum="FontStyle"> + <constant name="FONT_FIXED_WIDTH" value="4" enum="FontStyle" is_bitfield="true"> Font have fixed-width characters. </constant> <constant name="STRUCTURED_TEXT_DEFAULT" value="0" enum="StructuredTextParser"> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 434d6f909c..4501ec744a 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -114,6 +114,20 @@ Returns font embolden strength. </description> </method> + <method name="font_get_face_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns number of faces in the TrueType / OpenType collection. + </description> + </method> + <method name="font_get_face_index" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns an active face index in the TrueType / OpenType collection. + </description> + </method> <method name="font_get_fixed_size" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -331,17 +345,8 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="virtual const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="virtual const"> - <return type="int" /> + <return type="int" enum="TextServer.FontStyle" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font style flags, see [enum TextServer.FontStyle]. @@ -517,7 +522,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. </description> </method> <method name="font_render_glyph" qualifiers="virtual"> @@ -590,6 +595,14 @@ Sets font embolden strength. If [code]strength[/code] is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. </description> </method> + <method name="font_set_face_index" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="face_index" type="int" /> + <description> + Sets an active face index in the TrueType / OpenType collection. + </description> + </method> <method name="font_set_fixed_size" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -766,20 +779,10 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing" qualifiers="virtual"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="style" type="int" /> + <argument index="1" name="style" type="int" enum="TextServer.FontStyle" /> <description> Sets the font style flags, see [enum TextServer.FontStyle]. </description> @@ -1071,7 +1074,7 @@ <return type="float" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> - <argument index="2" name="jst_flags" type="int" /> + <argument index="2" name="jst_flags" type="int" enum="TextServer.JustificationFlag" /> <description> Adjusts text with to fit to specified width, returns new text width. </description> @@ -1180,7 +1183,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> <argument index="2" name="start" type="int" /> - <argument index="3" name="break_flags" type="int" /> + <argument index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" /> <description> Breaks text to the lines and returns character ranges for each line. [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. @@ -1192,7 +1195,7 @@ <argument index="1" name="width" type="PackedFloat32Array" /> <argument index="2" name="start" type="int" /> <argument index="3" name="once" type="bool" /> - <argument index="4" name="break_flags" type="int" /> + <argument index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" /> <description> Breaks text to the lines and columns. Returns character ranges for each segment. [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. @@ -1266,6 +1269,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1297,7 +1308,7 @@ <method name="shaped_text_get_word_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> - <argument index="1" name="grapheme_flags" type="int" /> + <argument index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" /> <description> Breaks text into words and returns array of character ranges. [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. @@ -1341,7 +1352,7 @@ <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> - <argument index="2" name="trim_flags" type="int" /> + <argument index="2" name="trim_flags" type="int" enum="TextServer.TextOverrunFlag" /> <description> Trims text if it exceeds the given width. </description> @@ -1414,6 +1425,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index 1bbebe085e..3721058d25 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -106,7 +106,8 @@ <method name="get_image" qualifiers="const"> <return type="Image" /> <description> - Returns an [Image] that is a copy of data from this [Texture2D]. [Image]s can be accessed and manipulated directly. + Returns an [Image] that is a copy of data from this [Texture2D] (a new [Image] is created each time). [Image]s can be accessed and manipulated directly. + [b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused. </description> </method> <method name="get_size" qualifiers="const"> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 5270da9588..7f4e0645c8 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -334,8 +334,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" /> <description> - Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). - Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. + Returns [code]true[/code] if [member default_font_size] has a valid value. + Returns [code]false[/code] if it doesn't. The value must be greater than [code]0[/code] to be considered valid. </description> </method> <method name="has_icon" qualifiers="const"> @@ -426,8 +426,8 @@ <argument index="1" name="name" type="StringName" /> <argument index="2" name="theme_type" type="StringName" /> <description> - Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. - Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. + Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). + Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. </description> </method> <method name="rename_icon"> @@ -495,7 +495,8 @@ <argument index="1" name="theme_type" type="StringName" /> <argument index="2" name="font_size" type="int" /> <description> - Creates or changes the value of the font size property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_font_size] to remove the property. + Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. + Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. </description> </method> <method name="set_icon"> diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index d78b8db052..513daff37c 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -35,10 +35,11 @@ <method name="start"> <return type="int" enum="Error" /> <argument index="0" name="callable" type="Callable" /> - <argument index="1" name="userdata" type="Variant" default="null" /> - <argument index="2" name="priority" type="int" enum="Thread.Priority" default="1" /> + <argument index="1" name="priority" type="int" enum="Thread.Priority" default="1" /> <description> - Starts a new [Thread] that calls [code]callable[/code] with [code]userdata[/code] passed as an argument. Even if no userdata is passed, [code]callable[/code] must accept one argument and it will be null. The [code]priority[/code] of the [Thread] can be changed by passing a value from the [enum Priority] enum. + Starts a new [Thread] that calls [code]callable[/code]. + If the method takes some arguments, you can pass them using [method Callable.bind]. + The [code]priority[/code] of the [Thread] can be changed by passing a value from the [enum Priority] enum. Returns [constant OK] on success, or [constant ERR_CANT_CREATE] on failure. </description> </method> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index d5c2693f8b..66cf602e5d 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -79,7 +79,7 @@ Returns the occluder polygon of the tile for the TileSet occlusion layer with index [code]layer_id[/code]. </description> </method> - <method name="get_peering_bit_terrain" qualifiers="const"> + <method name="get_terrain_peering_bit" qualifiers="const"> <return type="int" /> <argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <description> @@ -185,7 +185,7 @@ Sets the occluder for the TileSet occlusion layer with index [code]layer_id[/code]. </description> </method> - <method name="set_peering_bit_terrain"> + <method name="set_terrain_peering_bit"> <return type="void" /> <argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <argument index="1" name="terrain" type="int" /> @@ -199,12 +199,15 @@ </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false"> </member> - <member name="material" type="ShaderMaterial" setter="set_material" getter="get_material"> + <member name="material" type="Material" setter="set_material" getter="get_material"> + The [Material] to use for this [TileData]. This can be a [CanvasItemMaterial] to use the default shader, or a [ShaderMaterial] to use a custom shader. </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> </member> <member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0"> </member> + <member name="terrain" type="int" setter="set_terrain" getter="get_terrain" default="-1"> + </member> <member name="terrain_set" type="int" setter="set_terrain_set" getter="get_terrain_set" default="-1"> </member> <member name="texture_offset" type="Vector2i" setter="set_texture_offset" getter="get_texture_offset" default="Vector2i(0, 0)"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 259c800a78..d532f583e6 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -243,15 +243,30 @@ - The alternative tile identifier [code]alternative_tile[/code] identifies a tile alternative the source is a [TileSetAtlasSource], and the scene for a [TileSetScenesCollectionSource]. </description> </method> - <method name="set_cells_from_surrounding_terrains"> + <method name="set_cells_terrain_connect"> <return type="void" /> <argument index="0" name="layer" type="int" /> <argument index="1" name="cells" type="Vector2i[]" /> <argument index="2" name="terrain_set" type="int" /> - <argument index="3" name="ignore_empty_terrains" type="bool" default="true" /> + <argument index="3" name="terrain" type="int" /> + <argument index="4" name="ignore_empty_terrains" type="bool" default="true" /> <description> - Updates all the cells in the [code]cells[/code] coordinates array and replace them by tiles that matches the surrounding cells terrains. Only cells form the given [code]terrain_set[/code] are considered. - If [code]ignore_empty_terrains[/code] is true, zones with no terrain defined are ignored to select the tiles. + Update all the cells in the [code]cells[/code] coordinates array so that they use the given [code]terrain[/code] for the given [code]terrain_set[/code]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions. If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. + If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. + [b]Note:[/b] To work correctly, [code]set_cells_terrain_connect[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. + </description> + </method> + <method name="set_cells_terrain_path"> + <return type="void" /> + <argument index="0" name="layer" type="int" /> + <argument index="1" name="path" type="Vector2i[]" /> + <argument index="2" name="terrain_set" type="int" /> + <argument index="3" name="terrain" type="int" /> + <argument index="4" name="ignore_empty_terrains" type="bool" default="true" /> + <description> + Update all the cells in the [code]cells[/code] coordinates array so that they use the given [code]terrain[/code] for the given [code]terrain_set[/code]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions. + If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. + [b]Note:[/b] To work correctly, [code]set_cells_terrain_path[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. </description> </method> <method name="set_layer_enabled"> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 8c2a5aa6d9..e1f7ff21d0 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -163,6 +163,7 @@ <argument index="0" name="scale" type="Vector2" /> <description> Sets the transform's scale. + [b]Note:[/b] Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. </description> </method> <method name="set_skew"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 1d4a5b922d..b06be0cf99 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -31,6 +31,7 @@ [/csharp] [/codeblocks] To iterate over all the [TreeItem] objects in a [Tree] object, use [method TreeItem.get_next] and [method TreeItem.get_first_child] after getting the root through [method get_root]. You can use [method Object.free] on a [TreeItem] to remove it from the [Tree]. + [b]Incremental search:[/b] Like [ItemList] and [PopupMenu], [Tree] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [member ProjectSettings.gui/timers/incremental_search_max_interval_msec]. </description> <tutorials> </tutorials> @@ -41,13 +42,6 @@ Clears the tree. This removes all items. </description> </method> - <method name="clear_column_title_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="create_item"> <return type="TreeItem" /> <argument index="0" name="parent" type="TreeItem" default="null" /> @@ -113,14 +107,6 @@ Returns column title language code. </description> </method> - <method name="get_column_title_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the column title. - </description> - </method> <method name="get_column_width" qualifiers="const"> <return type="int" /> <argument index="0" name="column" type="int" /> @@ -307,15 +293,6 @@ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_column_title_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the column title. - </description> - </method> </methods> <members> <member name="allow_reselect" type="bool" setter="set_allow_reselect" getter="get_allow_reselect" default="false"> @@ -353,10 +330,11 @@ </member> </members> <signals> - <signal name="button_pressed"> + <signal name="button_clicked"> <argument index="0" name="item" type="TreeItem" /> <argument index="1" name="column" type="int" /> <argument index="2" name="id" type="int" /> + <argument index="3" name="mouse_button_index" type="int" /> <description> Emitted when a button on the tree was pressed (see [method TreeItem.add_button]). </description> @@ -379,22 +357,23 @@ Emitted when a column's title is pressed. </description> </signal> - <signal name="custom_popup_edited"> - <argument index="0" name="arrow_clicked" type="bool" /> + <signal name="custom_item_clicked"> + <argument index="0" name="mouse_button_index" type="int" /> <description> - Emitted when a cell with the [constant TreeItem.CELL_MODE_CUSTOM] is clicked to be edited. + Emitted when an item with [constant TreeItem.CELL_MODE_CUSTOM] is clicked with a mouse button. </description> </signal> - <signal name="empty_rmb"> - <argument index="0" name="position" type="Vector2" /> + <signal name="custom_popup_edited"> + <argument index="0" name="arrow_clicked" type="bool" /> <description> - Emitted when the right mouse button is pressed in the empty space of the tree. + Emitted when a cell with the [constant TreeItem.CELL_MODE_CUSTOM] is clicked to be edited. </description> </signal> - <signal name="empty_tree_rmb_selected"> + <signal name="empty_clicked"> <argument index="0" name="position" type="Vector2" /> + <argument index="1" name="mouse_button_index" type="int" /> <description> - Emitted when the right mouse button is pressed if right mouse button selection is active and the tree is empty. + Emitted when a mouse button is clicked in the empty space of the tree. </description> </signal> <signal name="item_activated"> @@ -423,15 +402,11 @@ Emitted when an item is edited. </description> </signal> - <signal name="item_rmb_edited"> - <description> - Emitted when an item is edited using the right mouse button. - </description> - </signal> - <signal name="item_rmb_selected"> + <signal name="item_mouse_selected"> <argument index="0" name="position" type="Vector2" /> + <argument index="1" name="mouse_button_index" type="int" /> <description> - Emitted when an item is selected with the right mouse button. + Emitted when an item is selected with a mouse button. </description> </signal> <signal name="item_selected"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index d2e29bf3b1..fbba1147a2 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -42,13 +42,6 @@ Resets the color for the given column to default. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="create_child"> <return type="TreeItem" /> <argument index="0" name="idx" type="int" default="-1" /> @@ -230,25 +223,17 @@ <method name="get_next" qualifiers="const"> <return type="TreeItem" /> <description> - Returns the next TreeItem in the tree or a null object if there is none. + Returns the next sibling TreeItem in the tree or a null object if there is none. </description> </method> <method name="get_next_visible"> <return type="TreeItem" /> <argument index="0" name="wrap" type="bool" default="false" /> <description> - Returns the next visible TreeItem in the tree or a null object if there is none. + Returns the next visible sibling TreeItem in the tree or a null object if there is none. If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_parent" qualifiers="const"> <return type="TreeItem" /> <description> @@ -258,14 +243,14 @@ <method name="get_prev"> <return type="TreeItem" /> <description> - Returns the previous TreeItem in the tree or a null object if there is none. + Returns the previous sibling TreeItem in the tree or a null object if there is none. </description> </method> <method name="get_prev_visible"> <return type="TreeItem" /> <argument index="0" name="wrap" type="bool" default="false" /> <description> - Returns the previous visible TreeItem in the tree or a null object if there is none. + Returns the previous visible sibling TreeItem in the tree or a null object if there is none. If [code]wrap[/code] is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns [code]null[/code]. </description> </method> @@ -580,15 +565,6 @@ Sets the metadata value for the given column, which can be retrieved later using [method get_metadata]. This can be used, for example, to store a reference to the original data. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. - </description> - </method> <method name="set_range"> <return type="void" /> <argument index="0" name="column" type="int" /> @@ -687,6 +663,10 @@ <member name="disable_folding" type="bool" setter="set_disable_folding" getter="is_folding_disabled"> If [code]true[/code], folding is disabled for this TreeItem. </member> + <member name="visible" type="bool" setter="set_visible" getter="is_visible"> + If [code]true[/code], the [TreeItem] is visible (default). + Note that if a [TreeItem] is set to not be visible, none of its children will be visible either. + </member> </members> <constants> <constant name="CELL_MODE_STRING" value="0" enum="TreeCellMode"> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index f9ec0d115d..b18232f5c3 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -4,41 +4,41 @@ Lightweight object used for general-purpose animation via script, using [Tweener]s. </brief_description> <description> - Tweens are mostly useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. + Tweens are mostly useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. Animating something with a [Tween] is called tweening. [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween]; it would be difficult to do the same thing with an [AnimationPlayer] node. Tweens are also more light-weight than [AnimationPlayer], so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a fire-and-forget manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped [CallbackTweener] with a delay. A [Tween] can be created by using either [method SceneTree.create_tween] or [method Node.create_tween]. [Tween]s created manually (i.e. by using [code]Tween.new()[/code]) are invalid and can't be used for tweening values. - A [Tween] animation is composed of a sequence of [Tweener]s, which by default are executed one after another. You can create a sequence by appending [Tweener]s to the [Tween]. Animating something with a [Tweener] is called tweening. Example tweening sequence looks like this: + A tween animation is created by adding [Tweener]s to the [Tween] object, using [method tween_property], [method tween_interval], [method tween_callback] or [method tween_method]: [codeblock] var tween = get_tree().create_tween() tween.tween_property($Sprite, "modulate", Color.red, 1) tween.tween_property($Sprite, "scale", Vector2(), 1) tween.tween_callback($Sprite.queue_free) [/codeblock] - This sequence will make the [code]$Sprite[/code] node turn red, then shrink and finally the [method Node.queue_free] is called to remove the sprite. See methods [method tween_property], [method tween_interval], [method tween_callback] and [method tween_method] for more usage information. - When a [Tweener] is created with one of the [code]tween_*[/code] methods, a chained method call can be used to tweak the properties of this [Tweener]. For example, if you want to set different transition type in the above example, you can do: + 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]. + When a [Tweener] is created with one of the [code]tween_*[/code] methods, a chained method call can be used to tweak the properties of this [Tweener]. For example, if you want to set a different transition type in the above example, you can use [method set_trans]: [codeblock] var tween = get_tree().create_tween() tween.tween_property($Sprite, "modulate", Color.red, 1).set_trans(Tween.TRANS_SINE) tween.tween_property($Sprite, "scale", Vector2(), 1).set_trans(Tween.TRANS_BOUNCE) tween.tween_callback($Sprite.queue_free) [/codeblock] - Most of the [Tween] methods can be chained this way too. In this example the [Tween] is bound and have set a default transition: + 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: [codeblock] var tween = get_tree().create_tween().bind_node(self).set_trans(Tween.TRANS_ELASTIC) tween.tween_property($Sprite, "modulate", Color.red, 1) tween.tween_property($Sprite, "scale", Vector2(), 1) tween.tween_callback($Sprite.queue_free) [/codeblock] - Another interesting use for [Tween]s is animating arbitrary set of objects: + Another interesting use for [Tween]s is animating arbitrary sets of objects: [codeblock] var tween = create_tween() for sprite in get_children(): - tween.tween_property(sprite, "position", Vector2(), 1) + tween.tween_property(sprite, "position", Vector2(0, 0), 1) [/codeblock] In the example above, all children of a node are moved one after another to position (0, 0). - Some [Tweener]s use transitions and eases. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. + Some [Tweener]s use transitions and eases. The first accepts a [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url] - [b]Note:[/b] All [Tween]s will automatically start by default. To prevent a [Tween] from autostarting, you can call [method stop] immediately after it was created. + [b]Note:[/b] All [Tween]s will automatically start by default. To prevent a [Tween] from autostarting, you can call [method stop] immediately after it is created. </description> <tutorials> </tutorials> @@ -67,15 +67,15 @@ <return type="bool" /> <argument index="0" name="delta" type="float" /> <description> - Processes the [Tween] by given [code]delta[/code] value, in seconds. Mostly useful when the [Tween] is paused, for controlling it manually. Can also be used to end the [Tween] animation immediately, by using [code]delta[/code] longer than the whole duration. + Processes the [Tween] by the given [code]delta[/code] value, in seconds. This is mostly useful for manual control when the [Tween] is paused. It can also be used to end the [Tween] animation immediately, by setting [code]delta[/code] longer than the whole duration of the [Tween] animation. Returns [code]true[/code] if the [Tween] still has [Tweener]s that haven't finished. - [b]Note:[/b] The [Tween] will become invalid after finished, but you can call [method stop] after the step, to keep it and reset. + [b]Note:[/b] The [Tween] will become invalid in the next processing frame after its animation finishes. Calling [method stop] after performing [method custom_step] instead keeps and resets the [Tween]. </description> </method> <method name="get_total_elapsed_time" qualifiers="const"> <return type="float" /> <description> - Returns the total time in seconds the [Tween] has been animating (i.e. time since it started, not counting pauses etc.). The time is affected by [method set_speed_scale] and [method stop] will reset it to [code]0[/code]. + Returns the total time in seconds the [Tween] has been animating (i.e. the time since it started, not counting pauses etc.). The time is affected by [method set_speed_scale], and [method stop] will reset it to [code]0[/code]. [b]Note:[/b] As it results from accumulating frame deltas, the time returned after the [Tween] has finished animating will be slightly greater than the actual [Tween] duration. </description> </method> @@ -105,7 +105,7 @@ <method name="is_valid"> <return type="bool" /> <description> - Returns whether the [Tween] is valid. A valid [Tween] is a [Tween] contained by the scene tree (i.e. the array from [method SceneTree.get_processed_tweens] will contain this [Tween]). [Tween] might become invalid when it has finished tweening or was killed, also when created with [code]Tween.new()[/code]. Invalid [Tween] can't have [Tweener]s appended, because it can't animate them. + Returns whether the [Tween] is valid. A valid [Tween] is a [Tween] contained by the scene tree (i.e. the array from [method SceneTree.get_processed_tweens] will contain this [Tween]). A [Tween] might become invalid when it has finished tweening, is killed, or when created with [code]Tween.new()[/code]. Invalid [Tween]s can't have [Tweener]s appended. </description> </method> <method name="kill"> @@ -152,8 +152,8 @@ <argument index="0" name="loops" type="int" default="0" /> <description> Sets the number of times the tweening sequence will be repeated, i.e. [code]set_loops(2)[/code] will run the animation twice. - Calling this method without arguments will make the [Tween] run infinitely, until it is either killed by [method kill] or by freeing bound node, or all the animated objects have been freed (which makes further animation impossible). - [b]Warning:[/b] Make sure to always add some duration/delay when using infinite loops. 0-duration looped animations (e.g. single [CallbackTweener] with no delay or [PropertyTweener] with invalid node) are equivalent to infinite [code]while[/code] loops and will freeze your game. If a [Tween]'s lifetime depends on some node, always use [method bind_node]. + Calling this method without arguments will make the [Tween] run infinitely, until either it is killed with [method kill], the [Tween]'s bound node is freed, or all the animated objects have been freed (which makes further animation impossible). + [b]Warning:[/b] Make sure to always add some duration/delay when using infinite loops. To prevent the game freezing, 0-duration looped animations (e.g. a single [CallbackTweener] with no delay) are stopped after a small number of loops, which may produce unexpected results. If a [Tween]'s lifetime depends on some node, always use [method bind_node]. </description> </method> <method name="set_parallel"> @@ -221,7 +221,7 @@ <return type="IntervalTweener" /> <argument index="0" name="time" type="float" /> <description> - Creates and appends an [IntervalTweener]. This method can be used to create delays in the tween animation, as an alternative for using the delay in other [Tweener]s or when there's no animation (in which case the [Tween] acts as a timer). [code]time[/code] is the length of the interval, in seconds. + Creates and appends an [IntervalTweener]. This method can be used to create delays in the tween animation, as an alternative to using the delay in other [Tweener]s, or when there's no animation (in which case the [Tween] acts as a timer). [code]time[/code] is the length of the interval, in seconds. Example: creating an interval in code execution. [codeblock] # ... some code @@ -271,7 +271,7 @@ <argument index="2" name="final_val" type="Variant" /> <argument index="3" name="duration" type="float" /> <description> - Creates and appends a [PropertyTweener]. This method tweens a [code]property[/code] of an [code]object[/code] between an initial value and [code]final_val[/code] in a span of time equal to [code]duration[/code], in seconds. The initial value by default is a value at the time the tweening of the [PropertyTweener] start. For example: + Creates and appends a [PropertyTweener]. This method tweens a [code]property[/code] of an [code]object[/code] between an initial value and [code]final_val[/code] in a span of time equal to [code]duration[/code], in seconds. The initial value by default is the property's value at the time the tweening of the [PropertyTweener] starts. For example: [codeblock] var tween = create_tween() tween.tween_property($Sprite, "position", Vector2(100, 200), 1) @@ -292,19 +292,19 @@ <signal name="finished"> <description> Emitted when the [Tween] has finished all tweening. Never emitted when the [Tween] is set to infinite looping (see [method set_loops]). - [b]Note:[/b] The [Tween] is removed (invalidated) after this signal is emitted, but it doesn't happen immediately, but on the next processing frame. Calling [method stop] inside the signal callback will preserve the [Tween]. + [b]Note:[/b] The [Tween] is removed (invalidated) in the next processing frame after this signal is emitted. Calling [method stop] inside the signal callback will prevent the [Tween] from being removed. </description> </signal> <signal name="loop_finished"> <argument index="0" name="loop_count" type="int" /> <description> - Emitted when a full loop is complete (see [method set_loops]), providing the loop index. This signal is not emitted after final loop, use [signal finished] instead for this case. + Emitted when a full loop is complete (see [method set_loops]), providing the loop index. This signal is not emitted after the final loop, use [signal finished] instead for this case. </description> </signal> <signal name="step_finished"> <argument index="0" name="idx" type="int" /> <description> - Emitted when one step of the [Tween] is complete, providing the step index. One step is either a single [Tweener] or a group of [Tweener]s running parallelly. + Emitted when one step of the [Tween] is complete, providing the step index. One step is either a single [Tweener] or a group of [Tweener]s running in parallel. </description> </signal> </signals> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 6ccc0fc6a6..454db51919 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -85,6 +85,16 @@ Returns the aspect ratio of this vector, the ratio of [member x] to [member y]. </description> </method> + <method name="bezier_interpolate" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="control_1" type="Vector2" /> + <argument index="1" name="control_2" type="Vector2" /> + <argument index="2" name="end" type="Vector2" /> + <argument index="3" name="t" type="float" /> + <description> + Returns the point at the given [code]t[/code] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [code]control_1[/code], [code]control_2[/code], and [code]end[/code] points. + </description> + </method> <method name="bounce" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="n" type="Vector2" /> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index d907ceb52b..c181720a66 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -61,6 +61,16 @@ Returns the unsigned minimum angle to the given vector, in radians. </description> </method> + <method name="bezier_interpolate" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="control_1" type="Vector3" /> + <argument index="1" name="control_2" type="Vector3" /> + <argument index="2" name="end" type="Vector3" /> + <argument index="3" name="t" type="float" /> + <description> + Returns the point at the given [code]t[/code] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [code]control_1[/code], [code]control_2[/code], and [code]end[/code] points. + </description> + </method> <method name="bounce" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="n" type="Vector3" /> diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml index 1ba86c633d..08309a8ecc 100644 --- a/doc/classes/VehicleBody3D.xml +++ b/doc/classes/VehicleBody3D.xml @@ -16,13 +16,13 @@ Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidDynamicBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. </member> <member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" default="0.0"> - Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have [member VehicleWheel3D.use_as_traction] set to [code]true[/code] and are in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + Accelerates the vehicle by applying an engine force. The vehicle is only sped up if the wheels that have [member VehicleWheel3D.use_as_traction] set to [code]true[/code] and are in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. [b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the vehicle reversing. </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" overrides="RigidDynamicBody3D" default="40.0" /> <member name="steering" type="float" setter="set_steering" getter="get_steering" default="0.0"> - The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel3D.use_as_steering] set to [code]true[/code] will automatically be rotated. + The steering angle for the vehicle, in radians. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel3D.use_as_steering] set to [code]true[/code] will automatically be rotated. </member> </members> </class> diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml index 7fc59722e1..ac126f824e 100644 --- a/doc/classes/VehicleWheel3D.xml +++ b/doc/classes/VehicleWheel3D.xml @@ -48,12 +48,12 @@ The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the [member damping_compression] property. For a [member damping_compression] value of 0.3, try a relaxation value of 0.5. </member> <member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" default="0.0"> - Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + Accelerates the wheel by applying an engine force. The wheel is only sped up if it is in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. [b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the wheel reversing. </member> <member name="steering" type="float" setter="set_steering" getter="get_steering" default="0.0"> - The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving. + The steering angle for the wheel, in radians. Setting this to a non-zero value will result in the vehicle turning when it's moving. </member> <member name="suspension_max_force" type="float" setter="set_suspension_max_force" getter="get_suspension_max_force" default="6000.0"> The maximum force the spring can resist. This value should be higher than a quarter of the [member RigidDynamicBody3D.mass] of the [VehicleBody3D] or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number. diff --git a/doc/classes/VideoStreamPlayer.xml b/doc/classes/VideoStreamPlayer.xml index 092a754a39..f6594ff9e7 100644 --- a/doc/classes/VideoStreamPlayer.xml +++ b/doc/classes/VideoStreamPlayer.xml @@ -58,7 +58,7 @@ <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Audio bus to use for sound playback. </member> - <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true"> + <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="false"> If [code]true[/code], the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. </member> <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 148c6d7064..53603b5356 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -57,6 +57,13 @@ Returns the mouse's position in this [Viewport] using the coordinate system of this [Viewport]. </description> </method> + <method name="get_positional_shadow_atlas_quadrant_subdiv" qualifiers="const"> + <return type="int" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" /> + <argument index="0" name="quadrant" type="int" /> + <description> + Returns the [enum PositionalShadowAtlasQuadrantSubdiv] of the specified quadrant. + </description> + </method> <method name="get_render_info"> <return type="int" /> <argument index="0" name="type" type="int" enum="Viewport.RenderInfoType" /> @@ -64,13 +71,6 @@ <description> </description> </method> - <method name="get_shadow_atlas_quadrant_subdiv" qualifiers="const"> - <return type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv" /> - <argument index="0" name="quadrant" type="int" /> - <description> - Returns the [enum ShadowAtlasQuadrantSubdiv] of the specified quadrant. - </description> - </method> <method name="get_texture" qualifiers="const"> <return type="ViewportTexture" /> <description> @@ -158,10 +158,10 @@ Stops the input from propagating further down the [SceneTree]. </description> </method> - <method name="set_shadow_atlas_quadrant_subdiv"> + <method name="set_positional_shadow_atlas_quadrant_subdiv"> <return type="void" /> <argument index="0" name="quadrant" type="int" /> - <argument index="1" name="subdiv" type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv" /> + <argument index="1" name="subdiv" type="int" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" /> <description> Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible. </description> @@ -227,11 +227,29 @@ The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also bilinear scaling 3d [member scaling_3d_mode] for supersampling, which provides higher quality but is much more expensive. </member> <member name="own_world_3d" type="bool" setter="set_use_own_world_3d" getter="is_using_own_world_3d" default="false"> - If [code]true[/code], the viewport will use the [World3D] defined in [member world_3d]. + If [code]true[/code], the viewport will use a unique copy of the [World3D] defined in [member world_3d]. </member> <member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false"> If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process. </member> + <member name="positional_shadow_atlas_16_bits" type="bool" setter="set_positional_shadow_atlas_16_bits" getter="get_positional_shadow_atlas_16_bits" default="true"> + </member> + <member name="positional_shadow_atlas_quad_0" type="int" setter="set_positional_shadow_atlas_quadrant_subdiv" getter="get_positional_shadow_atlas_quadrant_subdiv" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" default="2"> + The subdivision amount of the first quadrant on the shadow atlas. + </member> + <member name="positional_shadow_atlas_quad_1" type="int" setter="set_positional_shadow_atlas_quadrant_subdiv" getter="get_positional_shadow_atlas_quadrant_subdiv" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" default="2"> + The subdivision amount of the second quadrant on the shadow atlas. + </member> + <member name="positional_shadow_atlas_quad_2" type="int" setter="set_positional_shadow_atlas_quadrant_subdiv" getter="get_positional_shadow_atlas_quadrant_subdiv" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" default="3"> + The subdivision amount of the third quadrant on the shadow atlas. + </member> + <member name="positional_shadow_atlas_quad_3" type="int" setter="set_positional_shadow_atlas_quadrant_subdiv" getter="get_positional_shadow_atlas_quadrant_subdiv" enum="Viewport.PositionalShadowAtlasQuadrantSubdiv" default="4"> + The subdivision amount of the fourth quadrant on the shadow atlas. + </member> + <member name="positional_shadow_atlas_size" type="int" setter="set_positional_shadow_atlas_size" getter="get_positional_shadow_atlas_size" default="2048"> + The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. + [b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at all (including directional shadows). + </member> <member name="scaling_3d_mode" type="int" setter="set_scaling_3d_mode" getter="get_scaling_3d_mode" enum="Viewport.Scaling3DMode" default="0"> Sets scaling 3d mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible. To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/mode] project setting. @@ -248,24 +266,6 @@ </member> <member name="sdf_scale" type="int" setter="set_sdf_scale" getter="get_sdf_scale" enum="Viewport.SDFScale" default="1"> </member> - <member name="shadow_atlas_16_bits" type="bool" setter="set_shadow_atlas_16_bits" getter="get_shadow_atlas_16_bits" default="true"> - </member> - <member name="shadow_atlas_quad_0" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" enum="Viewport.ShadowAtlasQuadrantSubdiv" default="2"> - The subdivision amount of the first quadrant on the shadow atlas. - </member> - <member name="shadow_atlas_quad_1" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" enum="Viewport.ShadowAtlasQuadrantSubdiv" default="2"> - The subdivision amount of the second quadrant on the shadow atlas. - </member> - <member name="shadow_atlas_quad_2" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" enum="Viewport.ShadowAtlasQuadrantSubdiv" default="3"> - The subdivision amount of the third quadrant on the shadow atlas. - </member> - <member name="shadow_atlas_quad_3" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" enum="Viewport.ShadowAtlasQuadrantSubdiv" default="4"> - The subdivision amount of the fourth quadrant on the shadow atlas. - </member> - <member name="shadow_atlas_size" type="int" setter="set_shadow_atlas_size" getter="get_shadow_atlas_size" default="2048"> - The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. - [b]Note:[/b] If this is set to 0, shadows won't be visible. - </member> <member name="snap_2d_transforms_to_pixel" type="bool" setter="set_snap_2d_transforms_to_pixel" getter="is_snap_2d_transforms_to_pixel_enabled" default="false"> </member> <member name="snap_2d_vertices_to_pixel" type="bool" setter="set_snap_2d_vertices_to_pixel" getter="is_snap_2d_vertices_to_pixel_enabled" default="false"> @@ -279,9 +279,19 @@ If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D for this viewport. For the root viewport, [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] must be set to [code]true[/code] instead. [b]Note:[/b] Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it, and think whether your scene can actually benefit from occlusion culling. Large, open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([member GeometryInstance3D.visibility_range_begin] and [member GeometryInstance3D.visibility_range_end]) compared to occlusion culling. </member> + <member name="use_taa" type="bool" setter="set_use_taa" getter="is_using_taa" default="false"> + Enables Temporal Anti-Aliasing for this viewport. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. + [b]Note:[/b] The implementation is not complete yet, some visual instances such as particles and skinned meshes may show artifacts. + </member> <member name="use_xr" type="bool" setter="set_use_xr" getter="is_using_xr" default="false"> If [code]true[/code], the viewport will use the primary XR interface to render XR output. When applicable this can result in a stereoscopic image and the resulting render being output to a headset. </member> + <member name="vrs_mode" type="int" setter="set_vrs_mode" getter="get_vrs_mode" enum="Viewport.VRSMode" default="0"> + The Variable Rate Shading (VRS) mode that is used for this viewport. Note, if hardware does not support VRS this property is ignored. + </member> + <member name="vrs_texture" type="Texture2D" setter="set_vrs_texture" getter="get_vrs_texture"> + Texture to use when [member vrs_mode] is set to [constant Viewport.VRS_TEXTURE]. + </member> <member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d"> The custom [World2D] which can be used as 2D environment source. </member> @@ -303,29 +313,29 @@ </signal> </signals> <constants> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED" value="0" enum="ShadowAtlasQuadrantSubdiv"> + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED" value="0" enum="PositionalShadowAtlasQuadrantSubdiv"> This quadrant will not be used. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1" value="1" enum="ShadowAtlasQuadrantSubdiv"> + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1" value="1" enum="PositionalShadowAtlasQuadrantSubdiv"> This quadrant will only be used by one shadow map. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_4" value="2" enum="ShadowAtlasQuadrantSubdiv"> + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_4" value="2" enum="PositionalShadowAtlasQuadrantSubdiv"> This quadrant will be split in 4 and used by up to 4 shadow maps. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_16" value="3" enum="ShadowAtlasQuadrantSubdiv"> + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_16" value="3" enum="PositionalShadowAtlasQuadrantSubdiv"> This quadrant will be split 16 ways and used by up to 16 shadow maps. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_64" value="4" enum="ShadowAtlasQuadrantSubdiv"> + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_64" value="4" enum="PositionalShadowAtlasQuadrantSubdiv"> This quadrant will be split 64 ways and used by up to 64 shadow maps. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_256" value="5" enum="ShadowAtlasQuadrantSubdiv"> - This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the [member shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution. + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_256" value="5" enum="PositionalShadowAtlasQuadrantSubdiv"> + This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the [member positional_shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1024" value="6" enum="ShadowAtlasQuadrantSubdiv"> - This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the [member shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution. + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1024" value="6" enum="PositionalShadowAtlasQuadrantSubdiv"> + This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the [member positional_shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution. </constant> - <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_MAX" value="7" enum="ShadowAtlasQuadrantSubdiv"> - Represents the size of the [enum ShadowAtlasQuadrantSubdiv] enum. + <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_MAX" value="7" enum="PositionalShadowAtlasQuadrantSubdiv"> + Represents the size of the [enum PositionalShadowAtlasQuadrantSubdiv] enum. </constant> <constant name="SCALING_3D_MODE_BILINEAR" value="0" enum="Scaling3DMode"> Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. @@ -441,6 +451,8 @@ </constant> <constant name="DEBUG_DRAW_OCCLUDERS" value="24" enum="DebugDraw"> </constant> + <constant name="DEBUG_DRAW_MOTION_VECTORS" value="25" enum="DebugDraw"> + </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter"> The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. </constant> @@ -486,5 +498,17 @@ </constant> <constant name="SDF_SCALE_MAX" value="3" enum="SDFScale"> </constant> + <constant name="VRS_DISABLED" value="0" enum="VRSMode"> + VRS is disabled. + </constant> + <constant name="VRS_TEXTURE" value="1" enum="VRSMode"> + VRS uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. + </constant> + <constant name="VRS_XR" value="2" enum="VRSMode"> + VRS texture is supplied by the primary [XRInterface]. + </constant> + <constant name="VRS_MAX" value="3" enum="VRSMode"> + Represents the size of the [enum VRSMode] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index 78a681d92a..2468042850 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -66,6 +66,7 @@ <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask"> The render layer(s) this [VisualInstance3D] is drawn on. This object will only be visible for [Camera3D]s whose cull mask includes the render object this [VisualInstance3D] is set to. + For [Light3D]s, this can be used to control which [VisualInstance3D]s are affected by a specific light. For [GPUParticles3D], this can be used to control which particles are effected by a specific attractor. For [Decal]s, this can be used to control which [VisualInstance3D]s are affected by a specific decal. </member> </members> </class> diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml index 5f13e4e7bc..64d901cd79 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -166,10 +166,6 @@ </method> </methods> <members> - <member name="engine_version" type="Dictionary" setter="set_engine_version" getter="get_engine_version" default="{}"> - The Godot version this [VisualShader] was designed for, in the form of a [Dictionary] with [code]major[/code] and [code]minor[/code] keys with integer values. Example: [code]{"major": 4, "minor": 0}[/code] - This is used by the editor to convert visual shaders from older Godot versions. - </member> <member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2(0, 0)"> The offset vector of the whole graph. </member> diff --git a/doc/classes/VisualShaderNodeFloatFunc.xml b/doc/classes/VisualShaderNodeFloatFunc.xml index 0f057b2e6d..1226013c67 100644 --- a/doc/classes/VisualShaderNodeFloatFunc.xml +++ b/doc/classes/VisualShaderNodeFloatFunc.xml @@ -65,7 +65,7 @@ <constant name="FUNC_CEIL" value="16" enum="Function"> Finds the nearest integer that is greater than or equal to the parameter. Translates to [code]ceil(x)[/code] in the Godot Shader Language. </constant> - <constant name="FUNC_FRAC" value="17" enum="Function"> + <constant name="FUNC_FRACT" value="17" enum="Function"> Computes the fractional part of the argument. Translates to [code]fract(x)[/code] in the Godot Shader Language. </constant> <constant name="FUNC_SATURATE" value="18" enum="Function"> diff --git a/doc/classes/VisualShaderNodeTextureUniform.xml b/doc/classes/VisualShaderNodeTextureUniform.xml index b104634da0..bff6f2015d 100644 --- a/doc/classes/VisualShaderNodeTextureUniform.xml +++ b/doc/classes/VisualShaderNodeTextureUniform.xml @@ -27,7 +27,7 @@ No hints are added to the uniform declaration. </constant> <constant name="TYPE_COLOR" value="1" enum="TextureType"> - Adds [code]hint_albedo[/code] as hint to the uniform declaration for proper sRGB to linear conversion. + Adds [code]source_color[/code] as hint to the uniform declaration for proper sRGB to linear conversion. </constant> <constant name="TYPE_NORMAL_MAP" value="2" enum="TextureType"> Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. diff --git a/doc/classes/VisualShaderNodeVectorFunc.xml b/doc/classes/VisualShaderNodeVectorFunc.xml index bc4e12c0b3..7524025f21 100644 --- a/doc/classes/VisualShaderNodeVectorFunc.xml +++ b/doc/classes/VisualShaderNodeVectorFunc.xml @@ -68,7 +68,7 @@ <constant name="FUNC_FLOOR" value="17" enum="Function"> Finds the nearest integer less than or equal to the parameter. </constant> - <constant name="FUNC_FRAC" value="18" enum="Function"> + <constant name="FUNC_FRACT" value="18" enum="Function"> Computes the fractional part of the argument. </constant> <constant name="FUNC_INVERSE_SQRT" value="19" enum="Function"> diff --git a/doc/classes/VoxelGI.xml b/doc/classes/VoxelGI.xml index 55ba1c4934..d941185d33 100644 --- a/doc/classes/VoxelGI.xml +++ b/doc/classes/VoxelGI.xml @@ -37,6 +37,7 @@ </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)"> The size of the area covered by the [VoxelGI]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting. + [b]Note:[/b] Extents are clamped to 1.0 unit or more on each axis. </member> <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="VoxelGI.Subdiv" default="1"> Number of times to subdivide the grid that the [VoxelGI] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 5ce870a899..f4eaaac2e1 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -4,7 +4,8 @@ Base class for all windows. </brief_description> <description> - A node that creates a window. + A node that creates a window. The window can either be a native system window or embedded inside another [Window] (see [member Viewport.gui_embed_subwindows]). + At runtime, [Window]s will not close automatically when requested. You need to handle it manually using [signal close_requested] (this applies both to clicking close button and clicking outside popup). </description> <tutorials> </tutorials> @@ -18,12 +19,13 @@ <method name="child_controls_changed"> <return type="void" /> <description> + Requests an update of the [Window] size to fit underlying [Control] nodes. </description> </method> <method name="get_contents_minimum_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns the combined minimum size from the child [Control] nodes of the window. + Returns the combined minimum size from the child [Control] nodes of the window. Use [method child_controls_changed] to update it when children nodes have changed. </description> </method> <method name="get_flag" qualifiers="const"> @@ -50,6 +52,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns the [Color] at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="get_theme_constant" qualifiers="const"> @@ -57,21 +61,29 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns the constant at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="get_theme_default_base_scale" qualifiers="const"> <return type="float" /> <description> + Returns the default base scale defined in the attached [Theme]. + See [member Theme.default_base_scale] for more details. </description> </method> <method name="get_theme_default_font" qualifiers="const"> <return type="Font" /> <description> + Returns the default [Font] defined in the attached [Theme]. + See [member Theme.default_font] for more details. </description> </method> <method name="get_theme_default_font_size" qualifiers="const"> <return type="int" /> <description> + Returns the default font size defined in the attached [Theme]. + See [member Theme.default_font_size] for more details. </description> </method> <method name="get_theme_font" qualifiers="const"> @@ -80,6 +92,7 @@ <argument index="1" name="theme_type" type="StringName" default="""" /> <description> Returns the [Font] at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="get_theme_font_size" qualifiers="const"> @@ -88,6 +101,7 @@ <argument index="1" name="theme_type" type="StringName" default="""" /> <description> Returns the font size at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="get_theme_icon" qualifiers="const"> @@ -95,6 +109,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns the icon at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="get_theme_stylebox" qualifiers="const"> @@ -102,6 +118,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns the [StyleBox] at [code]name[/code] if the theme has [code]theme_type[/code]. + See [method Control.get_theme_color] for more details. </description> </method> <method name="grab_focus"> @@ -121,6 +139,7 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]theme_type[/code]. </description> </method> <method name="has_theme_constant" qualifiers="const"> @@ -128,6 +147,7 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns [code]true[/code] if constant with [code]name[/code] is in [code]theme_type[/code]. </description> </method> <method name="has_theme_font" qualifiers="const"> @@ -136,7 +156,6 @@ <argument index="1" name="theme_type" type="StringName" default="""" /> <description> Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]theme_type[/code]. - Returns [code]false[/code] if the theme does not have [code]theme_type[/code]. </description> </method> <method name="has_theme_font_size" qualifiers="const"> @@ -145,7 +164,6 @@ <argument index="1" name="theme_type" type="StringName" default="""" /> <description> Returns [code]true[/code] if font size with [code]name[/code] is in [code]theme_type[/code]. - Returns [code]false[/code] if the theme does not have [code]theme_type[/code]. </description> </method> <method name="has_theme_icon" qualifiers="const"> @@ -153,6 +171,7 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns [code]true[/code] if icon with [code]name[/code] is in [code]theme_type[/code]. </description> </method> <method name="has_theme_stylebox" qualifiers="const"> @@ -160,11 +179,13 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" default="""" /> <description> + Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]theme_type[/code]. </description> </method> <method name="hide"> <return type="void" /> <description> + Hides the window. This is not the same as minimized state. Hidden window can't be interacted with and needs to be made visible with [method show]. </description> </method> <method name="is_embedded" qualifiers="const"> @@ -182,28 +203,35 @@ <method name="is_maximize_allowed" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the window can be maximized (the maximize button is enabled). </description> </method> <method name="is_using_font_oversampling" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if font oversampling is enabled. See [method set_use_font_oversampling]. </description> </method> <method name="move_to_foreground"> <return type="void" /> <description> + Moves the [Window] on top of other windows and focuses it. </description> </method> <method name="popup"> <return type="void" /> <argument index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" /> <description> + Shows the [Window] and makes it transient (see [member transient]). If [code]rect[/code] is provided, it will be set as the [Window]'s size. + Fails if called on the main window. </description> </method> <method name="popup_centered"> <return type="void" /> <argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" /> <description> + Popups the [Window] at the center of the current screen, with optionally given minimum size. + If the [Window] is embedded, it will be centered in the parent [Viewport] instead. </description> </method> <method name="popup_centered_clamped"> @@ -211,23 +239,29 @@ <argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" /> <argument index="1" name="fallback_ratio" type="float" default="0.75" /> <description> + Popups the [Window] centered inside its parent [Window]. + [code]fallback_ratio[/code] determines the maximum size of the [Window], in relation to its parent. </description> </method> <method name="popup_centered_ratio"> <return type="void" /> <argument index="0" name="ratio" type="float" default="0.8" /> <description> + Popups the [Window] centered inside its parent [Window] and sets its size as a [code]ratio[/code] of parent's size. </description> </method> <method name="popup_on_parent"> <return type="void" /> <argument index="0" name="parent_rect" type="Rect2i" /> <description> + Popups the [Window] with a position shifted by parent [Window]'s position. + If the [Window] is embedded, has the same effect as [method popup]. </description> </method> <method name="request_attention"> <return type="void" /> <description> + Tells the OS that the [Window] needs an attention. This makes the window stand out in some way depending on the system, e.g. it might blink on the task bar. </description> </method> <method name="reset_size"> @@ -248,12 +282,14 @@ <return type="void" /> <argument index="0" name="active" type="bool" /> <description> + If [code]active[/code] is [code]true[/code], enables system's native IME (Input Method Editor). </description> </method> <method name="set_ime_position"> <return type="void" /> <argument index="0" name="position" type="Vector2i" /> <description> + Moves IME to the given position. </description> </method> <method name="set_layout_direction"> @@ -267,17 +303,19 @@ <return type="void" /> <argument index="0" name="enable" type="bool" /> <description> + Enables font oversampling. This makes fonts look better when they are scaled up. </description> </method> <method name="show"> <return type="void" /> <description> + Makes the [Window] appear. This enables interactions with the [Window] and doesn't change any of its property other than visibility (unlike e.g. [method popup]). </description> </method> </methods> <members> <member name="always_on_top" type="bool" setter="set_flag" getter="get_flag" default="false"> - If [code]true[/code], the window will be on top of all other windows. + If [code]true[/code], the window will be on top of all other windows. Does not work if [member transient] is enabled. </member> <member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true"> Toggles if any text should automatically change to its translated version depending on the current locale. @@ -286,27 +324,36 @@ If [code]true[/code], the window will have no borders. </member> <member name="content_scale_aspect" type="int" setter="set_content_scale_aspect" getter="get_content_scale_aspect" enum="Window.ContentScaleAspect" default="0"> + Specifies how the content's aspect behaves when the [Window] is resized. The base aspect is determined by [member content_scale_size]. </member> <member name="content_scale_factor" type="float" setter="set_content_scale_factor" getter="get_content_scale_factor" default="1.0"> + Specifies the base scale of [Window]'s content when its [member size] is equal to [member content_scale_size]. </member> <member name="content_scale_mode" type="int" setter="set_content_scale_mode" getter="get_content_scale_mode" enum="Window.ContentScaleMode" default="0"> + Specifies how the content is scaled when the [Window] is resized. </member> <member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i(0, 0)"> + Base size of the content (i.e. nodes that are drawn inside the window). If non-zero, [Window]'s content will be scaled when the window is resized to a different size. </member> <member name="current_screen" type="int" setter="set_current_screen" getter="get_current_screen" default="0"> The screen the window is currently on. </member> <member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false"> + If [code]true[/code], the [Window] will be in exclusive mode. Exclusive windows are always on top of their parent and will block all input going to the parent [Window]. + Needs [member transient] enabled to work. </member> <member name="max_size" type="Vector2i" setter="set_max_size" getter="get_max_size" default="Vector2i(0, 0)"> + If non-zero, the [Window] can't be resized to be bigger than this size. </member> <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" default="Vector2i(0, 0)"> + If non-zero, the [Window] can't be resized to be smaller than this size. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Window.Mode" default="0"> Set's the window's current mode. [b]Note:[/b] Fullscreen mode is not exclusive fullscreen on Windows and Linux. </member> <member name="popup_window" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], the [Window] will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless [member exclusive] is enabled). </member> <member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)"> The window's position in pixels. @@ -315,34 +362,46 @@ The window's size in pixels. </member> <member name="theme" type="Theme" setter="set_theme" getter="get_theme"> + The [Theme] resource that determines the style of the underlying [Control] nodes. + [Window] styles will have no effect unless the window is embedded. </member> <member name="theme_type_variation" type="StringName" setter="set_theme_type_variation" getter="get_theme_type_variation" default="&"""> + The name of a theme type variation used by this [Window] to look up its own theme items. See [member Control.theme_type_variation] for more details. </member> <member name="title" type="String" setter="set_title" getter="get_title" default=""""> - The window's title. + The window's title. If the [Window] is non-embedded, title styles set in [Theme] will have no effect. </member> <member name="transient" type="bool" setter="set_transient" getter="is_transient" default="false"> + If [code]true[/code], the [Window] is transient, i.e. it's considered a child of another [Window]. Transient windows can't be in fullscreen mode and will return focus to their parent when closed. + Note that behavior might be different depending on the platform. </member> <member name="transparent" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], the [Window]'s background can be transparent. This is best used with embedded windows. Currently non-embedded [Window] transparency is implemented only for MacOS. </member> <member name="unfocusable" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], the [Window] can't be focused nor interacted with. It can still be visible. </member> <member name="unresizable" type="bool" setter="set_flag" getter="get_flag" default="false"> - If [code]true[/code], the window can't be resized. + If [code]true[/code], the window can't be resized. Minimize and maximize buttons are disabled. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true"> If [code]true[/code], the window is visible. </member> <member name="wrap_controls" type="bool" setter="set_wrap_controls" getter="is_wrapping_controls" default="false"> + If [code]true[/code], the window's size will automatically update when a child node is added or removed. + If [code]false[/code], you need to call [method child_controls_changed] manually. </member> </members> <signals> <signal name="about_to_popup"> <description> + Emitted right after [method popup] call, before the [Window] appears or does anything. </description> </signal> <signal name="close_requested"> <description> + Emitted when the [Window]'s close button is pressed or when [member popup_window] is enabled and user clicks outside the window. + This signal can be used to handle window closing, e.g. by connecting it to [method hide]. </description> </signal> <signal name="files_dropped"> @@ -362,49 +421,58 @@ </signal> <signal name="focus_entered"> <description> + Emitted when the [Window] gains focus. </description> </signal> <signal name="focus_exited"> <description> + Emitted when the [Window] loses its focus. </description> </signal> <signal name="go_back_requested"> <description> + Emitted when a go back request is sent (e.g. pressing the "Back" button on Android), right after [constant Node.NOTIFICATION_WM_GO_BACK_REQUEST]. </description> </signal> <signal name="mouse_entered"> <description> + Emitted when the mouse cursor enters the [Window]'s area, regardless if it's currently focused or not. </description> </signal> <signal name="mouse_exited"> <description> + Emitted when the mouse cursor exits the [Window]'s area (including when it's hovered over another window on top of this one). </description> </signal> <signal name="theme_changed"> <description> + Emitted when the [member theme] is modified or changed to another [Theme]. </description> </signal> <signal name="visibility_changed"> <description> + Emitted when [Window] is made visible or disappears. </description> </signal> <signal name="window_input"> <argument index="0" name="event" type="InputEvent" /> <description> + Emitted when the [Window] is currently focused and receives any input, passing the received event as an argument. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="30"> + Emitted when [Window]'s visibility changes, right before [signal visibility_changed]. </constant> <constant name="MODE_WINDOWED" value="0" enum="Mode"> - Windowed mode. + Windowed mode, i.e. [Window] doesn't occupy whole screen (unless set to the size of the screen). </constant> <constant name="MODE_MINIMIZED" value="1" enum="Mode"> - Minimized window mode. + Minimized window mode, i.e. [Window] is not visible and available on window manager's window list. Normally happens when the minimize button is presesd. </constant> <constant name="MODE_MAXIMIZED" value="2" enum="Mode"> - Maximized window mode. + Maximized window mode, i.e. [Window] will occupy whole screen area except task bar and still display its borders. Normally happens when the minimize button is presesd. </constant> <constant name="MODE_FULLSCREEN" value="3" enum="Mode"> Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. @@ -416,37 +484,49 @@ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode. </constant> <constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags"> - The window's ability to be resized. + The window's ability to be resized. Set with [member unresizable]. </constant> <constant name="FLAG_BORDERLESS" value="1" enum="Flags"> - Borderless window. + Borderless window. Set with [member borderless]. </constant> <constant name="FLAG_ALWAYS_ON_TOP" value="2" enum="Flags"> - Flag for making the window always on top of all other windows. + Flag for making the window always on top of all other windows. Set with [member always_on_top]. </constant> <constant name="FLAG_TRANSPARENT" value="3" enum="Flags"> + Flag for per-pixel transparency. Set with [member transparent]. </constant> <constant name="FLAG_NO_FOCUS" value="4" enum="Flags"> + The window's ability to gain focus. Set with [member unfocusable]. </constant> <constant name="FLAG_POPUP" value="5" enum="Flags"> + Whether the window is popup or a regular window. Set with [member popup_window]. </constant> <constant name="FLAG_MAX" value="6" enum="Flags"> + Max value of the [enum Flags]. </constant> <constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode"> + The content will not be scaled to match the [Window]'s size. </constant> <constant name="CONTENT_SCALE_MODE_CANVAS_ITEMS" value="1" enum="ContentScaleMode"> + The content will be rendered at the target size. This is more performance-expensive than [constant CONTENT_SCALE_MODE_VIEWPORT], but provides better results. </constant> <constant name="CONTENT_SCALE_MODE_VIEWPORT" value="2" enum="ContentScaleMode"> + The content will be rendered at the base size and then scaled to the target size. More performant than [constant CONTENT_SCALE_MODE_CANVAS_ITEMS], but results in pixelated image. </constant> <constant name="CONTENT_SCALE_ASPECT_IGNORE" value="0" enum="ContentScaleAspect"> + The aspect will be ignored. Scaling will simply stretch the content to fit the target size. </constant> <constant name="CONTENT_SCALE_ASPECT_KEEP" value="1" enum="ContentScaleAspect"> + The content's aspect will be preserved. If the target size has different aspect from the base one, the image will be centered and black bars will appear on left and right sides. </constant> <constant name="CONTENT_SCALE_ASPECT_KEEP_WIDTH" value="2" enum="ContentScaleAspect"> + The content can be expanded vertically. Scaling horizontally will result in keeping the width ratio and then black bars on left and right sides. </constant> <constant name="CONTENT_SCALE_ASPECT_KEEP_HEIGHT" value="3" enum="ContentScaleAspect"> + The content can be expanded horizontally. Scaling vertically will result in keeping the height ratio and then black bars on top and bottom sides. </constant> <constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect"> + The content's aspect will be preserved. If the target size has different aspect from the base one, the content will stay in the to-left corner and add an extra visible area in the stretched space. </constant> <constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection"> Automatic layout direction, determined from the parent window layout direction. @@ -463,33 +543,41 @@ </constants> <theme_items> <theme_item name="title_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> + The color of the title's text. </theme_item> <theme_item name="title_outline_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The color of the title outline. + The color of the title's text outline. </theme_item> <theme_item name="close_h_offset" data_type="constant" type="int" default="18"> + Horizontal position offset of the close button. </theme_item> <theme_item name="close_v_offset" data_type="constant" type="int" default="24"> + Vertical position offset of the close button. </theme_item> <theme_item name="resize_margin" data_type="constant" type="int" default="4"> - </theme_item> - <theme_item name="scaleborder_size" data_type="constant" type="int" default="4"> + Defines the outside margin at which the window border can be grabbed with mouse and resized. </theme_item> <theme_item name="title_height" data_type="constant" type="int" default="36"> + Height of the title bar. </theme_item> <theme_item name="title_outline_size" data_type="constant" type="int" default="0"> The size of the title outline. </theme_item> <theme_item name="title_font" data_type="font" type="Font"> + The font used to draw the title. </theme_item> <theme_item name="title_font_size" data_type="font_size" type="int"> The size of the title font. </theme_item> <theme_item name="close" data_type="icon" type="Texture2D"> + The icon for the close button. </theme_item> <theme_item name="close_pressed" data_type="icon" type="Texture2D"> + The icon for the close button when it's being pressed. </theme_item> <theme_item name="embedded_border" data_type="style" type="StyleBox"> + The background style used when the [Window] is embedded. Note that this is drawn only under the window's content, excluding the title. For proper borders and title bar style, you can use [code]expand_margin_*[/code] properties of [StyleBoxFlat]. + [b]Note:[/b] The content background will not be visible unless [member transparent] is enabled. </theme_item> </theme_items> </class> diff --git a/doc/classes/World3D.xml b/doc/classes/World3D.xml index c57029a180..56a662d062 100644 --- a/doc/classes/World3D.xml +++ b/doc/classes/World3D.xml @@ -19,7 +19,7 @@ The World3D's [Environment]. </member> <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment"> - The World3D's fallback_environment will be used if the World3D's [Environment] fails or is missing. + The World3D's fallback environment will be used if [member environment] fails or is missing. </member> <member name="navigation_map" type="RID" setter="" getter="get_navigation_map"> The [RID] of this world's navigation map. Used by the [NavigationServer3D]. diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index 8afe169874..ed8f0b9a04 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -16,6 +16,7 @@ </tutorials> <members> <member name="camera_effects" type="CameraEffects" setter="set_camera_effects" getter="get_camera_effects"> + The [CameraEffects] resource used by this [WorldEnvironment], defining the default properties. This [CameraEffects] resource will be used by all [Camera3D]s that do not define their own [CameraEffects]. </member> <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] resource used by this [WorldEnvironment], defining the default properties. diff --git a/doc/classes/X509Certificate.xml b/doc/classes/X509Certificate.xml index e5d8b45db6..581aba05e4 100644 --- a/doc/classes/X509Certificate.xml +++ b/doc/classes/X509Certificate.xml @@ -6,7 +6,6 @@ <description> The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource]. They can be used as the server certificate in [method StreamPeerSSL.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an SSL server via [method StreamPeerSSL.connect_to_stream]. - [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml index c40a07c40a..79ab33045f 100644 --- a/doc/classes/XMLParser.xml +++ b/doc/classes/XMLParser.xml @@ -32,7 +32,7 @@ <method name="get_current_line" qualifiers="const"> <return type="int" /> <description> - Gets the current line in the parsed file (currently not implemented). + Gets the current line in the parsed file, counting from 0. </description> </method> <method name="get_named_attribute_value" qualifiers="const"> diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml index 71f6a44724..1642ae61f7 100644 --- a/doc/classes/XRInterfaceExtension.xml +++ b/doc/classes/XRInterfaceExtension.xml @@ -106,6 +106,11 @@ Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic. </description> </method> + <method name="_get_vrs_texture" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> <method name="_initialize" qualifiers="virtual"> <return type="bool" /> <description> |