diff options
Diffstat (limited to 'doc/classes')
405 files changed, 10147 insertions, 3262 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 17cb50d1a4..30a2228294 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" /> @@ -266,7 +277,7 @@ - Greater than 1.0 (exclusive): Ease in [/codeblock] [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/ease_cheatsheet.png]ease() curve values cheatsheet[/url] - See also [method smoothstep]. If you need to perform more advanced transitions, use [Tween] or [AnimationPlayer]. + See also [method smoothstep]. If you need to perform more advanced transitions, use [method Tween.interpolate_value]. </description> </method> <method name="error_string"> @@ -457,6 +468,7 @@ rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta [/codeblock] + [b]Note:[/b] This method lerps through the shortest path between [code]from[/code] and [code]to[/code]. However, when these two angles are approximately [code]PI + k * TAU[/code] apart for any integer [code]k[/code], it's not obvious which way they lerp due to floating-point precision errors. For example, [code]lerp_angle(0, PI, weight)[/code] lerps counter-clockwise, while [code]lerp_angle(0, PI + 5 * TAU, weight)[/code] lerps clockwise. </description> </method> <method name="linear2db"> @@ -645,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. @@ -791,12 +813,6 @@ [/codeblock] </description> </method> - <method name="range_step_decimals"> - <return type="int" /> - <argument index="0" name="x" type="float" /> - <description> - </description> - </method> <method name="rid_allocate_id"> <return type="int" /> <description> @@ -1045,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" /> @@ -1185,6 +1222,8 @@ <member name="VisualScriptCustomNodes" type="VisualScriptCustomNodes" setter="" getter=""> The [VisualScriptCustomNodes] singleton. </member> + <member name="WorkerThreadPool" type="WorkerThreadPool" setter="" getter=""> + </member> <member name="XRServer" type="XRServer" setter="" getter=""> The [XRServer] singleton. </member> @@ -1284,6 +1323,9 @@ <constant name="INLINE_ALIGNMENT_TEXT_MASK" value="12" enum="InlineAlignment"> A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants. </constant> + <constant name="KEY_NONE" value="0" enum="Key"> + Enum value which doesn't correspond to any key. This is used to initialize [enum Key] properties with a generic state. + </constant> <constant name="KEY_SPECIAL" value="16777216" enum="Key"> Keycodes with this bit applied are non-printable. </constant> @@ -1416,6 +1458,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> @@ -1461,148 +1560,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"> @@ -2016,7 +2115,7 @@ <constant name="KEY_CODE_MASK" value="33554431" enum="KeyModifierMask"> Key Code mask. </constant> - <constant name="KEY_MODIFIER_MASK" value="-16777216" enum="KeyModifierMask"> + <constant name="KEY_MODIFIER_MASK" value="2130706432" enum="KeyModifierMask"> Modifier key mask. </constant> <constant name="KEY_MASK_SHIFT" value="33554432" enum="KeyModifierMask"> @@ -2040,6 +2139,9 @@ <constant name="KEY_MASK_GROUP_SWITCH" value="1073741824" enum="KeyModifierMask"> Group Switch key mask. </constant> + <constant name="MOUSE_BUTTON_NONE" value="0" enum="MouseButton"> + Enum value which doesn't correspond to any mouse button. This is used to initialize [enum MouseButton] properties with a generic state. + </constant> <constant name="MOUSE_BUTTON_LEFT" value="1" enum="MouseButton"> Left mouse button. </constant> @@ -2184,6 +2286,9 @@ <constant name="JOY_AXIS_MAX" value="10" enum="JoyAxis"> The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes. </constant> + <constant name="MIDI_MESSAGE_NONE" value="0" enum="MIDIMessage"> + Enum value which doesn't correspond to any MIDI message. This is used to initialize [enum MIDIMessage] properties with a generic state. + </constant> <constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MIDIMessage"> MIDI note OFF message. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs. </constant> @@ -2399,10 +2504,11 @@ </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 such as [code]"Hello,Something,Else"[/code]. + Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string. + The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. For integer and float properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending [code]:integer[/code] to the name, e.g. [code]"Zero,One,Three:3,Four,Six:6"[/code]. </constant> <constant name="PROPERTY_HINT_ENUM_SUGGESTION" value="3" enum="PropertyHint"> Hints that a string property can be an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. @@ -2411,51 +2517,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> @@ -2504,97 +2610,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_POINTER" value="40" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="39" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_ARRAY_TYPE" value="39" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_POINTER" value="41" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_LOCALE_ID" value="41" enum="PropertyHint"> + <constant name="PROPERTY_HINT_ARRAY_TYPE" value="40" enum="PropertyHint"> + </constant> + <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_MAX" 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_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"> - Used to group properties together in the editor. + <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"> - Used to group properties together in the editor in a subgroup (under a group). + <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_CLASS_IS_BITFIELD" value="512" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags"> + <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"> @@ -2603,24 +2712,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"> @@ -2632,8 +2734,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. @@ -2680,76 +2782,82 @@ <constant name="TYPE_TRANSFORM2D" value="11" enum="Variant.Type"> Variable is of type [Transform2D]. </constant> - <constant name="TYPE_PLANE" value="12" enum="Variant.Type"> + <constant name="TYPE_VECTOR4" value="12" enum="Variant.Type"> + </constant> + <constant name="TYPE_VECTOR4I" value="13" enum="Variant.Type"> + </constant> + <constant name="TYPE_PLANE" value="14" enum="Variant.Type"> Variable is of type [Plane]. </constant> - <constant name="TYPE_QUATERNION" value="13" enum="Variant.Type"> + <constant name="TYPE_QUATERNION" value="15" enum="Variant.Type"> Variable is of type [Quaternion]. </constant> - <constant name="TYPE_AABB" value="14" enum="Variant.Type"> + <constant name="TYPE_AABB" value="16" enum="Variant.Type"> Variable is of type [AABB]. </constant> - <constant name="TYPE_BASIS" value="15" enum="Variant.Type"> + <constant name="TYPE_BASIS" value="17" enum="Variant.Type"> Variable is of type [Basis]. </constant> - <constant name="TYPE_TRANSFORM3D" value="16" enum="Variant.Type"> + <constant name="TYPE_TRANSFORM3D" value="18" enum="Variant.Type"> Variable is of type [Transform3D]. </constant> - <constant name="TYPE_COLOR" value="17" enum="Variant.Type"> + <constant name="TYPE_PROJECTION" value="19" enum="Variant.Type"> + </constant> + <constant name="TYPE_COLOR" value="20" enum="Variant.Type"> Variable is of type [Color]. </constant> - <constant name="TYPE_STRING_NAME" value="18" enum="Variant.Type"> + <constant name="TYPE_STRING_NAME" value="21" enum="Variant.Type"> Variable is of type [StringName]. </constant> - <constant name="TYPE_NODE_PATH" value="19" enum="Variant.Type"> + <constant name="TYPE_NODE_PATH" value="22" enum="Variant.Type"> Variable is of type [NodePath]. </constant> - <constant name="TYPE_RID" value="20" enum="Variant.Type"> + <constant name="TYPE_RID" value="23" enum="Variant.Type"> Variable is of type [RID]. </constant> - <constant name="TYPE_OBJECT" value="21" enum="Variant.Type"> + <constant name="TYPE_OBJECT" value="24" enum="Variant.Type"> Variable is of type [Object]. </constant> - <constant name="TYPE_CALLABLE" value="22" enum="Variant.Type"> + <constant name="TYPE_CALLABLE" value="25" enum="Variant.Type"> Variable is of type [Callable]. </constant> - <constant name="TYPE_SIGNAL" value="23" enum="Variant.Type"> + <constant name="TYPE_SIGNAL" value="26" enum="Variant.Type"> Variable is of type [Signal]. </constant> - <constant name="TYPE_DICTIONARY" value="24" enum="Variant.Type"> + <constant name="TYPE_DICTIONARY" value="27" enum="Variant.Type"> Variable is of type [Dictionary]. </constant> - <constant name="TYPE_ARRAY" value="25" enum="Variant.Type"> + <constant name="TYPE_ARRAY" value="28" enum="Variant.Type"> Variable is of type [Array]. </constant> - <constant name="TYPE_PACKED_BYTE_ARRAY" value="26" enum="Variant.Type"> + <constant name="TYPE_PACKED_BYTE_ARRAY" value="29" enum="Variant.Type"> Variable is of type [PackedByteArray]. </constant> - <constant name="TYPE_PACKED_INT32_ARRAY" value="27" enum="Variant.Type"> + <constant name="TYPE_PACKED_INT32_ARRAY" value="30" enum="Variant.Type"> Variable is of type [PackedInt32Array]. </constant> - <constant name="TYPE_PACKED_INT64_ARRAY" value="28" enum="Variant.Type"> + <constant name="TYPE_PACKED_INT64_ARRAY" value="31" enum="Variant.Type"> Variable is of type [PackedInt64Array]. </constant> - <constant name="TYPE_PACKED_FLOAT32_ARRAY" value="29" enum="Variant.Type"> + <constant name="TYPE_PACKED_FLOAT32_ARRAY" value="32" enum="Variant.Type"> Variable is of type [PackedFloat32Array]. </constant> - <constant name="TYPE_PACKED_FLOAT64_ARRAY" value="30" enum="Variant.Type"> + <constant name="TYPE_PACKED_FLOAT64_ARRAY" value="33" enum="Variant.Type"> Variable is of type [PackedFloat64Array]. </constant> - <constant name="TYPE_PACKED_STRING_ARRAY" value="31" enum="Variant.Type"> + <constant name="TYPE_PACKED_STRING_ARRAY" value="34" enum="Variant.Type"> Variable is of type [PackedStringArray]. </constant> - <constant name="TYPE_PACKED_VECTOR2_ARRAY" value="32" enum="Variant.Type"> + <constant name="TYPE_PACKED_VECTOR2_ARRAY" value="35" enum="Variant.Type"> Variable is of type [PackedVector2Array]. </constant> - <constant name="TYPE_PACKED_VECTOR3_ARRAY" value="33" enum="Variant.Type"> + <constant name="TYPE_PACKED_VECTOR3_ARRAY" value="36" enum="Variant.Type"> Variable is of type [PackedVector3Array]. </constant> - <constant name="TYPE_PACKED_COLOR_ARRAY" value="34" enum="Variant.Type"> + <constant name="TYPE_PACKED_COLOR_ARRAY" value="37" enum="Variant.Type"> Variable is of type [PackedColorArray]. </constant> - <constant name="TYPE_MAX" value="35" enum="Variant.Type"> + <constant name="TYPE_MAX" value="38" enum="Variant.Type"> Represents the size of the [enum Variant.Type] enum. </constant> <constant name="OP_EQUAL" value="0" enum="Variant.Operator"> @@ -2791,40 +2899,43 @@ <constant name="OP_MODULE" value="12" enum="Variant.Operator"> Remainder/modulo operator ([code]%[/code]). </constant> - <constant name="OP_SHIFT_LEFT" value="13" enum="Variant.Operator"> + <constant name="OP_POWER" value="13" enum="Variant.Operator"> + Power operator ([code]**[/code]). + </constant> + <constant name="OP_SHIFT_LEFT" value="14" enum="Variant.Operator"> Left shift operator ([code]<<[/code]). </constant> - <constant name="OP_SHIFT_RIGHT" value="14" enum="Variant.Operator"> + <constant name="OP_SHIFT_RIGHT" value="15" enum="Variant.Operator"> Right shift operator ([code]>>[/code]). </constant> - <constant name="OP_BIT_AND" value="15" enum="Variant.Operator"> + <constant name="OP_BIT_AND" value="16" enum="Variant.Operator"> Bitwise AND operator ([code]&[/code]). </constant> - <constant name="OP_BIT_OR" value="16" enum="Variant.Operator"> + <constant name="OP_BIT_OR" value="17" enum="Variant.Operator"> Bitwise OR operator ([code]|[/code]). </constant> - <constant name="OP_BIT_XOR" value="17" enum="Variant.Operator"> + <constant name="OP_BIT_XOR" value="18" enum="Variant.Operator"> Bitwise XOR operator ([code]^[/code]). </constant> - <constant name="OP_BIT_NEGATE" value="18" enum="Variant.Operator"> + <constant name="OP_BIT_NEGATE" value="19" enum="Variant.Operator"> Bitwise NOT operator ([code]~[/code]). </constant> - <constant name="OP_AND" value="19" enum="Variant.Operator"> + <constant name="OP_AND" value="20" enum="Variant.Operator"> Logical AND operator ([code]and[/code] or [code]&&[/code]). </constant> - <constant name="OP_OR" value="20" enum="Variant.Operator"> + <constant name="OP_OR" value="21" enum="Variant.Operator"> Logical OR operator ([code]or[/code] or [code]||[/code]). </constant> - <constant name="OP_XOR" value="21" enum="Variant.Operator"> + <constant name="OP_XOR" value="22" enum="Variant.Operator"> Logical XOR operator (not implemented in GDScript). </constant> - <constant name="OP_NOT" value="22" enum="Variant.Operator"> + <constant name="OP_NOT" value="23" enum="Variant.Operator"> Logical NOT operator ([code]not[/code] or [code]![/code]). </constant> - <constant name="OP_IN" value="23" enum="Variant.Operator"> + <constant name="OP_IN" value="24" enum="Variant.Operator"> Logical IN operator ([code]in[/code]). </constant> - <constant name="OP_MAX" value="24" enum="Variant.Operator"> + <constant name="OP_MAX" value="25" enum="Variant.Operator"> Represents the size of the [enum Variant.Operator] enum. </constant> </constants> diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index 6e4a4a2145..db880efaf2 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -228,11 +228,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="AABB" /> <description> Returns [code]true[/code] if the vectors are not equal. @@ -248,11 +243,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="AABB" /> <description> Returns [code]true[/code] if the AABBs are exactly equal. diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 2dde3ad340..c05fb885b9 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -4,7 +4,7 @@ AStar class representation that uses 2D vectors as edges. </brief_description> <description> - This is a wrapper for the [AStar] class which uses 2D vectors instead of 3D vectors. + This is a wrapper for the [AStar3D] class which uses 2D vectors instead of 3D vectors. </description> <tutorials> </tutorials> @@ -33,7 +33,7 @@ <argument index="1" name="position" type="Vector2" /> <argument index="2" name="weight_scale" type="float" default="1.0" /> <description> - Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. + Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 0.0 or greater. The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [code]weight_scale[/code]s to form a path. [codeblocks] [gdscript] @@ -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/AStar.xml b/doc/classes/AStar3D.xml index cb76fe8cf6..ea4e49c173 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar3D.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AStar" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AStar3D" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> An implementation of A* to find the shortest paths among connected points in space. </brief_description> <description> A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path]. - It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. + It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar3D[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. [codeblocks] [gdscript] class MyAStar: - extends AStar + extends AStar3D func _compute_cost(u, v): return abs(u - v) @@ -19,7 +19,7 @@ return min(0, abs(u - v) - 1) [/gdscript] [csharp] - public class MyAStar : AStar + public class MyAStar : AStar3D { public override float _ComputeCost(int u, int v) { @@ -44,7 +44,7 @@ <argument index="1" name="to_id" type="int" /> <description> Called when computing the cost between two connected points. - Note that this function is hidden in the default [code]AStar[/code] class. + Note that this function is hidden in the default [code]AStar3D[/code] class. </description> </method> <method name="_estimate_cost" qualifiers="virtual const"> @@ -53,7 +53,7 @@ <argument index="1" name="to_id" type="int" /> <description> Called when estimating the cost between a point and the path's ending point. - Note that this function is hidden in the default [code]AStar[/code] class. + Note that this function is hidden in the default [code]AStar3D[/code] class. </description> </method> <method name="add_point"> @@ -62,15 +62,15 @@ <argument index="1" name="position" type="Vector3" /> <argument index="2" name="weight_scale" type="float" default="1.0" /> <description> - Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. + Adds a new point at the given position with the given identifier. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 0.0 or greater. The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [code]weight_scale[/code]s to form a path. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1 [/csharp] [/codeblocks] @@ -101,13 +101,13 @@ Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(1, 1, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2, false) [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(1, 1, 0)); astar.AddPoint(2, new Vector3(0, 5, 0)); astar.ConnectPoints(1, 2, false); @@ -146,14 +146,14 @@ Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 5, 0)); astar.ConnectPoints(1, 2); @@ -164,14 +164,14 @@ </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> - Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. + Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 astar.add_point(3, Vector3(1, 1, 0)) @@ -185,7 +185,7 @@ var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1 astar.AddPoint(3, new Vector3(1, 1, 0)); @@ -207,13 +207,13 @@ </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. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0)) astar.add_point(3, Vector3(1, 1, 0)) @@ -225,7 +225,7 @@ var neighbors = astar.get_point_connections(1) # Returns [2, 3] [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 1, 0)); astar.AddPoint(3, new Vector3(1, 1, 0)); @@ -255,7 +255,7 @@ <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> <description> - Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. + Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message. </description> </method> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 4836f48a57..0009c82548 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -61,6 +61,9 @@ <member name="dialog_autowrap" type="bool" setter="set_autowrap" getter="has_autowrap" default="false"> 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. [b]Note:[/b] Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example [FileDialog] defaults to [code]false[/code], and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in [FileDialog] to disable hiding the dialog when pressing OK. @@ -69,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/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index e89134d1ac..638d142791 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimatedSprite2D" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Sprite node that can use multiple textures for animation. + Sprite node that contains multiple textures as frames to play for animation. </brief_description> <description> - Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel. + [AnimatedSprite2D] is similar to the [Sprite2D] node, except it carries multiple textures as animation frames. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps. </description> <tutorials> @@ -29,7 +29,7 @@ </methods> <members> <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&"default""> - The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset. + The current animation from the [member frames] resource. If this value changes, the [code]frame[/code] counter is reset. </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true"> If [code]true[/code], texture will be centered. @@ -44,7 +44,7 @@ The displayed animation frame's index. </member> <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> - The [SpriteFrames] resource containing the animation(s). + The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [SpriteFrames] resource. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml new file mode 100644 index 0000000000..d856c65dfc --- /dev/null +++ b/doc/classes/AnimationLibrary.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AnimationLibrary" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_animation"> + <return type="int" enum="Error" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="animation" type="Animation" /> + <description> + </description> + </method> + <method name="get_animation" qualifiers="const"> + <return type="Animation" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> + <method name="has_animation" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="remove_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="rename_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="newname" type="StringName" /> + <description> + </description> + </method> + </methods> + <members> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{}"> + </member> + </members> + <signals> + <signal name="animation_added"> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </signal> + <signal name="animation_removed"> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </signal> + <signal name="animation_renamed"> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="to_name" type="StringName" /> + <description> + </description> + </signal> + </signals> +</class> 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/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 20eb349363..fcdd09f144 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -4,7 +4,8 @@ [AnimationTree] node resource that contains many blend type nodes. </brief_description> <description> - This node may contain a sub-tree of any other blend type nodes, such as mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots. + This node may contain a sub-tree of any other blend type nodes, such as [AnimationNodeTransition], [AnimationNodeBlend2], [AnimationNodeBlend3], [AnimationNodeOneShot], etc. This is one of the most commonly used roots. + An [AnimationNodeOutput] node named [code]output[/code] is created by default. </description> <tutorials> <link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> 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/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index 2cafdf8aaa..6140dd799f 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -39,12 +39,6 @@ Adds a transition between the given nodes. </description> </method> - <method name="get_end_node" qualifiers="const"> - <return type="String" /> - <description> - Returns the graph's end node. - </description> - </method> <method name="get_graph_offset" qualifiers="const"> <return type="Vector2" /> <description> @@ -72,12 +66,6 @@ Returns the given node's coordinates. Used for display in the editor. </description> </method> - <method name="get_start_node" qualifiers="const"> - <return type="String" /> - <description> - Returns the graph's end node. - </description> - </method> <method name="get_transition" qualifiers="const"> <return type="AnimationNodeStateMachineTransition" /> <argument index="0" name="idx" type="int" /> @@ -157,13 +145,6 @@ <description> </description> </method> - <method name="set_end_node"> - <return type="void" /> - <argument index="0" name="name" type="StringName" /> - <description> - Sets the given node as the graph end point. - </description> - </method> <method name="set_graph_offset"> <return type="void" /> <argument index="0" name="offset" type="Vector2" /> @@ -179,12 +160,5 @@ Sets the node's coordinates. Used for display in the editor. </description> </method> - <method name="set_start_node"> - <return type="void" /> - <argument index="0" name="name" type="StringName" /> - <description> - Sets the given node as the graph start point. - </description> - </method> </methods> </class> diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index 94e6a2f23d..0badb831de 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 explicitly 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 b1d04ce1f2..b24c439432 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -14,12 +14,11 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> - <method name="add_animation"> + <method name="add_animation_library"> <return type="int" enum="Error" /> <argument index="0" name="name" type="StringName" /> - <argument index="1" name="animation" type="Animation" /> + <argument index="1" name="library" type="AnimationLibrary" /> <description> - Adds [code]animation[/code] to the player accessible with the key [code]name[/code]. </description> </method> <method name="advance"> @@ -63,6 +62,12 @@ Returns the name of [code]animation[/code] or an empty string if not found. </description> </method> + <method name="find_animation_library" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="animation" type="Animation" /> + <description> + </description> + </method> <method name="get_animation" qualifiers="const"> <return type="Animation" /> <argument index="0" name="name" type="StringName" /> @@ -70,6 +75,17 @@ Returns the [Animation] with key [code]name[/code] or [code]null[/code] if not found. </description> </method> + <method name="get_animation_library" qualifiers="const"> + <return type="AnimationLibrary" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_library_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> <method name="get_animation_list" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -103,6 +119,12 @@ Returns [code]true[/code] if the [AnimationPlayer] stores an [Animation] with key [code]name[/code]. </description> </method> + <method name="has_animation_library" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> <method name="is_playing" qualifiers="const"> <return type="bool" /> <description> @@ -138,19 +160,17 @@ [b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. </description> </method> - <method name="remove_animation"> + <method name="remove_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <description> - Removes the animation with key [code]name[/code]. </description> </method> - <method name="rename_animation"> + <method name="rename_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <argument index="1" name="newname" type="StringName" /> <description> - Renames an existing animation with key [code]name[/code] to [code]newname[/code]. </description> </method> <method name="seek"> @@ -159,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"> @@ -199,6 +220,10 @@ <member name="method_call_mode" type="int" setter="set_method_call_mode" getter="get_method_call_mode" enum="AnimationPlayer.AnimationMethodCallMode" default="0"> The call mode to use for Call Method tracks. </member> + <member name="movie_quit_on_finish" type="bool" setter="set_movie_quit_on_finish_enabled" getter="is_movie_quit_on_finish_enabled" default="false"> + If [code]true[/code] and the engine is running in Movie Maker mode (see [MovieWriter]), exits the engine with [method SceneTree.quit] as soon as an animation is done playing in this [AnimationPlayer]. A message is printed when the engine quits for this reason. + [b]Note:[/b] This obeys the same logic as the [signal animation_finished] signal, so it will not quit the engine if the animation is set to be looping. + </member> <member name="playback_active" type="bool" setter="set_active" getter="is_active"> If [code]true[/code], updates animations in response to process-related notifications. </member> @@ -232,6 +257,7 @@ <argument index="0" name="anim_name" type="StringName" /> <description> Notifies when an animation finished playing. + [b]Note:[/b] This signal is not emitted if an animation is looping. </description> </signal> <signal name="animation_started"> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index 67e64c6bee..45d9152564 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 explicitly 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/Area2D.xml b/doc/classes/Area2D.xml index ed3f873251..1eb74768f5 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -118,8 +118,8 @@ Emitted when one of another Area2D's [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [code]area_rid[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. [code]area[/code] the other Area2D. - [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area.shape_find_owner(area_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="area_shape_exited"> @@ -131,8 +131,8 @@ Emitted when one of another Area2D's [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [code]area_rid[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. [code]area[/code] the other Area2D. - [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area.shape_find_owner(area_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_entered"> @@ -158,8 +158,8 @@ Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. [code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap]. - [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_shape_exited"> @@ -171,8 +171,8 @@ Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. [code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap]. - [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> </signals> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 3d893c1ae4..7d14fd825b 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -137,8 +137,8 @@ Emitted when one of another Area3D's [Shape3D]s enters one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [code]area_rid[/code] the [RID] of the other Area3D's [CollisionObject3D] used by the [PhysicsServer3D]. [code]area[/code] the other Area3D. - [code]area_shape_index[/code] the index of the [Shape3D] of the other Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]area_shape_index[/code] the index of the [Shape3D] of the other Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]area.shape_owner_get_owner(area.shape_find_owner(area_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="area_shape_exited"> @@ -150,8 +150,8 @@ Emitted when one of another Area3D's [Shape3D]s exits one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [code]area_rid[/code] the [RID] of the other Area3D's [CollisionObject3D] used by the [PhysicsServer3D]. [code]area[/code] the other Area3D. - [code]area_shape_index[/code] the index of the [Shape3D] of the other Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]area_shape_index[/code] the index of the [Shape3D] of the other Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]area.shape_owner_get_owner(area.shape_find_owner(area_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_entered"> @@ -177,8 +177,8 @@ Emitted when one of a [PhysicsBody3D] or [GridMap]'s [Shape3D]s enters one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. [code]body_rid[/code] the [RID] of the [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody3D] or [GridMap]. - [code]body_shape_index[/code] the index of the [Shape3D] of the [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape3D] of the [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_shape_exited"> @@ -190,8 +190,8 @@ Emitted when one of a [PhysicsBody3D] or [GridMap]'s [Shape3D]s enters one of this Area3D's [Shape3D]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. [code]body_rid[/code] the [RID] of the [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody3D] or [GridMap]. - [code]body_shape_index[/code] the index of the [Shape3D] of the [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape3D] of the [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this Area3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> </signals> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 6852fb5228..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" /> @@ -194,7 +240,7 @@ <return type="void" /> <argument index="0" name="value" type="Variant" /> <description> - Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead. + Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] instead. [b]Note:[/b] This method acts in-place and doesn't return a value. [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. </description> @@ -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"> @@ -511,60 +560,58 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> + Compares the left operand [Array] against the [code]right[/code] [Array]. Returns [code]true[/code] if the sizes or contents of the arrays are [i]not[/i] equal, [code]false[/code] otherwise. </description> </operator> <operator name="operator +"> <return type="Array" /> <argument index="0" name="right" type="Array" /> <description> + Concatenates two [Array]s together, with the [code]right[/code] [Array] being added to the end of the [Array] specified in the left operand. For example, [code][1, 2] + [3, 4][/code] results in [code][1, 2, 3, 4][/code]. </description> </operator> <operator name="operator <"> <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> + Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]false[/code] if the left operand [Array] has less elements, otherwise it returns [code]true[/code]. </description> </operator> <operator name="operator <="> <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> - <description> + Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the left operand [Array] has less or the same number of elements, otherwise it returns [code]false[/code]. </description> </operator> <operator name="operator =="> <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> + Compares the left operand [Array] against the [code]right[/code] [Array]. Returns [code]true[/code] if the sizes and contents of the arrays are equal, [code]false[/code] otherwise. </description> </operator> <operator name="operator >"> <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> + Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [code]right[/code] [Array] has more elements, otherwise it returns [code]false[/code]. </description> </operator> <operator name="operator >="> <return type="bool" /> <argument index="0" name="right" type="Array" /> <description> + Performs a comparison for each index between the left operand [Array] and the [code]right[/code] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [code]right[/code] [Array] has more or the same number of elements, otherwise it returns [code]false[/code]. </description> </operator> <operator name="operator []"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> + Returns a reference to the element of type [Variant] at the specified location. Arrays start at index 0. [code]index[/code] can be a zero or positive value to start from the beginning, or a negative value to start from the end. Out-of-bounds array access causes a run-time error, which will result in an error being printed and the project execution pausing if run from the editor. </description> </operator> </operators> diff --git a/doc/classes/AspectRatioContainer.xml b/doc/classes/AspectRatioContainer.xml index 41e06e6e98..e7847ba05c 100644 --- a/doc/classes/AspectRatioContainer.xml +++ b/doc/classes/AspectRatioContainer.xml @@ -7,6 +7,7 @@ Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <members> <member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignmentMode" default="1"> @@ -34,7 +35,7 @@ </constant> <constant name="STRETCH_COVER" value="3" enum="StretchMode"> The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio. - When the bounding rectangle of child controls exceed the container's size and [member Control.rect_clip_content] is enabled, this allows to show only the container's area restricted by its own bounding rectangle. + When the bounding rectangle of child controls exceed the container's size and [member Control.clip_contents] is enabled, this allows to show only the container's area restricted by its own bounding rectangle. </constant> <constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode"> Aligns child controls with the beginning (left or top) of the container. diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml index 424669eab9..5bfa5be0ca 100644 --- a/doc/classes/AudioEffect.xml +++ b/doc/classes/AudioEffect.xml @@ -9,4 +9,11 @@ <tutorials> <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link> </tutorials> + <methods> + <method name="_instantiate" qualifiers="virtual"> + <return type="AudioEffectInstance" /> + <description> + </description> + </method> + </methods> </class> 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/AudioEffectInstance.xml b/doc/classes/AudioEffectInstance.xml index 369b4130d4..f50246d6ca 100644 --- a/doc/classes/AudioEffectInstance.xml +++ b/doc/classes/AudioEffectInstance.xml @@ -6,4 +6,19 @@ </description> <tutorials> </tutorials> + <methods> + <method name="_process" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="src_buffer" type="const void*" /> + <argument index="1" name="dst_buffer" type="AudioFrame*" /> + <argument index="2" name="frame_count" type="int" /> + <description> + </description> + </method> + <method name="_process_silence" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + </methods> </class> 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 ff176c6ad8..088d61189f 100644 --- a/doc/classes/AudioEffectStereoEnhance.xml +++ b/doc/classes/AudioEffectStereoEnhance.xml @@ -1,13 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectStereoEnhance" inherits="AudioEffect" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + An audio effect that can be used to adjust the intensity of stereo panning. </brief_description> <description> + 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"> + Values greater than 1.0 increase intensity of any panning on audio passing through this effect, whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix audio to mono. </member> <member name="surround" type="float" setter="set_surround" getter="get_surround" default="0.0"> </member> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 1e076654fb..28dcd2794e 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -275,6 +275,12 @@ Sets the volume of the bus at index [code]bus_idx[/code] to [code]volume_db[/code]. </description> </method> + <method name="set_enable_tagging_used_audio_streams"> + <return type="void" /> + <argument index="0" name="enable" type="bool" /> + <description> + </description> + </method> <method name="swap_bus_effects"> <return type="void" /> <argument index="0" name="bus_idx" type="int" /> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 1e6f700c7c..68f64505d0 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -13,6 +13,16 @@ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link> </tutorials> <methods> + <method name="_get_beat_count" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_bpm" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> <method name="_get_length" qualifiers="virtual const"> <return type="float" /> <description> @@ -23,7 +33,7 @@ <description> </description> </method> - <method name="_instance_playback" qualifiers="virtual const"> + <method name="_instantiate_playback" qualifiers="virtual const"> <return type="AudioStreamPlayback" /> <description> </description> @@ -39,6 +49,12 @@ Returns the length of the audio stream in seconds. </description> </method> + <method name="instantiate_playback"> + <return type="AudioStreamPlayback" /> + <description> + Returns an AudioStreamPlayback. Useful for when you want to extend [method _instantiate_playback] but call [method instantiate_playback] from an internally held AudioStream subresource. An example of this can be found in the source files for [code]AudioStreamRandomPitch::instantiate_playback[/code]. + </description> + </method> <method name="is_monophonic" qualifiers="const"> <return type="bool" /> <description> diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml index 78a1ed7c51..c8f081215d 100644 --- a/doc/classes/AudioStreamGenerator.xml +++ b/doc/classes/AudioStreamGenerator.xml @@ -6,7 +6,7 @@ <description> This audio stream does not play back sounds, but expects a script to generate audio data for it instead. See also [AudioStreamGeneratorPlayback]. See also [AudioEffectSpectrumAnalyzer] for performing real-time audio spectrum analysis. - [b]Note:[/b] Due to performance constraints, this class is best used from C# or from a compiled language via GDNative. If you still want to use this class from GDScript, consider using a lower [member mix_rate] such as 11,025 Hz or 22,050 Hz. + [b]Note:[/b] Due to performance constraints, this class is best used from C# or from a compiled language via GDExtension. If you still want to use this class from GDScript, consider using a lower [member mix_rate] such as 11,025 Hz or 22,050 Hz. </description> <tutorials> <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index 1cd82026a0..06c285bff7 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -39,14 +39,14 @@ <return type="bool" /> <argument index="0" name="frames" type="PackedVector2Array" /> <description> - Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDNative, but [method push_buffer] may be [i]less[/i] efficient in GDScript. + Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDExtension, but [method push_buffer] may be [i]less[/i] efficient in GDScript. </description> </method> <method name="push_frame"> <return type="bool" /> <argument index="0" name="frame" type="Vector2" /> <description> - Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDNative, but [method push_frame] may be [i]more[/i] efficient in GDScript. + Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDExtension, but [method push_frame] may be [i]more[/i] efficient in GDScript. </description> </method> </methods> diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml index 1909c4b621..d3d97e0c8a 100644 --- a/doc/classes/AudioStreamPlayback.xml +++ b/doc/classes/AudioStreamPlayback.xml @@ -50,5 +50,10 @@ <description> </description> </method> + <method name="_tag_used_streams" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> </methods> </class> diff --git a/doc/classes/AudioStreamPlaybackResampled.xml b/doc/classes/AudioStreamPlaybackResampled.xml index 228b8c19c0..eb41e4256e 100644 --- a/doc/classes/AudioStreamPlaybackResampled.xml +++ b/doc/classes/AudioStreamPlaybackResampled.xml @@ -6,4 +6,23 @@ </description> <tutorials> </tutorials> + <methods> + <method name="_get_stream_sampling_rate" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> + <method name="_mix_resampled" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="dst_buffer" type="AudioFrame*" /> + <argument index="1" name="frame_count" type="int" /> + <description> + </description> + </method> + <method name="begin_resample"> + <return type="void" /> + <description> + </description> + </method> + </methods> </class> 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/BaseButton.xml b/doc/classes/BaseButton.xml index 8e73a0dd91..13fe75a3e3 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -44,25 +44,24 @@ </method> </methods> <members> - <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode" default="1"> + <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode"> Determines when the button is considered clicked, one of the [enum ActionMode] constants. </member> <member name="button_group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> The [ButtonGroup] associated with the button. Not to be confused with node groups. </member> - <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButton" default="1"> + <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButton"> Binary mask to choose which mouse buttons this button will respond to. To allow both left-click and right-click, use [code]MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT[/code]. </member> - <member name="button_pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> + <member name="button_pressed" type="bool" setter="set_pressed" getter="is_pressed"> If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active). Only works if [member toggle_mode] is [code]true[/code]. [b]Note:[/b] Setting [member button_pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal]. </member> - <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false"> + <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled"> If [code]true[/code], the button is in disabled state and can't be clicked or toggled. </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> - <member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside" default="false"> + <member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside"> If [code]true[/code], the button stays pressed when moving the cursor outside the button while pressing it. [b]Note:[/b] This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value. </member> @@ -72,10 +71,10 @@ <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> The [Node] which must be a parent of the focused GUI [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. </member> - <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true"> + <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled"> If [code]true[/code], the button will add information about its shortcut in the tooltip. </member> - <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" default="false"> + <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode"> If [code]true[/code], the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. </member> </members> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 9abdddfa5e..b3cea7217e 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -59,12 +59,18 @@ <members> <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color(1, 1, 1, 1)"> The material's base color. - </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. + [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_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. @@ -132,8 +138,8 @@ If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. [b]Note:[/b] Clearcoat rendering is not visible if the material's [member shading_mode] is [constant SHADING_MODE_UNSHADED]. </member> - <member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss" default="0.5"> - Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat. + <member name="clearcoat_roughness" type="float" setter="set_clearcoat_roughness" getter="get_clearcoat_roughness" default="0.5"> + Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat. </member> <member name="clearcoat_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel. @@ -145,19 +151,20 @@ Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member transparency]. </member> <member name="detail_albedo" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture that specifies the color of the detail overlay. + Texture that specifies the color of the detail overlay. [member detail_albedo]'s alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, see [member detail_mask]. + [b]Note:[/b] [member detail_albedo] is [i]not[/i] modulated by [member albedo_color]. </member> <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" enum="BaseMaterial3D.BlendMode" default="0"> Specifies how the [member detail_albedo] should blend with the current [code]ALBEDO[/code]. See [enum BlendMode] for options. </member> <member name="detail_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> - If [code]true[/code], enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on [member detail_mask]. This can be used to add variation to objects, or to blend between two different albedo/normal textures. + If [code]true[/code], enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on [member detail_mask] and [member detail_albedo]'s alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures. </member> <member name="detail_mask" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture used to specify how the detail textures get blended with the base textures. + Texture used to specify how the detail textures get blended with the base textures. [member detail_mask] can be used together with [member detail_albedo]'s alpha channel (if any). </member> <member name="detail_normal" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture that specifies the per-pixel normal of the detail overlay. + Texture that specifies the per-pixel normal of the detail overlay. The [member detail_normal] texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member detail_normal] is oriented around the surface normal provided by the [Mesh]. [b]Note:[/b] Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. </member> <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" enum="BaseMaterial3D.DetailUV" default="0"> @@ -243,6 +250,12 @@ <member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0"> Specifies the channel of the [member metallic_texture] in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. </member> + <member name="msdf_outline_size" type="float" setter="set_msdf_outline_size" getter="get_msdf_outline_size" default="0.0"> + The width of the shape outine. + </member> + <member name="msdf_pixel_range" type="float" setter="set_msdf_pixel_range" getter="get_msdf_pixel_range" default="4.0"> + The width of the range around the shape between the minimum and maximum representable signed distance. + </member> <member name="no_depth_test" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], depth testing is disabled and the object will be drawn in render order. </member> @@ -253,9 +266,10 @@ The strength of the normal map's effect. </member> <member name="normal_texture" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture used to specify the normal at a given pixel. The [code]normal_texture[/code] only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [code]normal_texture[/code] is oriented around the surface normal provided by the [Mesh]. + Texture used to specify the normal at a given pixel. The [member normal_texture] only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member normal_texture] is oriented around the surface normal provided by the [Mesh]. [b]Note:[/b] The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with [SurfaceTool], you can use [method SurfaceTool.generate_normals] and [method SurfaceTool.generate_tangents] to automatically generate normals and tangents respectively. [b]Note:[/b] Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. + [b]Note:[/b] If [member detail_enabled] is [code]true[/code], the [member detail_albedo] texture is drawn [i]below[/i] the [member normal_texture]. To display a normal map [i]above[/i] the [member detail_albedo] texture, use [member detail_normal] instead. </member> <member name="orm_texture" type="Texture2D" setter="set_texture" getter="get_texture"> </member> @@ -319,6 +333,7 @@ </member> <member name="specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" enum="BaseMaterial3D.SpecularMode" default="0"> The method for rendering the specular blob. See [enum SpecularMode]. + [b]Note:[/b] Only applies to the specular blob. Does not affect specular reflections from the Sky, SSR, or ReflectionProbes. </member> <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. @@ -344,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. @@ -358,10 +374,10 @@ [b]Note:[/b] This is only effective for objects whose geometry is point-based rather than triangle-based. See also [member point_size]. </member> <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" default="Vector3(0, 0, 0)"> - How much to offset the [code]UV[/code] coordinates. This amount will be added to [code]UV[/code] in the vertex function. This can be used to offset a texture. + How much to offset the [code]UV[/code] coordinates. This amount will be added to [code]UV[/code] in the vertex function. This can be used to offset a texture. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. </member> <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" default="Vector3(1, 1, 1)"> - How much to scale the [code]UV[/code] coordinates. This is multiplied by [code]UV[/code] in the vertex function. + How much to scale the [code]UV[/code] coordinates. This is multiplied by [code]UV[/code] in the vertex function. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. </member> <member name="uv1_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], instead of using [code]UV[/code] textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. @@ -373,10 +389,10 @@ If [code]true[/code], triplanar mapping for [code]UV[/code] is calculated in world space rather than object local space. See also [member uv1_triplanar]. </member> <member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" default="Vector3(0, 0, 0)"> - How much to offset the [code]UV2[/code] coordinates. This amount will be added to [code]UV2[/code] in the vertex function. This can be used to offset a texture. + How much to offset the [code]UV2[/code] coordinates. This amount will be added to [code]UV2[/code] in the vertex function. This can be used to offset a texture. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. </member> <member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" default="Vector3(1, 1, 1)"> - How much to scale the [code]UV2[/code] coordinates. This is multiplied by [code]UV2[/code] in the vertex function. + How much to scale the [code]UV2[/code] coordinates. This is multiplied by [code]UV2[/code] in the vertex function. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. </member> <member name="uv2_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], instead of using [code]UV2[/code] textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. @@ -388,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. @@ -594,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]. @@ -624,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. @@ -646,7 +664,10 @@ </constant> <constant name="FLAG_PARTICLE_TRAILS_MODE" value="19" enum="Flags"> </constant> - <constant name="FLAG_MAX" value="20" enum="Flags"> + <constant name="FLAG_ALBEDO_TEXTURE_MSDF" value="20" enum="Flags"> + Enables multichannel signed distance field rendering shader. + </constant> + <constant name="FLAG_MAX" value="21" enum="Flags"> Represents the size of the [enum Flags] enum. </constant> <constant name="DIFFUSE_BURLEY" value="0" enum="DiffuseMode"> @@ -664,16 +685,10 @@ <constant name="SPECULAR_SCHLICK_GGX" value="0" enum="SpecularMode"> Default specular blob. </constant> - <constant name="SPECULAR_BLINN" value="1" enum="SpecularMode"> - Older specular algorithm, included for compatibility. - </constant> - <constant name="SPECULAR_PHONG" value="2" enum="SpecularMode"> - Older specular algorithm, included for compatibility. - </constant> - <constant name="SPECULAR_TOON" value="3" enum="SpecularMode"> + <constant name="SPECULAR_TOON" value="1" enum="SpecularMode"> Toon blob which changes size based on roughness. </constant> - <constant name="SPECULAR_DISABLED" value="4" enum="SpecularMode"> + <constant name="SPECULAR_DISABLED" value="2" enum="SpecularMode"> No specular blob. </constant> <constant name="BILLBOARD_DISABLED" value="0" enum="BillboardMode"> @@ -702,7 +717,7 @@ Used to read from the alpha channel of a texture. </constant> <constant name="TEXTURE_CHANNEL_GRAYSCALE" value="4" enum="TextureChannel"> - Currently unused. + Used to read from the linear (non-perceptual) average of the red, green and blue channels of a texture. </constant> <constant name="EMISSION_OP_ADD" value="0" enum="EmissionOperator"> Adds the emission color to the color from the emission texture. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index f31e962632..0af482d654 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -35,9 +35,9 @@ <constructor name="Basis"> <return type="Basis" /> <argument index="0" name="axis" type="Vector3" /> - <argument index="1" name="phi" type="float" /> + <argument index="1" name="angle" type="float" /> <description> - Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]phi[/code], in radians. The axis must be a normalized vector. + Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]angle[/code] (in radians). The axis must be a normalized vector. </description> </constructor> <constructor name="Basis"> @@ -136,9 +136,9 @@ <method name="rotated" qualifiers="const"> <return type="Basis" /> <argument index="0" name="axis" type="Vector3" /> - <argument index="1" name="phi" type="float" /> + <argument index="1" name="angle" type="float" /> <description> - Introduce an additional rotation around the given axis by phi (radians). The axis must be a normalized vector. + Introduce an additional rotation around the given axis by [code]angle[/code] (in radians). The axis must be a normalized vector. </description> </method> <method name="scaled" qualifiers="const"> @@ -225,11 +225,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Basis" /> <description> Returns [code]true[/code] if the [Basis] matrices are not equal. @@ -266,11 +261,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Basis" /> <description> Returns [code]true[/code] if the [Basis] matrices are exactly equal. 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/BoxContainer.xml b/doc/classes/BoxContainer.xml index 92fccaa884..c76a178368 100644 --- a/doc/classes/BoxContainer.xml +++ b/doc/classes/BoxContainer.xml @@ -7,6 +7,7 @@ Arranges child [Control] nodes vertically or horizontally, and rearranges them automatically when their minimum size changes. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="add_spacer"> diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml index 154af1221f..c198dd3405 100644 --- a/doc/classes/BoxShape3D.xml +++ b/doc/classes/BoxShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BoxShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Box shape resource. + Box shape resource for 3D collisions. </brief_description> <description> - 3D box shape that can be a child of a [PhysicsBody3D] or [Area3D]. + 3D box shape to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. + [b]Performance:[/b] Being a primitive collision shape, [BoxShape3D] is fast to check collisions against (though not as fast as [SphereShape3D]). </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index af9724af08..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. @@ -78,7 +55,7 @@ </member> <member name="icon" type="Texture2D" setter="set_button_icon" getter="get_button_icon"> Button's icon, if text is present the icon will be placed before the text. - To edit margin and spacing of the icon, use [theme_item hseparation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es. + To edit margin and spacing of the icon, use [theme_item h_separation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es. </member> <member name="icon_alignment" type="int" setter="set_icon_alignment" getter="get_icon_alignment" enum="HorizontalAlignment" default="0"> Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum @GlobalScope.HorizontalAlignment] constants as the text alignment. If centered, text will draw on top of the icon. @@ -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)"> @@ -133,7 +113,7 @@ <theme_item name="icon_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being pressed. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> + <theme_item name="h_separation" data_type="constant" type="int" default="2"> The horizontal space between [Button]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 4a7ffe1536..dacdca1cee 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -313,18 +313,21 @@ All particles will be emitted from a single point. </constant> <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape"> + Particles will be emitted in the volume of a sphere flattened to two dimensions. + </constant> + <constant name="EMISSION_SHAPE_SPHERE_SURFACE" value="2" enum="EmissionShape"> Particles will be emitted on the surface of a sphere flattened to two dimensions. </constant> - <constant name="EMISSION_SHAPE_RECTANGLE" value="2" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_RECTANGLE" value="3" enum="EmissionShape"> Particles will be emitted in the area of a rectangle. </constant> - <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_POINTS" value="4" enum="EmissionShape"> Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. </constant> - <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="5" enum="EmissionShape"> Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. </constant> - <constant name="EMISSION_SHAPE_MAX" value="5" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_MAX" value="6" enum="EmissionShape"> Represents the size of the [enum EmissionShape] enum. </constant> </constants> diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index 7152f67f48..f2a0040ed4 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -370,19 +370,22 @@ <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape"> Particles will be emitted in the volume of a sphere. </constant> - <constant name="EMISSION_SHAPE_BOX" value="2" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_SPHERE_SURFACE" value="2" enum="EmissionShape"> + Particles will be emitted on the surface of a sphere. + </constant> + <constant name="EMISSION_SHAPE_BOX" value="3" enum="EmissionShape"> Particles will be emitted in the volume of a box. </constant> - <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_POINTS" value="4" enum="EmissionShape"> Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. </constant> - <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="5" enum="EmissionShape"> Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. </constant> - <constant name="EMISSION_SHAPE_RING" value="5" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_RING" value="6" enum="EmissionShape"> Particles will be emitted in a ring or cylinder. </constant> - <constant name="EMISSION_SHAPE_MAX" value="6" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_MAX" value="7" enum="EmissionShape"> Represents the size of the [enum EmissionShape] enum. </constant> </constants> diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 7c7e37d0a5..efe3e3d091 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -150,11 +150,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Callable" /> <description> Returns [code]true[/code] if both [Callable]s invoke different targets. @@ -162,11 +157,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Callable" /> <description> Returns [code]true[/code] if both [Callable]s invoke the same custom target. diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 3350735ca2..b9373676e2 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -157,7 +157,7 @@ Speed in pixels per second of the camera's smoothing effect when [member smoothing_enabled] is [code]true[/code]. </member> <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" default="Vector2(1, 1)"> - The camera's zoom relative to the viewport. Values larger than [code]Vector2(1, 1)[/code] zoom out and smaller values zoom in. For an example, use [code]Vector2(0.5, 0.5)[/code] for a 2× zoom-in, and [code]Vector2(4, 4)[/code] for a 4× zoom-out. + The camera's zoom. A zoom of [code]Vector(2, 2)[/code] doubles the size seen in the viewport. A zoom of [code]Vector(0.5, 0.5)[/code] halves the size seen in the viewport. </member> </members> <constants> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index f7a0d41626..3aedbbd1e6 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. @@ -188,24 +189,24 @@ <member name="near" type="float" setter="set_near" getter="get_near" default="0.05"> The distance to the near culling boundary for this camera relative to its local Z axis. </member> - <member name="projection" type="int" setter="set_projection" getter="get_projection" enum="Camera3D.Projection" default="0"> + <member name="projection" type="int" setter="set_projection" getter="get_projection" enum="Camera3D.ProjectionType" default="0"> The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. </member> <member name="size" type="float" setter="set_size" getter="get_size" default="1.0"> - The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length. + The camera's size measured as 1/2 the width or height. Only applicable in orthogonal and frustum modes. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length. </member> <member name="v_offset" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The vertical (Y) offset of the camera viewport. </member> </members> <constants> - <constant name="PROJECTION_PERSPECTIVE" value="0" enum="Projection"> + <constant name="PROJECTION_PERSPECTIVE" value="0" enum="ProjectionType"> Perspective projection. Objects on the screen becomes smaller when they are far away. </constant> - <constant name="PROJECTION_ORTHOGONAL" value="1" enum="Projection"> + <constant name="PROJECTION_ORTHOGONAL" value="1" enum="ProjectionType"> Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. </constant> - <constant name="PROJECTION_FRUSTUM" value="2" enum="Projection"> + <constant name="PROJECTION_FRUSTUM" value="2" enum="ProjectionType"> Frustum projection. This mode allows adjusting [member frustum_offset] to create "tilted frustum" effects. </constant> <constant name="KEEP_WIDTH" value="0" enum="KeepAspect"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index d71762801c..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="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="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="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"> @@ -80,6 +89,17 @@ Draws a colored polygon of any amount of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon. </description> </method> + <method name="draw_dashed_line"> + <return type="void" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <argument index="2" name="color" type="Color" /> + <argument index="3" name="width" type="float" default="1.0" /> + <argument index="4" name="dash" type="float" default="2.0" /> + <description> + Draws a dashed line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. + </description> + </method> <method name="draw_end_animation"> <return type="void" /> <description> @@ -92,8 +112,9 @@ <argument index="1" name="to" type="Vector2" /> <argument index="2" name="color" type="Color" /> <argument index="3" name="width" type="float" default="1.0" /> + <argument index="4" name="antialiased" type="bool" default="false" /> <description> - Draws a line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. + Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_multiline] and [method draw_polyline]. </description> </method> <method name="draw_mesh"> @@ -115,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> @@ -145,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" /> @@ -180,7 +221,7 @@ <argument index="2" name="width" type="float" default="1.0" /> <argument index="3" name="antialiased" type="bool" default="false" /> <description> - Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. + Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. </description> </method> <method name="draw_polyline_colors"> @@ -190,7 +231,7 @@ <argument index="2" name="width" type="float" default="1.0" /> <argument index="3" name="antialiased" type="bool" default="false" /> <description> - Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. + Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. </description> </method> <method name="draw_primitive"> @@ -238,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] @@ -267,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" /> @@ -355,6 +413,13 @@ Returns the mouse's position in this [CanvasItem] using the local coordinate system of this [CanvasItem]. </description> </method> + <method name="get_screen_transform" qualifiers="const"> + <return type="Transform2D" /> + <description> + Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. + Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]). + </description> + </method> <method name="get_transform" qualifiers="const"> <return type="Transform2D" /> <description> @@ -421,14 +486,14 @@ <return type="void" /> <argument index="0" name="enable" type="bool" /> <description> - If [code]enable[/code] is [code]true[/code], children will be updated with local transform data. + If [code]enable[/code] is [code]true[/code], this node will receive [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] when its local transform changes. </description> </method> <method name="set_notify_transform"> <return type="void" /> <argument index="0" name="enable" type="bool" /> <description> - If [code]enable[/code] is [code]true[/code], children will be updated with global transform data. + If [code]enable[/code] is [code]true[/code], this node will receive [constant NOTIFICATION_TRANSFORM_CHANGED] when its global transform changes. </description> </method> <method name="show"> @@ -462,9 +527,6 @@ <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false"> If [code]true[/code], the object draws behind its parent. </member> - <member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top"> - If [code]true[/code], the object draws on top of its parent. - </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> The texture filtering mode to use on this [CanvasItem]. </member> @@ -472,7 +534,7 @@ The texture repeating mode to use on this [CanvasItem]. </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 transform from parent [CanvasItem]s. + If [code]true[/code], this [CanvasItem] will [i]not[/i] inherit its transform from parent [CanvasItem]s. Its draw order will also be changed to make it draw on top of other [CanvasItem]s that do not have [member top_level] set to [code]true[/code]. The [CanvasItem] will effectively act as if it was placed as a child of a bare [Node]. </member> <member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material" default="false"> If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material. @@ -506,7 +568,10 @@ </signals> <constants> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="2000"> - The [CanvasItem]'s transform has changed. This notification is only received if enabled by [method set_notify_transform] or [method set_notify_local_transform]. + The [CanvasItem]'s global transform has changed. This notification is only received if enabled by [method set_notify_transform]. + </constant> + <constant name="NOTIFICATION_LOCAL_TRANSFORM_CHANGED" value="35"> + The [CanvasItem]'s local transform has changed. This notification is only received if enabled by [method set_notify_local_transform]. </constant> <constant name="NOTIFICATION_DRAW" value="30"> The [CanvasItem] is requested to draw. diff --git a/doc/classes/CapsuleShape2D.xml b/doc/classes/CapsuleShape2D.xml index ae8e1ca001..2236d8035f 100644 --- a/doc/classes/CapsuleShape2D.xml +++ b/doc/classes/CapsuleShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CapsuleShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Capsule shape for 2D collisions. + Capsule shape resource for 2D physics. </brief_description> <description> - Capsule shape for 2D collisions. + 2D capsule shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. In 2D, a capsule is a rectangle shape with half-circles at both ends. + [b]Performance:[/b] Being a primitive collision shape, [CapsuleShape2D] is fast to check collisions against (though not as fast as [CircleShape2D]). </description> <tutorials> </tutorials> diff --git a/doc/classes/CapsuleShape3D.xml b/doc/classes/CapsuleShape3D.xml index 5f15aaafad..cdcfab76ce 100644 --- a/doc/classes/CapsuleShape3D.xml +++ b/doc/classes/CapsuleShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CapsuleShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Capsule shape for collisions. + Capsule shape resource for 3D collisions. </brief_description> <description> - Capsule shape for collisions. + 3D capsule shape to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. In 3D, a capsule is a cylinder shape with hemispheres at both ends. + [b]Performance:[/b] Being a primitive collision shape, [CapsuleShape3D] is fast to check collisions against (though not as fast as [SphereShape3D]). [CapsuleShape3D] is cheaper to check collisions against compared to [CylinderShape3D]. </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> diff --git a/doc/classes/CenterContainer.xml b/doc/classes/CenterContainer.xml index 08cdf64cea..f5f32bd325 100644 --- a/doc/classes/CenterContainer.xml +++ b/doc/classes/CenterContainer.xml @@ -7,6 +7,7 @@ CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <members> <member name="use_top_left" type="bool" setter="set_use_top_left" getter="is_using_top_left" default="false"> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index f90c477f6d..63d493248f 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -55,7 +55,7 @@ <method name="get_real_velocity" qualifiers="const"> <return type="Vector2" /> <description> - Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member motion_velocity] which returns the requested velocity. + Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. </description> </method> <method name="get_slide_collision"> @@ -131,8 +131,8 @@ <method name="move_and_slide"> <return type="bool" /> <description> - Moves the body based on [member motion_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidDynamicBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - Modifies [member motion_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. + Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidDynamicBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. The general behavior and available properties change according to the [member motion_mode]. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. @@ -162,7 +162,7 @@ </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. - If [code]false[/code], the body will slide on floor's slopes when [member motion_velocity] applies a downward force. + If [code]false[/code], the body will slide on floor's slopes when [member velocity] applies a downward force. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. @@ -170,9 +170,6 @@ <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0"> Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> - <member name="motion_velocity" type="Vector2" setter="set_motion_velocity" getter="get_motion_velocity" default="Vector2(0, 0)"> - Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. - </member> <member name="moving_platform_apply_velocity_on_leave" type="int" setter="set_moving_platform_apply_velocity_on_leave" getter="get_moving_platform_apply_velocity_on_leave" enum="CharacterBody2D.MovingPlatformApplyVelocityOnLeave" default="0"> Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum MovingPlatformApplyVelocityOnLeave] constants for available behavior. </member> @@ -186,7 +183,10 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. If set to [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. + </member> + <member name="velocity" type="Vector2" setter="set_velocity" getter="get_velocity" default="Vector2(0, 0)"> + Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. </member> <member name="wall_min_slide_angle" type="float" setter="set_wall_min_slide_angle" getter="get_wall_min_slide_angle" default="0.261799"> Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. This property only affects movement when [member motion_mode] is [constant MOTION_MODE_FLOATING]. @@ -200,10 +200,10 @@ Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_ALWAYS" value="0" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member motion_velocity] when you leave a moving platform. + Add the last platform velocity to the [member velocity] when you leave a moving platform. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_UPWARD_ONLY" value="1" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member motion_velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_NEVER" value="2" enum="MovingPlatformApplyVelocityOnLeave"> Do nothing when leaving a platform. diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index f1c717b74a..6c5cd62fe1 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -56,7 +56,7 @@ <method name="get_real_velocity" qualifiers="const"> <return type="Vector3" /> <description> - Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member motion_velocity] which returns the requested velocity. + Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. </description> </method> <method name="get_slide_collision"> @@ -117,8 +117,8 @@ <method name="move_and_slide"> <return type="bool" /> <description> - Moves the body based on [member motion_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidDynamicBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - Modifies [member motion_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. + Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidDynamicBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> @@ -147,7 +147,7 @@ </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. - If [code]false[/code], the body will slide on floor's slopes when [member motion_velocity] applies a downward force. + If [code]false[/code], the body will slide on floor's slopes when [member velocity] applies a downward force. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="6"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. @@ -155,9 +155,6 @@ <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody3D.MotionMode" default="0"> Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> - <member name="motion_velocity" type="Vector3" setter="set_motion_velocity" getter="get_motion_velocity" default="Vector3(0, 0, 0)"> - Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. - </member> <member name="moving_platform_apply_velocity_on_leave" type="int" setter="set_moving_platform_apply_velocity_on_leave" getter="get_moving_platform_apply_velocity_on_leave" enum="CharacterBody3D.MovingPlatformApplyVelocityOnLeave" default="0"> Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum MovingPlatformApplyVelocityOnLeave] constants for available behavior. </member> @@ -171,7 +168,10 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. If set to [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. + </member> + <member name="velocity" type="Vector3" setter="set_velocity" getter="get_velocity" default="Vector3(0, 0, 0)"> + Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. </member> <member name="wall_min_slide_angle" type="float" setter="set_wall_min_slide_angle" getter="get_wall_min_slide_angle" default="0.261799"> Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. When [member motion_mode] is [constant MOTION_MODE_GROUNDED], it only affects movement if [member floor_block_on_wall] is [code]true[/code]. @@ -185,10 +185,10 @@ Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_ALWAYS" value="0" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member motion_velocity] when you leave a moving platform. + Add the last platform velocity to the [member velocity] when you leave a moving platform. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_UPWARD_ONLY" value="1" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member motion_velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_NEVER" value="2" enum="MovingPlatformApplyVelocityOnLeave"> Do nothing when leaving a platform. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 606f5ca51f..6483faf763 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -35,10 +35,10 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckBox] text's font color when it's pressed. </theme_item> - <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> + <theme_item name="check_v_adjust" data_type="constant" type="int" default="0"> The vertical offset used when rendering the check icons (in pixels). </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The separation between the check icon and the text (in pixels). </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> @@ -54,23 +54,25 @@ The check icon to display when the [CheckBox] is checked. </theme_item> <theme_item name="checked_disabled" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is checked and disabled. + The check icon to display when the [CheckBox] is checked and is disabled. </theme_item> <theme_item name="radio_checked" data_type="icon" type="Texture2D"> - If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is checked. + The check icon to display when the [CheckBox] is configured as a radio button and is checked. </theme_item> <theme_item name="radio_checked_disabled" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is configured as a radio button, is disabled, and is unchecked. </theme_item> <theme_item name="radio_unchecked" data_type="icon" type="Texture2D"> - If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is unchecked. + The check icon to display when the [CheckBox] is configured as a radio button and is unchecked. </theme_item> <theme_item name="radio_unchecked_disabled" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is configured as a radio button, is disabled, and is unchecked. </theme_item> <theme_item name="unchecked" data_type="icon" type="Texture2D"> The check icon to display when the [CheckBox] is unchecked. </theme_item> <theme_item name="unchecked_disabled" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is unchecked and disabled. + The check icon to display when the [CheckBox] is unchecked and is disabled. </theme_item> <theme_item name="disabled" data_type="style" type="StyleBox"> The [StyleBox] to display as a background when the [CheckBox] is disabled. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index c6ebfaf4b0..51b0411f4e 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -35,10 +35,10 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckButton] text's font color when it's pressed. </theme_item> - <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> + <theme_item name="check_v_adjust" data_type="constant" type="int" default="0"> The vertical offset used when rendering the toggle icons (in pixels). </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The separation between the toggle icon and the text (in pixels). </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> diff --git a/doc/classes/CircleShape2D.xml b/doc/classes/CircleShape2D.xml index b0336086dc..6f4989daa3 100644 --- a/doc/classes/CircleShape2D.xml +++ b/doc/classes/CircleShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CircleShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Circular shape for 2D collisions. + Circular shape resource for 2D physics. </brief_description> <description> - Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. + 2D circular shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. + [b]Performance:[/b] Being a primitive collision shape, [CircleShape2D] is the fastest collision shape to check collisions against, as it only requires a distance check with the shape's origin. </description> <tutorials> </tutorials> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 835588b293..43210de686 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -23,13 +23,6 @@ Returns whether the specified [code]class[/code] is available or not. </description> </method> - <method name="class_get_category" qualifiers="const"> - <return type="StringName" /> - <argument index="0" name="class" type="StringName" /> - <description> - Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. - </description> - </method> <method name="class_get_enum_constants" qualifiers="const"> <return type="PackedStringArray" /> <argument index="0" name="class" type="StringName" /> 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/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml index 99bf9f7853..5d025985cc 100644 --- a/doc/classes/CollisionObject2D.xml +++ b/doc/classes/CollisionObject2D.xml @@ -5,6 +5,7 @@ </brief_description> <description> CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision [Shape2D]s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods. + [b]Note:[/b] Only collisions between objects within the same canvas ([Viewport] canvas or [CanvasLayer]) are supported. The behavior of collisions between objects in different canvases is undefined. </description> <tutorials> </tutorials> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 48fd7c19dc..f290fc9801 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -4,7 +4,8 @@ Defines a 2D collision polygon. </brief_description> <description> - Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices. + Provides a concave or convex 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices. See also [ConvexPolygonShape2D]. + In the editor, a [CollisionPolygon2D] can be generated from a [Sprite2D]'s outline by selecting a [Sprite2D] node, going to the [b]Sprite2D[/b] menu at the top of the 2D editor viewport then choosing [b]Create CollisionPolygon2D Sibling[/b]. </description> <tutorials> </tutorials> @@ -17,6 +18,7 @@ </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false"> If [code]true[/code], only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects. + [b]Note:[/b] This property has no effect if this [CollisionPolygon2D] is a child of an [Area2D] node. </member> <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. diff --git a/doc/classes/CollisionPolygon3D.xml b/doc/classes/CollisionPolygon3D.xml index c8c3752254..7d718cff27 100644 --- a/doc/classes/CollisionPolygon3D.xml +++ b/doc/classes/CollisionPolygon3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CollisionPolygon3D" inherits="Node3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Editor-only class for defining a collision polygon in 3D space. + Editor-only node for defining a collision polygon in 3D space. </brief_description> <description> - Allows editing a collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates a [Shape3D] for gameplay. Properties modified during gameplay will have no effect. + Allows editing a concave or convex collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates several [ConvexPolygonShape3D]s at run-time to represent the original polygon using convex decomposition. + [b]Note:[/b] Since this is an editor-only helper, properties modified during gameplay will have no effect. </description> <tutorials> </tutorials> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index f3a4cbc2d6..246e0e8663 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -18,6 +18,7 @@ </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false"> Sets whether this collision shape should only detect collision on one side (top or bottom). + [b]Note:[/b] This property has no effect if this [CollisionShape2D] is a child of an [Area2D] node. </member> <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index bc0baf42c9..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> @@ -183,6 +201,7 @@ <description> Returns the luminance of the color in the [code][0.0, 1.0][/code] range. This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. + [b]Note:[/b] [method get_luminance] relies on the colour being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use [method srgb_to_linear] to convert it to the linear color space first. </description> </method> <method name="get_named_color" qualifiers="static"> @@ -320,6 +339,18 @@ [/codeblocks] </description> </method> + <method name="linear_to_srgb" qualifiers="const"> + <return type="Color" /> + <description> + Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This assumes the original color is in the linear color space. See also [method srgb_to_linear] which performs the opposite operation. + </description> + </method> + <method name="srgb_to_linear" qualifiers="const"> + <return type="Color" /> + <description> + Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method linear_to_srgb] which performs the opposite operation. + </description> + </method> <method name="to_abgr32" qualifiers="const"> <return type="int" /> <description> @@ -473,343 +504,343 @@ </member> </members> <constants> - <constant name="ALICE_BLUE" value="Color(0.94, 0.97, 1, 1)"> + <constant name="ALICE_BLUE" value="Color(0.941176, 0.972549, 1, 1)"> Alice blue color. </constant> - <constant name="ANTIQUE_WHITE" value="Color(0.98, 0.92, 0.84, 1)"> + <constant name="ANTIQUE_WHITE" value="Color(0.980392, 0.921569, 0.843137, 1)"> Antique white color. </constant> <constant name="AQUA" value="Color(0, 1, 1, 1)"> Aqua color. </constant> - <constant name="AQUAMARINE" value="Color(0.5, 1, 0.83, 1)"> + <constant name="AQUAMARINE" value="Color(0.498039, 1, 0.831373, 1)"> Aquamarine color. </constant> - <constant name="AZURE" value="Color(0.94, 1, 1, 1)"> + <constant name="AZURE" value="Color(0.941176, 1, 1, 1)"> Azure color. </constant> - <constant name="BEIGE" value="Color(0.96, 0.96, 0.86, 1)"> + <constant name="BEIGE" value="Color(0.960784, 0.960784, 0.862745, 1)"> Beige color. </constant> - <constant name="BISQUE" value="Color(1, 0.89, 0.77, 1)"> + <constant name="BISQUE" value="Color(1, 0.894118, 0.768627, 1)"> Bisque color. </constant> <constant name="BLACK" value="Color(0, 0, 0, 1)"> Black color. </constant> - <constant name="BLANCHED_ALMOND" value="Color(1, 0.92, 0.8, 1)"> + <constant name="BLANCHED_ALMOND" value="Color(1, 0.921569, 0.803922, 1)"> Blanched almond color. </constant> <constant name="BLUE" value="Color(0, 0, 1, 1)"> Blue color. </constant> - <constant name="BLUE_VIOLET" value="Color(0.54, 0.17, 0.89, 1)"> + <constant name="BLUE_VIOLET" value="Color(0.541176, 0.168627, 0.886275, 1)"> Blue violet color. </constant> - <constant name="BROWN" value="Color(0.65, 0.16, 0.16, 1)"> + <constant name="BROWN" value="Color(0.647059, 0.164706, 0.164706, 1)"> Brown color. </constant> - <constant name="BURLYWOOD" value="Color(0.87, 0.72, 0.53, 1)"> + <constant name="BURLYWOOD" value="Color(0.870588, 0.721569, 0.529412, 1)"> Burlywood color. </constant> - <constant name="CADET_BLUE" value="Color(0.37, 0.62, 0.63, 1)"> + <constant name="CADET_BLUE" value="Color(0.372549, 0.619608, 0.627451, 1)"> Cadet blue color. </constant> - <constant name="CHARTREUSE" value="Color(0.5, 1, 0, 1)"> + <constant name="CHARTREUSE" value="Color(0.498039, 1, 0, 1)"> Chartreuse color. </constant> - <constant name="CHOCOLATE" value="Color(0.82, 0.41, 0.12, 1)"> + <constant name="CHOCOLATE" value="Color(0.823529, 0.411765, 0.117647, 1)"> Chocolate color. </constant> - <constant name="CORAL" value="Color(1, 0.5, 0.31, 1)"> + <constant name="CORAL" value="Color(1, 0.498039, 0.313726, 1)"> Coral color. </constant> - <constant name="CORNFLOWER_BLUE" value="Color(0.39, 0.58, 0.93, 1)"> + <constant name="CORNFLOWER_BLUE" value="Color(0.392157, 0.584314, 0.929412, 1)"> Cornflower blue color. </constant> - <constant name="CORNSILK" value="Color(1, 0.97, 0.86, 1)"> + <constant name="CORNSILK" value="Color(1, 0.972549, 0.862745, 1)"> Cornsilk color. </constant> - <constant name="CRIMSON" value="Color(0.86, 0.08, 0.24, 1)"> + <constant name="CRIMSON" value="Color(0.862745, 0.0784314, 0.235294, 1)"> Crimson color. </constant> <constant name="CYAN" value="Color(0, 1, 1, 1)"> Cyan color. </constant> - <constant name="DARK_BLUE" value="Color(0, 0, 0.55, 1)"> + <constant name="DARK_BLUE" value="Color(0, 0, 0.545098, 1)"> Dark blue color. </constant> - <constant name="DARK_CYAN" value="Color(0, 0.55, 0.55, 1)"> + <constant name="DARK_CYAN" value="Color(0, 0.545098, 0.545098, 1)"> Dark cyan color. </constant> - <constant name="DARK_GOLDENROD" value="Color(0.72, 0.53, 0.04, 1)"> + <constant name="DARK_GOLDENROD" value="Color(0.721569, 0.52549, 0.0431373, 1)"> Dark goldenrod color. </constant> - <constant name="DARK_GRAY" value="Color(0.66, 0.66, 0.66, 1)"> + <constant name="DARK_GRAY" value="Color(0.662745, 0.662745, 0.662745, 1)"> Dark gray color. </constant> - <constant name="DARK_GREEN" value="Color(0, 0.39, 0, 1)"> + <constant name="DARK_GREEN" value="Color(0, 0.392157, 0, 1)"> Dark green color. </constant> - <constant name="DARK_KHAKI" value="Color(0.74, 0.72, 0.42, 1)"> + <constant name="DARK_KHAKI" value="Color(0.741176, 0.717647, 0.419608, 1)"> Dark khaki color. </constant> - <constant name="DARK_MAGENTA" value="Color(0.55, 0, 0.55, 1)"> + <constant name="DARK_MAGENTA" value="Color(0.545098, 0, 0.545098, 1)"> Dark magenta color. </constant> - <constant name="DARK_OLIVE_GREEN" value="Color(0.33, 0.42, 0.18, 1)"> + <constant name="DARK_OLIVE_GREEN" value="Color(0.333333, 0.419608, 0.184314, 1)"> Dark olive green color. </constant> - <constant name="DARK_ORANGE" value="Color(1, 0.55, 0, 1)"> + <constant name="DARK_ORANGE" value="Color(1, 0.54902, 0, 1)"> Dark orange color. </constant> - <constant name="DARK_ORCHID" value="Color(0.6, 0.2, 0.8, 1)"> + <constant name="DARK_ORCHID" value="Color(0.6, 0.196078, 0.8, 1)"> Dark orchid color. </constant> - <constant name="DARK_RED" value="Color(0.55, 0, 0, 1)"> + <constant name="DARK_RED" value="Color(0.545098, 0, 0, 1)"> Dark red color. </constant> - <constant name="DARK_SALMON" value="Color(0.91, 0.59, 0.48, 1)"> + <constant name="DARK_SALMON" value="Color(0.913725, 0.588235, 0.478431, 1)"> Dark salmon color. </constant> - <constant name="DARK_SEA_GREEN" value="Color(0.56, 0.74, 0.56, 1)"> + <constant name="DARK_SEA_GREEN" value="Color(0.560784, 0.737255, 0.560784, 1)"> Dark sea green color. </constant> - <constant name="DARK_SLATE_BLUE" value="Color(0.28, 0.24, 0.55, 1)"> + <constant name="DARK_SLATE_BLUE" value="Color(0.282353, 0.239216, 0.545098, 1)"> Dark slate blue color. </constant> - <constant name="DARK_SLATE_GRAY" value="Color(0.18, 0.31, 0.31, 1)"> + <constant name="DARK_SLATE_GRAY" value="Color(0.184314, 0.309804, 0.309804, 1)"> Dark slate gray color. </constant> - <constant name="DARK_TURQUOISE" value="Color(0, 0.81, 0.82, 1)"> + <constant name="DARK_TURQUOISE" value="Color(0, 0.807843, 0.819608, 1)"> Dark turquoise color. </constant> - <constant name="DARK_VIOLET" value="Color(0.58, 0, 0.83, 1)"> + <constant name="DARK_VIOLET" value="Color(0.580392, 0, 0.827451, 1)"> Dark violet color. </constant> - <constant name="DEEP_PINK" value="Color(1, 0.08, 0.58, 1)"> + <constant name="DEEP_PINK" value="Color(1, 0.0784314, 0.576471, 1)"> Deep pink color. </constant> - <constant name="DEEP_SKY_BLUE" value="Color(0, 0.75, 1, 1)"> + <constant name="DEEP_SKY_BLUE" value="Color(0, 0.74902, 1, 1)"> Deep sky blue color. </constant> - <constant name="DIM_GRAY" value="Color(0.41, 0.41, 0.41, 1)"> + <constant name="DIM_GRAY" value="Color(0.411765, 0.411765, 0.411765, 1)"> Dim gray color. </constant> - <constant name="DODGER_BLUE" value="Color(0.12, 0.56, 1, 1)"> + <constant name="DODGER_BLUE" value="Color(0.117647, 0.564706, 1, 1)"> Dodger blue color. </constant> - <constant name="FIREBRICK" value="Color(0.7, 0.13, 0.13, 1)"> + <constant name="FIREBRICK" value="Color(0.698039, 0.133333, 0.133333, 1)"> Firebrick color. </constant> - <constant name="FLORAL_WHITE" value="Color(1, 0.98, 0.94, 1)"> + <constant name="FLORAL_WHITE" value="Color(1, 0.980392, 0.941176, 1)"> Floral white color. </constant> - <constant name="FOREST_GREEN" value="Color(0.13, 0.55, 0.13, 1)"> + <constant name="FOREST_GREEN" value="Color(0.133333, 0.545098, 0.133333, 1)"> Forest green color. </constant> <constant name="FUCHSIA" value="Color(1, 0, 1, 1)"> Fuchsia color. </constant> - <constant name="GAINSBORO" value="Color(0.86, 0.86, 0.86, 1)"> + <constant name="GAINSBORO" value="Color(0.862745, 0.862745, 0.862745, 1)"> Gainsboro color. </constant> - <constant name="GHOST_WHITE" value="Color(0.97, 0.97, 1, 1)"> + <constant name="GHOST_WHITE" value="Color(0.972549, 0.972549, 1, 1)"> Ghost white color. </constant> - <constant name="GOLD" value="Color(1, 0.84, 0, 1)"> + <constant name="GOLD" value="Color(1, 0.843137, 0, 1)"> Gold color. </constant> - <constant name="GOLDENROD" value="Color(0.85, 0.65, 0.13, 1)"> + <constant name="GOLDENROD" value="Color(0.854902, 0.647059, 0.12549, 1)"> Goldenrod color. </constant> - <constant name="GRAY" value="Color(0.75, 0.75, 0.75, 1)"> + <constant name="GRAY" value="Color(0.745098, 0.745098, 0.745098, 1)"> Gray color. </constant> <constant name="GREEN" value="Color(0, 1, 0, 1)"> Green color. </constant> - <constant name="GREEN_YELLOW" value="Color(0.68, 1, 0.18, 1)"> + <constant name="GREEN_YELLOW" value="Color(0.678431, 1, 0.184314, 1)"> Green yellow color. </constant> - <constant name="HONEYDEW" value="Color(0.94, 1, 0.94, 1)"> + <constant name="HONEYDEW" value="Color(0.941176, 1, 0.941176, 1)"> Honeydew color. </constant> - <constant name="HOT_PINK" value="Color(1, 0.41, 0.71, 1)"> + <constant name="HOT_PINK" value="Color(1, 0.411765, 0.705882, 1)"> Hot pink color. </constant> - <constant name="INDIAN_RED" value="Color(0.8, 0.36, 0.36, 1)"> + <constant name="INDIAN_RED" value="Color(0.803922, 0.360784, 0.360784, 1)"> Indian red color. </constant> - <constant name="INDIGO" value="Color(0.29, 0, 0.51, 1)"> + <constant name="INDIGO" value="Color(0.294118, 0, 0.509804, 1)"> Indigo color. </constant> - <constant name="IVORY" value="Color(1, 1, 0.94, 1)"> + <constant name="IVORY" value="Color(1, 1, 0.941176, 1)"> Ivory color. </constant> - <constant name="KHAKI" value="Color(0.94, 0.9, 0.55, 1)"> + <constant name="KHAKI" value="Color(0.941176, 0.901961, 0.54902, 1)"> Khaki color. </constant> - <constant name="LAVENDER" value="Color(0.9, 0.9, 0.98, 1)"> + <constant name="LAVENDER" value="Color(0.901961, 0.901961, 0.980392, 1)"> Lavender color. </constant> - <constant name="LAVENDER_BLUSH" value="Color(1, 0.94, 0.96, 1)"> + <constant name="LAVENDER_BLUSH" value="Color(1, 0.941176, 0.960784, 1)"> Lavender blush color. </constant> - <constant name="LAWN_GREEN" value="Color(0.49, 0.99, 0, 1)"> + <constant name="LAWN_GREEN" value="Color(0.486275, 0.988235, 0, 1)"> Lawn green color. </constant> - <constant name="LEMON_CHIFFON" value="Color(1, 0.98, 0.8, 1)"> + <constant name="LEMON_CHIFFON" value="Color(1, 0.980392, 0.803922, 1)"> Lemon chiffon color. </constant> - <constant name="LIGHT_BLUE" value="Color(0.68, 0.85, 0.9, 1)"> + <constant name="LIGHT_BLUE" value="Color(0.678431, 0.847059, 0.901961, 1)"> Light blue color. </constant> - <constant name="LIGHT_CORAL" value="Color(0.94, 0.5, 0.5, 1)"> + <constant name="LIGHT_CORAL" value="Color(0.941176, 0.501961, 0.501961, 1)"> Light coral color. </constant> - <constant name="LIGHT_CYAN" value="Color(0.88, 1, 1, 1)"> + <constant name="LIGHT_CYAN" value="Color(0.878431, 1, 1, 1)"> Light cyan color. </constant> - <constant name="LIGHT_GOLDENROD" value="Color(0.98, 0.98, 0.82, 1)"> + <constant name="LIGHT_GOLDENROD" value="Color(0.980392, 0.980392, 0.823529, 1)"> Light goldenrod color. </constant> - <constant name="LIGHT_GRAY" value="Color(0.83, 0.83, 0.83, 1)"> + <constant name="LIGHT_GRAY" value="Color(0.827451, 0.827451, 0.827451, 1)"> Light gray color. </constant> - <constant name="LIGHT_GREEN" value="Color(0.56, 0.93, 0.56, 1)"> + <constant name="LIGHT_GREEN" value="Color(0.564706, 0.933333, 0.564706, 1)"> Light green color. </constant> - <constant name="LIGHT_PINK" value="Color(1, 0.71, 0.76, 1)"> + <constant name="LIGHT_PINK" value="Color(1, 0.713726, 0.756863, 1)"> Light pink color. </constant> - <constant name="LIGHT_SALMON" value="Color(1, 0.63, 0.48, 1)"> + <constant name="LIGHT_SALMON" value="Color(1, 0.627451, 0.478431, 1)"> Light salmon color. </constant> - <constant name="LIGHT_SEA_GREEN" value="Color(0.13, 0.7, 0.67, 1)"> + <constant name="LIGHT_SEA_GREEN" value="Color(0.12549, 0.698039, 0.666667, 1)"> Light sea green color. </constant> - <constant name="LIGHT_SKY_BLUE" value="Color(0.53, 0.81, 0.98, 1)"> + <constant name="LIGHT_SKY_BLUE" value="Color(0.529412, 0.807843, 0.980392, 1)"> Light sky blue color. </constant> - <constant name="LIGHT_SLATE_GRAY" value="Color(0.47, 0.53, 0.6, 1)"> + <constant name="LIGHT_SLATE_GRAY" value="Color(0.466667, 0.533333, 0.6, 1)"> Light slate gray color. </constant> - <constant name="LIGHT_STEEL_BLUE" value="Color(0.69, 0.77, 0.87, 1)"> + <constant name="LIGHT_STEEL_BLUE" value="Color(0.690196, 0.768627, 0.870588, 1)"> Light steel blue color. </constant> - <constant name="LIGHT_YELLOW" value="Color(1, 1, 0.88, 1)"> + <constant name="LIGHT_YELLOW" value="Color(1, 1, 0.878431, 1)"> Light yellow color. </constant> <constant name="LIME" value="Color(0, 1, 0, 1)"> Lime color. </constant> - <constant name="LIME_GREEN" value="Color(0.2, 0.8, 0.2, 1)"> + <constant name="LIME_GREEN" value="Color(0.196078, 0.803922, 0.196078, 1)"> Lime green color. </constant> - <constant name="LINEN" value="Color(0.98, 0.94, 0.9, 1)"> + <constant name="LINEN" value="Color(0.980392, 0.941176, 0.901961, 1)"> Linen color. </constant> <constant name="MAGENTA" value="Color(1, 0, 1, 1)"> Magenta color. </constant> - <constant name="MAROON" value="Color(0.69, 0.19, 0.38, 1)"> + <constant name="MAROON" value="Color(0.690196, 0.188235, 0.376471, 1)"> Maroon color. </constant> - <constant name="MEDIUM_AQUAMARINE" value="Color(0.4, 0.8, 0.67, 1)"> + <constant name="MEDIUM_AQUAMARINE" value="Color(0.4, 0.803922, 0.666667, 1)"> Medium aquamarine color. </constant> - <constant name="MEDIUM_BLUE" value="Color(0, 0, 0.8, 1)"> + <constant name="MEDIUM_BLUE" value="Color(0, 0, 0.803922, 1)"> Medium blue color. </constant> - <constant name="MEDIUM_ORCHID" value="Color(0.73, 0.33, 0.83, 1)"> + <constant name="MEDIUM_ORCHID" value="Color(0.729412, 0.333333, 0.827451, 1)"> Medium orchid color. </constant> - <constant name="MEDIUM_PURPLE" value="Color(0.58, 0.44, 0.86, 1)"> + <constant name="MEDIUM_PURPLE" value="Color(0.576471, 0.439216, 0.858824, 1)"> Medium purple color. </constant> - <constant name="MEDIUM_SEA_GREEN" value="Color(0.24, 0.7, 0.44, 1)"> + <constant name="MEDIUM_SEA_GREEN" value="Color(0.235294, 0.701961, 0.443137, 1)"> Medium sea green color. </constant> - <constant name="MEDIUM_SLATE_BLUE" value="Color(0.48, 0.41, 0.93, 1)"> + <constant name="MEDIUM_SLATE_BLUE" value="Color(0.482353, 0.407843, 0.933333, 1)"> Medium slate blue color. </constant> - <constant name="MEDIUM_SPRING_GREEN" value="Color(0, 0.98, 0.6, 1)"> + <constant name="MEDIUM_SPRING_GREEN" value="Color(0, 0.980392, 0.603922, 1)"> Medium spring green color. </constant> - <constant name="MEDIUM_TURQUOISE" value="Color(0.28, 0.82, 0.8, 1)"> + <constant name="MEDIUM_TURQUOISE" value="Color(0.282353, 0.819608, 0.8, 1)"> Medium turquoise color. </constant> - <constant name="MEDIUM_VIOLET_RED" value="Color(0.78, 0.08, 0.52, 1)"> + <constant name="MEDIUM_VIOLET_RED" value="Color(0.780392, 0.0823529, 0.521569, 1)"> Medium violet red color. </constant> - <constant name="MIDNIGHT_BLUE" value="Color(0.1, 0.1, 0.44, 1)"> + <constant name="MIDNIGHT_BLUE" value="Color(0.0980392, 0.0980392, 0.439216, 1)"> Midnight blue color. </constant> - <constant name="MINT_CREAM" value="Color(0.96, 1, 0.98, 1)"> + <constant name="MINT_CREAM" value="Color(0.960784, 1, 0.980392, 1)"> Mint cream color. </constant> - <constant name="MISTY_ROSE" value="Color(1, 0.89, 0.88, 1)"> + <constant name="MISTY_ROSE" value="Color(1, 0.894118, 0.882353, 1)"> Misty rose color. </constant> - <constant name="MOCCASIN" value="Color(1, 0.89, 0.71, 1)"> + <constant name="MOCCASIN" value="Color(1, 0.894118, 0.709804, 1)"> Moccasin color. </constant> - <constant name="NAVAJO_WHITE" value="Color(1, 0.87, 0.68, 1)"> + <constant name="NAVAJO_WHITE" value="Color(1, 0.870588, 0.678431, 1)"> Navajo white color. </constant> - <constant name="NAVY_BLUE" value="Color(0, 0, 0.5, 1)"> + <constant name="NAVY_BLUE" value="Color(0, 0, 0.501961, 1)"> Navy blue color. </constant> - <constant name="OLD_LACE" value="Color(0.99, 0.96, 0.9, 1)"> + <constant name="OLD_LACE" value="Color(0.992157, 0.960784, 0.901961, 1)"> Old lace color. </constant> - <constant name="OLIVE" value="Color(0.5, 0.5, 0, 1)"> + <constant name="OLIVE" value="Color(0.501961, 0.501961, 0, 1)"> Olive color. </constant> - <constant name="OLIVE_DRAB" value="Color(0.42, 0.56, 0.14, 1)"> + <constant name="OLIVE_DRAB" value="Color(0.419608, 0.556863, 0.137255, 1)"> Olive drab color. </constant> - <constant name="ORANGE" value="Color(1, 0.65, 0, 1)"> + <constant name="ORANGE" value="Color(1, 0.647059, 0, 1)"> Orange color. </constant> - <constant name="ORANGE_RED" value="Color(1, 0.27, 0, 1)"> + <constant name="ORANGE_RED" value="Color(1, 0.270588, 0, 1)"> Orange red color. </constant> - <constant name="ORCHID" value="Color(0.85, 0.44, 0.84, 1)"> + <constant name="ORCHID" value="Color(0.854902, 0.439216, 0.839216, 1)"> Orchid color. </constant> - <constant name="PALE_GOLDENROD" value="Color(0.93, 0.91, 0.67, 1)"> + <constant name="PALE_GOLDENROD" value="Color(0.933333, 0.909804, 0.666667, 1)"> Pale goldenrod color. </constant> - <constant name="PALE_GREEN" value="Color(0.6, 0.98, 0.6, 1)"> + <constant name="PALE_GREEN" value="Color(0.596078, 0.984314, 0.596078, 1)"> Pale green color. </constant> - <constant name="PALE_TURQUOISE" value="Color(0.69, 0.93, 0.93, 1)"> + <constant name="PALE_TURQUOISE" value="Color(0.686275, 0.933333, 0.933333, 1)"> Pale turquoise color. </constant> - <constant name="PALE_VIOLET_RED" value="Color(0.86, 0.44, 0.58, 1)"> + <constant name="PALE_VIOLET_RED" value="Color(0.858824, 0.439216, 0.576471, 1)"> Pale violet red color. </constant> - <constant name="PAPAYA_WHIP" value="Color(1, 0.94, 0.84, 1)"> + <constant name="PAPAYA_WHIP" value="Color(1, 0.937255, 0.835294, 1)"> Papaya whip color. </constant> - <constant name="PEACH_PUFF" value="Color(1, 0.85, 0.73, 1)"> + <constant name="PEACH_PUFF" value="Color(1, 0.854902, 0.72549, 1)"> Peach puff color. </constant> - <constant name="PERU" value="Color(0.8, 0.52, 0.25, 1)"> + <constant name="PERU" value="Color(0.803922, 0.521569, 0.247059, 1)"> Peru color. </constant> - <constant name="PINK" value="Color(1, 0.75, 0.8, 1)"> + <constant name="PINK" value="Color(1, 0.752941, 0.796078, 1)"> Pink color. </constant> - <constant name="PLUM" value="Color(0.87, 0.63, 0.87, 1)"> + <constant name="PLUM" value="Color(0.866667, 0.627451, 0.866667, 1)"> Plum color. </constant> - <constant name="POWDER_BLUE" value="Color(0.69, 0.88, 0.9, 1)"> + <constant name="POWDER_BLUE" value="Color(0.690196, 0.878431, 0.901961, 1)"> Powder blue color. </constant> - <constant name="PURPLE" value="Color(0.63, 0.13, 0.94, 1)"> + <constant name="PURPLE" value="Color(0.627451, 0.12549, 0.941176, 1)"> Purple color. </constant> <constant name="REBECCA_PURPLE" value="Color(0.4, 0.2, 0.6, 1)"> @@ -818,108 +849,103 @@ <constant name="RED" value="Color(1, 0, 0, 1)"> Red color. </constant> - <constant name="ROSY_BROWN" value="Color(0.74, 0.56, 0.56, 1)"> + <constant name="ROSY_BROWN" value="Color(0.737255, 0.560784, 0.560784, 1)"> Rosy brown color. </constant> - <constant name="ROYAL_BLUE" value="Color(0.25, 0.41, 0.88, 1)"> + <constant name="ROYAL_BLUE" value="Color(0.254902, 0.411765, 0.882353, 1)"> Royal blue color. </constant> - <constant name="SADDLE_BROWN" value="Color(0.55, 0.27, 0.07, 1)"> + <constant name="SADDLE_BROWN" value="Color(0.545098, 0.270588, 0.0745098, 1)"> Saddle brown color. </constant> - <constant name="SALMON" value="Color(0.98, 0.5, 0.45, 1)"> + <constant name="SALMON" value="Color(0.980392, 0.501961, 0.447059, 1)"> Salmon color. </constant> - <constant name="SANDY_BROWN" value="Color(0.96, 0.64, 0.38, 1)"> + <constant name="SANDY_BROWN" value="Color(0.956863, 0.643137, 0.376471, 1)"> Sandy brown color. </constant> - <constant name="SEA_GREEN" value="Color(0.18, 0.55, 0.34, 1)"> + <constant name="SEA_GREEN" value="Color(0.180392, 0.545098, 0.341176, 1)"> Sea green color. </constant> - <constant name="SEASHELL" value="Color(1, 0.96, 0.93, 1)"> + <constant name="SEASHELL" value="Color(1, 0.960784, 0.933333, 1)"> Seashell color. </constant> - <constant name="SIENNA" value="Color(0.63, 0.32, 0.18, 1)"> + <constant name="SIENNA" value="Color(0.627451, 0.321569, 0.176471, 1)"> Sienna color. </constant> - <constant name="SILVER" value="Color(0.75, 0.75, 0.75, 1)"> + <constant name="SILVER" value="Color(0.752941, 0.752941, 0.752941, 1)"> Silver color. </constant> - <constant name="SKY_BLUE" value="Color(0.53, 0.81, 0.92, 1)"> + <constant name="SKY_BLUE" value="Color(0.529412, 0.807843, 0.921569, 1)"> Sky blue color. </constant> - <constant name="SLATE_BLUE" value="Color(0.42, 0.35, 0.8, 1)"> + <constant name="SLATE_BLUE" value="Color(0.415686, 0.352941, 0.803922, 1)"> Slate blue color. </constant> - <constant name="SLATE_GRAY" value="Color(0.44, 0.5, 0.56, 1)"> + <constant name="SLATE_GRAY" value="Color(0.439216, 0.501961, 0.564706, 1)"> Slate gray color. </constant> - <constant name="SNOW" value="Color(1, 0.98, 0.98, 1)"> + <constant name="SNOW" value="Color(1, 0.980392, 0.980392, 1)"> Snow color. </constant> - <constant name="SPRING_GREEN" value="Color(0, 1, 0.5, 1)"> + <constant name="SPRING_GREEN" value="Color(0, 1, 0.498039, 1)"> Spring green color. </constant> - <constant name="STEEL_BLUE" value="Color(0.27, 0.51, 0.71, 1)"> + <constant name="STEEL_BLUE" value="Color(0.27451, 0.509804, 0.705882, 1)"> Steel blue color. </constant> - <constant name="TAN" value="Color(0.82, 0.71, 0.55, 1)"> + <constant name="TAN" value="Color(0.823529, 0.705882, 0.54902, 1)"> Tan color. </constant> - <constant name="TEAL" value="Color(0, 0.5, 0.5, 1)"> + <constant name="TEAL" value="Color(0, 0.501961, 0.501961, 1)"> Teal color. </constant> - <constant name="THISTLE" value="Color(0.85, 0.75, 0.85, 1)"> + <constant name="THISTLE" value="Color(0.847059, 0.74902, 0.847059, 1)"> Thistle color. </constant> - <constant name="TOMATO" value="Color(1, 0.39, 0.28, 1)"> + <constant name="TOMATO" value="Color(1, 0.388235, 0.278431, 1)"> Tomato color. </constant> <constant name="TRANSPARENT" value="Color(1, 1, 1, 0)"> Transparent color (white with zero alpha). </constant> - <constant name="TURQUOISE" value="Color(0.25, 0.88, 0.82, 1)"> + <constant name="TURQUOISE" value="Color(0.25098, 0.878431, 0.815686, 1)"> Turquoise color. </constant> - <constant name="VIOLET" value="Color(0.93, 0.51, 0.93, 1)"> + <constant name="VIOLET" value="Color(0.933333, 0.509804, 0.933333, 1)"> Violet color. </constant> - <constant name="WEB_GRAY" value="Color(0.5, 0.5, 0.5, 1)"> + <constant name="WEB_GRAY" value="Color(0.501961, 0.501961, 0.501961, 1)"> Web gray color. </constant> - <constant name="WEB_GREEN" value="Color(0, 0.5, 0, 1)"> + <constant name="WEB_GREEN" value="Color(0, 0.501961, 0, 1)"> Web green color. </constant> - <constant name="WEB_MAROON" value="Color(0.5, 0, 0, 1)"> + <constant name="WEB_MAROON" value="Color(0.501961, 0, 0, 1)"> Web maroon color. </constant> - <constant name="WEB_PURPLE" value="Color(0.5, 0, 0.5, 1)"> + <constant name="WEB_PURPLE" value="Color(0.501961, 0, 0.501961, 1)"> Web purple color. </constant> - <constant name="WHEAT" value="Color(0.96, 0.87, 0.7, 1)"> + <constant name="WHEAT" value="Color(0.960784, 0.870588, 0.701961, 1)"> Wheat color. </constant> <constant name="WHITE" value="Color(1, 1, 1, 1)"> White color. </constant> - <constant name="WHITE_SMOKE" value="Color(0.96, 0.96, 0.96, 1)"> + <constant name="WHITE_SMOKE" value="Color(0.960784, 0.960784, 0.960784, 1)"> White smoke color. </constant> <constant name="YELLOW" value="Color(1, 1, 0, 1)"> Yellow color. </constant> - <constant name="YELLOW_GREEN" value="Color(0.6, 0.8, 0.2, 1)"> + <constant name="YELLOW_GREEN" value="Color(0.603922, 0.803922, 0.196078, 1)"> Yellow green color. </constant> </constants> <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Color" /> <description> Returns [code]true[/code] if the colors are not equal. @@ -984,11 +1010,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Color" /> <description> Returns [code]true[/code] if the colors are exactly equal. 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 e2f1fdfae1..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.rect_min_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> @@ -74,7 +74,7 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 1)"> Text [Color] used when the [ColorPickerButton] is being pressed. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> + <theme_item name="h_separation" data_type="constant" type="int" default="2"> The horizontal space between [ColorPickerButton]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> diff --git a/doc/classes/CompressedCubemap.xml b/doc/classes/CompressedCubemap.xml new file mode 100644 index 0000000000..fbb0879fdc --- /dev/null +++ b/doc/classes/CompressedCubemap.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CompressedCubemap" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/CompressedCubemapArray.xml b/doc/classes/CompressedCubemapArray.xml new file mode 100644 index 0000000000..ff096cea47 --- /dev/null +++ b/doc/classes/CompressedCubemapArray.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CompressedCubemapArray" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/StreamTexture2D.xml b/doc/classes/CompressedTexture2D.xml index b18105cc29..5f73b55f69 100644 --- a/doc/classes/StreamTexture2D.xml +++ b/doc/classes/CompressedTexture2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamTexture2D" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="CompressedTexture2D" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A [code].stex[/code] texture. + A [code].ctex[/code] texture. </brief_description> <description> - A texture that is loaded from a [code].stex[/code] file. + A texture that is loaded from a [code].ctex[/code] file. </description> <tutorials> </tutorials> @@ -19,7 +19,7 @@ </methods> <members> <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> - The StreamTexture's file path to a [code].stex[/code] file. + The CompressedTexture's file path to a [code].ctex[/code] file. </member> </members> </class> diff --git a/doc/classes/CompressedTexture2DArray.xml b/doc/classes/CompressedTexture2DArray.xml new file mode 100644 index 0000000000..0c751759af --- /dev/null +++ b/doc/classes/CompressedTexture2DArray.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CompressedTexture2DArray" inherits="CompressedTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/StreamTexture3D.xml b/doc/classes/CompressedTexture3D.xml index c0b783369f..de7a93d788 100644 --- a/doc/classes/StreamTexture3D.xml +++ b/doc/classes/CompressedTexture3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamTexture3D" inherits="Texture3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="CompressedTexture3D" inherits="Texture3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> </brief_description> <description> diff --git a/doc/classes/StreamTextureLayered.xml b/doc/classes/CompressedTextureLayered.xml index 8ed36ff54c..03bea84ba4 100644 --- a/doc/classes/StreamTextureLayered.xml +++ b/doc/classes/CompressedTextureLayered.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamTextureLayered" inherits="TextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="CompressedTextureLayered" inherits="TextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> </brief_description> <description> diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml index 924178f9bf..f3c245c229 100644 --- a/doc/classes/ConcavePolygonShape2D.xml +++ b/doc/classes/ConcavePolygonShape2D.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ConcavePolygonShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Concave polygon 2D shape resource for physics. + Concave polygon shape resource for 2D physics. </brief_description> <description> - Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidDynamicBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. - The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. + 2D concave polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidDynamicBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. + The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection. + [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape2D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape2D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape2D]'s documentation for instructions. However, consider using primitive collision shapes such as [CircleShape2D] or [RectangleShape2D] first. </description> <tutorials> </tutorials> diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml index 4e67f91db8..60d7e32492 100644 --- a/doc/classes/ConcavePolygonShape3D.xml +++ b/doc/classes/ConcavePolygonShape3D.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ConcavePolygonShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Concave polygon shape. + Concave polygon shape resource (also called "trimesh") for 3D physics. </brief_description> <description> - Concave polygon shape resource, which can be set into a [PhysicsBody3D] or area. This shape is created by feeding a list of triangles. + 3D concave polygon shape resource (also called "trimesh") to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. This shape is created by feeding a list of triangles. Despite its name, [ConcavePolygonShape3D] can also store convex polygon shapes. However, unlike [ConvexPolygonShape3D], [ConcavePolygonShape3D] is [i]not[/i] limited to storing convex shapes exclusively. [b]Note:[/b] When used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidDynamicBody3D] with a mode other than Static. + [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape3D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. However, consider using primitive collision shapes such as [SphereShape3D] or [BoxShape3D] first. </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</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/Container.xml b/doc/classes/Container.xml index 11b20b5654..900997d119 100644 --- a/doc/classes/Container.xml +++ b/doc/classes/Container.xml @@ -8,6 +8,7 @@ A Control can inherit this to create custom container classes. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="_get_allowed_size_flags_horizontal" qualifiers="virtual const"> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index cecc8f658d..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 rect_min_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> @@ -137,7 +137,7 @@ * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; - * it happens outside the parent's rectangle and the parent has either [member rect_clip_content] enabled. + * it happens outside the parent's rectangle and the parent has either [member clip_contents] enabled. [b]Note:[/b] Event position is relative to the control origin. </description> </method> @@ -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 rect_min_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] @@ -351,13 +351,13 @@ <method name="get_begin" qualifiers="const"> <return type="Vector2" /> <description> - Returns [member offset_left] and [member offset_top]. See also [member rect_position]. + Returns [member offset_left] and [member offset_top]. See also [member position]. </description> </method> <method name="get_combined_minimum_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns combined minimum size from [member rect_min_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"> @@ -383,13 +383,13 @@ <method name="get_global_rect" qualifiers="const"> <return type="Rect2" /> <description> - Returns the position and size of the control relative to the top-left corner of the screen. See [member rect_position] and [member rect_size]. + Returns the position and size of the control relative to the top-left corner of the screen. See [member position] and [member size]. </description> </method> <method name="get_minimum_size" qualifiers="const"> <return type="Vector2" /> <description> - Returns the minimum size for this control. See [member rect_min_size]. + Returns the minimum size for this control. See [member custom_minimum_size]. </description> </method> <method name="get_offset" qualifiers="const"> @@ -414,7 +414,20 @@ <method name="get_rect" qualifiers="const"> <return type="Rect2" /> <description> - Returns the position and size of the control relative to the top-left corner of the parent Control. See [member rect_position] and [member rect_size]. + Returns the position and size of the control relative to the top-left corner of the parent Control. See [member position] and [member size]. + </description> + </method> + <method name="get_screen_position" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. + Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]). + Example usage for showing a popup: + [codeblock] + popup_menu.position = get_screen_position() + get_local_mouse_position() + popup_menu.reset_size() + popup_menu.popup() + [/codeblock] </description> </method> <method name="get_theme_color" qualifiers="const"> @@ -652,7 +665,8 @@ <method name="is_drag_successful" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if drag operation is successful. + Returns [code]true[/code] if a drag operation is successful. Alternative to [method Viewport.gui_is_drag_successful]. + Best used with [constant Node.NOTIFICATION_DRAG_END]. </description> </method> <method name="is_layout_rtl" qualifiers="const"> @@ -759,7 +773,7 @@ <return type="void" /> <argument index="0" name="position" type="Vector2" /> <description> - Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member rect_position]. + Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member position]. </description> </method> <method name="set_drag_forwarding"> @@ -840,7 +854,7 @@ # Use a control that is not in the tree var cpb = ColorPickerButton.new() cpb.color = color - cpb.rect_size = Vector2(50, 50) + cpb.size = Vector2(50, 50) set_drag_preview(cpb) return color [/gdscript] @@ -881,7 +895,7 @@ <argument index="0" name="position" type="Vector2" /> <argument index="1" name="keep_offsets" type="bool" default="false" /> <description> - Sets the [member rect_global_position] to given [code]position[/code]. + Sets the [member global_position] to given [code]position[/code]. If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> @@ -909,7 +923,7 @@ <argument index="0" name="position" type="Vector2" /> <argument index="1" name="keep_offsets" type="bool" default="false" /> <description> - Sets the [member rect_position] to given [code]position[/code]. + Sets the [member position] to given [code]position[/code]. If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> @@ -918,21 +932,21 @@ <argument index="0" name="size" type="Vector2" /> <argument index="1" name="keep_offsets" type="bool" default="false" /> <description> - Sets the size (see [member rect_size]). + Sets the size (see [member size]). If [code]keep_offsets[/code] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> <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 rect_min_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"> <return type="void" /> - <argument index="0" name="to_position" type="Vector2" /> + <argument index="0" name="position" type="Vector2" /> <description> - Moves the mouse cursor to [code]to_position[/code], relative to [member rect_position] of this [Control]. + Moves the mouse cursor to [code]position[/code], relative to [member position] of this [Control]. </description> </method> </methods> @@ -953,6 +967,12 @@ Toggles if any text should automatically change to its translated version depending on the current locale. Note that this will not affect any internal nodes (e.g. the popup of a [MenuButton]). Also decides if the node's strings should be parsed for POT generation. </member> + <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> @@ -976,6 +996,9 @@ Tells Godot which node it should give keyboard focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. </member> + <member name="global_position" type="Vector2" setter="_set_global_position" getter="get_global_position"> + The node's global position, relative to the world (usually to the top-left corner of the window). + </member> <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1"> Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. </member> @@ -1014,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. @@ -1030,30 +1057,21 @@ Distance between the node's top edge and its parent control, based on [member anchor_top]. 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. </member> - <member name="rect_clip_content" 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="rect_global_position" type="Vector2" setter="_set_global_position" getter="get_global_position"> - The node's global position, relative to the world (usually to the top-left corner of the window). + <member name="pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)"> + By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot. Set this property to [member size] / 2 to pivot around the Control's center. </member> - <member name="rect_min_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 name="position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)"> + The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset]. </member> - <member name="rect_pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)"> - By default, the node's pivot is its top-left corner. When you change its [member rect_scale], it will scale around this pivot. Set this property to [member rect_size] / 2 to center the pivot in the node's rectangle. + <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> + The node's rotation around its pivot, in radians. See [member pivot_offset] to change the pivot's position. </member> - <member name="rect_position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)"> - The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by [member rect_pivot_offset]. - </member> - <member name="rect_rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> - The node's rotation around its pivot, in radians. See [member rect_pivot_offset] to change the pivot's position. - </member> - <member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> - The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value. + <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> + The node's scale, relative to its [member size]. Change this property to scale the node around its [member pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value. [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=$DOCS_URL/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. - [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]await get_tree().process_frame[/code] then set its [member rect_scale] property. + [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]await get_tree().process_frame[/code] then set its [member scale] property. </member> - <member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> + <member name="size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. </member> <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" default="1"> @@ -1110,7 +1128,7 @@ If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this: [codeblock] func _on_mouse_exited(): - if not Rect2(Vector2(), rect_size).has_point(get_local_mouse_position()): + if not Rect2(Vector2(), size).has_point(get_local_mouse_position()): # Not hovering over area. [/codeblock] </description> @@ -1141,7 +1159,7 @@ The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with [member focus_mode]. </constant> <constant name="NOTIFICATION_RESIZED" value="40"> - Sent when the node changes size. Use [member rect_size] to get the new size. + Sent when the node changes size. Use [member size] to get the new size. </constant> <constant name="NOTIFICATION_MOUSE_ENTER" value="41"> Sent when the mouse pointer enters the node. @@ -1180,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. @@ -1263,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. @@ -1301,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. @@ -1345,27 +1363,5 @@ <constant name="TEXT_DIRECTION_RTL" value="2" enum="TextDirection"> Right-to-left text writing direction. </constant> - <constant name="STRUCTURED_TEXT_DEFAULT" value="0" enum="StructuredTextParser"> - Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description. - </constant> - <constant name="STRUCTURED_TEXT_URI" value="1" enum="StructuredTextParser"> - BiDi override for URI. - </constant> - <constant name="STRUCTURED_TEXT_FILE" value="2" enum="StructuredTextParser"> - BiDi override for file path. - </constant> - <constant name="STRUCTURED_TEXT_EMAIL" value="3" enum="StructuredTextParser"> - BiDi override for email. - </constant> - <constant name="STRUCTURED_TEXT_LIST" value="4" enum="StructuredTextParser"> - BiDi override for lists. - Structured text options: list separator [code]String[/code]. - </constant> - <constant name="STRUCTURED_TEXT_NONE" value="5" enum="StructuredTextParser"> - Use default Unicode BiDi algorithm. - </constant> - <constant name="STRUCTURED_TEXT_CUSTOM" value="6" enum="StructuredTextParser"> - User defined structured text BiDi override function. - </constant> </constants> </class> diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index 449c3132c7..df96b50fc1 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ConvexPolygonShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Convex polygon shape for 2D physics. + Convex polygon shape resource for 2D physics. </brief_description> <description> - Convex polygon shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). - The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. + 2D convex polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). See also [CollisionPolygon2D]. + The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection. + [b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions against compared to [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] or [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape. </description> <tutorials> </tutorials> diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml index d2f110d187..32dc8f673b 100644 --- a/doc/classes/ConvexPolygonShape3D.xml +++ b/doc/classes/ConvexPolygonShape3D.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ConvexPolygonShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Convex polygon shape for 3D physics. + Convex polygon shape resource for 3D physics. </brief_description> <description> - Convex polygon shape resource, which can be added to a [PhysicsBody3D] or area. + 3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. Unlike [ConcavePolygonShape3D], [ConvexPolygonShape3D] cannot store concave polygon shapes. [ConvexPolygonShape2D]s can be manually drawn in the editor using the [CollisionPolygon3D] node. + [b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] [ConvexPolygonShape3D]s. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). This is available in the editor by selecting the [MeshInstance3D], going to the [b]Mesh[/b] menu and choosing [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time. + [b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape. </description> <tutorials> <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link> 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 f040d292e9..3bba825aaa 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -17,7 +17,7 @@ <argument index="2" name="out" type="Vector2" default="Vector2(0, 0)" /> <argument index="3" name="at_position" type="int" default="-1" /> <description> - Adds a point to a curve at [code]position[/code], with control points [code]in[/code] and [code]out[/code]. + Adds a point to a curve at [code]position[/code] relative to the [Curve2D]'s position, with control points [code]in[/code] and [code]out[/code]. If [code]at_position[/code] is given, the point is inserted before the point number [code]at_position[/code], moving that point (and every point after) after the inserted point. If [code]at_position[/code] is not given, or is an illegal value ([code]at_position <0[/code] or [code]at_position >= [method get_point_count][/code]), the point will be appended at the end of the point list. </description> </method> @@ -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 27856f2564..6457d9681e 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -17,7 +17,7 @@ <argument index="2" name="out" type="Vector3" default="Vector3(0, 0, 0)" /> <argument index="3" name="at_position" type="int" default="-1" /> <description> - Adds a point to a curve at [code]position[/code], with control points [code]in[/code] and [code]out[/code]. + Adds a point to a curve at [code]position[/code] relative to the [Curve3D]'s position, with control points [code]in[/code] and [code]out[/code]. If [code]at_position[/code] is given, the point is inserted before the point number [code]at_position[/code], moving that point (and every point after) after the inserted point. If [code]at_position[/code] is not given, or is an illegal value ([code]at_position <0[/code] or [code]at_position >= [method get_point_count][/code]), the point will be appended at the end of the point list. </description> </method> @@ -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/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml index 06ad590bb3..6ff142da59 100644 --- a/doc/classes/CylinderShape3D.xml +++ b/doc/classes/CylinderShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CylinderShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Cylinder shape for collisions. + Cylinder shape for 3D collisions. </brief_description> <description> - Cylinder shape for collisions. + Cylinder shape for collisions. Like [CapsuleShape3D], but without hemispheres at the cylinder's ends. + [b]Performance:[/b] Being a primitive collision shape, [CylinderShape3D] is fast to check collisions against (though not as fast as [SphereShape3D]). [CylinderShape3D] is also more demanding compared to [CapsuleShape3D]. </description> <tutorials> <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index 342bc762af..b86104a5e3 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> @@ -62,14 +63,14 @@ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="1048575"> Specifies which [member VisualInstance3D.layers] this decal will project on. By default, Decals affect all layers. This is used so you can specify which types of objects receive the Decal and which do not. This is especially useful so you can ensure that dynamic objects don't accidentally receive a Decal intended for the terrain under them. </member> - <member name="distance_fade_begin" type="float" setter="set_distance_fade_begin" getter="get_distance_fade_begin" default="10.0"> - Distance from the camera at which the Decal begins to fade away. + <member name="distance_fade_begin" type="float" setter="set_distance_fade_begin" getter="get_distance_fade_begin" default="40.0"> + The distance from the camera at which the Decal begins to fade away (in 3D units). </member> <member name="distance_fade_enabled" type="bool" setter="set_enable_distance_fade" getter="is_distance_fade_enabled" default="false"> - If [code]true[/code], decals will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. The Decal will fade out over [member distance_fade_length], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active Decals in a scene and thus improve performance. + If [code]true[/code], decals will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. The Decal will fade out over [member distance_fade_begin] + [member distance_fade_length], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active Decals in a scene and thus improve performance. </member> - <member name="distance_fade_length" type="float" setter="set_distance_fade_length" getter="get_distance_fade_length" default="1.0"> - Distance over which the Decal fades. The Decal becomes slowly more transparent over this distance and is completely invisible at the end. + <member name="distance_fade_length" type="float" setter="set_distance_fade_length" getter="get_distance_fade_length" default="10.0"> + The distance over which the Decal fades (in 3D units). The Decal becomes slowly more transparent over this distance and is completely invisible at the end. </member> <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy" default="1.0"> Energy multiplier for the emission texture. This will make the decal emit light at a higher intensity. @@ -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 ab04366eb7..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> @@ -307,22 +315,12 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Dictionary" /> <description> </description> </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Dictionary" /> <description> </description> diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index ad2663a61b..9c943b8c8b 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -34,9 +34,8 @@ <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5"> The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]. </member> - <member name="shadow_bias" type="float" setter="set_param" getter="get_param" overrides="Light3D" default="0.1" /> - <member name="use_in_sky_only" type="bool" setter="set_sky_only" getter="is_sky_only" default="false"> - If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. + <member name="sky_mode" type="int" setter="set_sky_mode" getter="get_sky_mode" enum="DirectionalLight3D.SkyMode" default="0"> + Set whether this [DirectionalLight3D] is visible in the sky, in the scene, or both in the sky and in the scene. See [enum SkyMode] for options. </member> </members> <constants> @@ -49,5 +48,14 @@ <constant name="SHADOW_PARALLEL_4_SPLITS" value="2" enum="ShadowMode"> Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. </constant> + <constant name="SKY_MODE_LIGHT_AND_SKY" value="0" enum="SkyMode"> + Makes the light visible in both scene lighting and sky rendering. + </constant> + <constant name="SKY_MODE_LIGHT_ONLY" value="1" enum="SkyMode"> + Makes the light visible in scene lighting only (including direct lighting and global illumination). When using this mode, the light will not be visible from sky shaders. + </constant> + <constant name="SKY_MODE_SKY_ONLY" value="2" enum="SkyMode"> + Makes the light visible to sky shaders only. When using this mode the light will not cast light into the scene (either through direct lighting or through global illumination), but can be accessed through sky shaders. This can be useful, for example, when you want to control sky effects without illuminating the scene (during a night cycle, for example). + </constant> </constants> </class> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 7d72cd867c..bd16fd3936 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -196,7 +196,8 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. + Permanently deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. + If you don't want to delete the file/directory permanently, use [method OS.move_to_trash] instead. Returns one of the [enum Error] code constants ([code]OK[/code] on success). </description> </method> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index be8811d629..cec504584c 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -104,6 +104,19 @@ <description> </description> </method> + <method name="get_display_cutouts" qualifiers="const"> + <return type="Array" /> + <description> + Returns an [Array] of [Rect2], each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [method get_display_safe_area]. + [b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches. + </description> + </method> + <method name="get_display_safe_area" qualifiers="const"> + <return type="Rect2i" /> + <description> + Returns the unobscured area of the display where interactive controls should be rendered. See also [method get_display_cutouts]. + </description> + </method> <method name="get_name" qualifiers="const"> <return type="String" /> <description> @@ -136,7 +149,74 @@ <argument index="1" name="label" type="String" /> <argument index="2" name="callback" type="Callable" /> <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> + <description> + Adds a new checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> <description> + Adds a new checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> + <description> + Adds a new item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_radio_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> + <description> + Adds a new radio-checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_item"> @@ -145,13 +225,70 @@ <argument index="1" name="label" type="String" /> <argument index="2" name="callback" type="Callable" /> <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> <description> + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_multistate_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="labe" type="String" /> + <argument index="2" name="max_states" type="int" /> + <argument index="3" name="default_state" type="int" /> + <argument index="4" name="callback" type="Callable" /> + <argument index="5" name="tag" type="Variant" default="null" /> + <argument index="6" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="7" name="index" type="int" default="-1" /> + <description> + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + Contrarily to normal binary items, multistate items can have more than two states, as defined by [code]max_states[/code]. Each press or activate of the item will increase the state by one. The default value is defined by [code]default_state[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_radio_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="label" type="String" /> + <argument index="2" name="callback" type="Callable" /> + <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> + <description> + Adds a new radio-checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_separator"> <return type="void" /> <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="index" type="int" default="-1" /> <description> + Adds a separator between items to the global menu with ID [code]menu_root[/code]. Separators also occupy an index. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_submenu_item"> @@ -159,41 +296,127 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="label" type="String" /> <argument index="2" name="submenu" type="String" /> + <argument index="3" name="index" type="int" default="-1" /> <description> + Adds an item that will act as a submenu of the global menu [code]menu_root[/code]. The [code]submenu[/code] argument is the ID of the global menu root that will be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_clear"> <return type="void" /> <argument index="0" name="menu_root" type="String" /> <description> + Removes all items from the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_get_item_accelerator" qualifiers="const"> + <return type="int" enum="Key" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_callback"> + <method name="global_menu_get_item_callback" qualifiers="const"> <return type="Callable" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the callback of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_icon" qualifiers="const"> + <return type="Texture2D" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the icon of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_index_from_tag" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="tag" type="Variant" /> + <description> + Returns the index of the item with the specified [code]tag[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_index_from_text" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="text" type="String" /> + <description> + Returns the index of the item with the specified [code]text[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_max_states" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns number of states of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_state" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_submenu"> + <method name="global_menu_get_item_submenu" qualifiers="const"> <return type="String" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the submenu ID of the item at index [code]idx[/code]. See [method global_menu_add_submenu_item] for more info on how to add a submenu. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_tag"> + <method name="global_menu_get_item_tag" qualifiers="const"> <return type="Variant" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the metadata of the specified item, which might be of any type. You can set it with [method global_menu_set_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_text"> + <method name="global_menu_get_item_text" qualifiers="const"> <return type="String" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_tooltip" qualifiers="const"> + <return type="String" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the tooltip associated with the specified index index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_is_item_checkable" qualifiers="const"> @@ -201,6 +424,8 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is checkable in some way, i.e. if it has a checkbox or radio button. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_is_item_checked" qualifiers="const"> @@ -208,6 +433,28 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is checked. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_is_item_disabled" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. When it is disabled it can't be selected, or its action invoked. + See [method global_menu_set_item_disabled] for more info on how to disable an item. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_is_item_radio_checkable" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns [code]true[/code] if the item at index [code]idx[/code] has radio button-style checkability. + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_remove_item"> @@ -215,6 +462,19 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Removes the item at index [code]idx[/code] from the global menu [code]menu_root[/code]. + [b]Note:[/b] The indices of items after the removed item will be shifted by one. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_accelerator"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="keycode" type="int" enum="Key" /> + <description> + Sets the accelerator of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_callback"> @@ -223,6 +483,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="callback" type="Callable" /> <description> + Sets the callback of the item at index [code]idx[/code]. Callback is emitted when an item is pressed or its accelerator is activated. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_checkable"> @@ -231,6 +493,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="checkable" type="bool" /> <description> + Sets whether the item at index [code]idx[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_checked"> @@ -239,6 +503,60 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="checked" type="bool" /> <description> + Sets the checkstate status of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_disabled"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="disabled" type="bool" /> + <description> + Enables/disables the item at index [code]idx[/code]. When it is disabled, it can't be selected and its action can't be invoked. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_icon"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="icon" type="Texture2D" /> + <description> + Replaces the [Texture2D] icon of the specified [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Note:[/b] This method is not supported by macOS "_dock" menu items. + </description> + </method> + <method name="global_menu_set_item_max_states"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="max_states" type="int" /> + <description> + Sets number of state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_radio_checkable"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="checkable" type="bool" /> + <description> + Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_state"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="state" type="int" /> + <description> + Sets the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_submenu"> @@ -247,6 +565,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="submenu" type="String" /> <description> + Sets the submenu of the item at index [code]idx[/code]. The submenu is the ID of a global menu root that would be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_tag"> @@ -255,6 +575,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="tag" type="Variant" /> <description> + Sets the metadata of an item, which may be of any type. You can later get it with [method global_menu_get_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_text"> @@ -263,6 +585,18 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="text" type="String" /> <description> + Sets the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_tooltip"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="tooltip" type="String" /> + <description> + Sets the [String] tooltip of the item at the specified index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="has_feature" qualifiers="const"> @@ -349,13 +683,6 @@ <description> </description> </method> - <method name="mouse_warp_to_position"> - <return type="void" /> - <argument index="0" name="position" type="Vector2i" /> - <description> - Sets the mouse cursor position to the given [code]position[/code]. - </description> - </method> <method name="process_events"> <return type="void" /> <description> @@ -500,6 +827,93 @@ [b]Note:[/b] This method is implemented on Windows. </description> </method> + <method name="tts_get_voices" qualifiers="const"> + <return type="Array" /> + <description> + Returns an [Array] of voice information dictionaries. + Each [Dictionary] contains two [String] entries: + - [code]name[/code] is voice name. + - [code]id[/code] is voice identifier. + - [code]language[/code] is language code in [code]lang_Variant[/code] format. [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And [code]Variant[/code] part is an engine dependent string describing country, region or/and dialect. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_get_voices_for_language" qualifiers="const"> + <return type="PackedStringArray" /> + <argument index="0" name="language" type="String" /> + <description> + Returns an [PackedStringArray] of voice identifiers for the [code]language[/code]. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_is_paused" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the synthesizer is in a paused state. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_is_speaking" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the synthesizer is generating speech, or have utterance waiting in the queue. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_pause"> + <return type="void" /> + <description> + Puts the synthesizer into a paused state. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_resume"> + <return type="void" /> + <description> + Resumes the synthesizer if it was paused. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_set_utterance_callback"> + <return type="void" /> + <argument index="0" name="event" type="int" enum="DisplayServer.TTSUtteranceEvent" /> + <argument index="1" name="callable" type="Callable" /> + <description> + Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary. + - [code]TTS_UTTERANCE_STARTED[/code], [code]TTS_UTTERANCE_ENDED[/code], and [code]TTS_UTTERANCE_CANCELED[/code] callable's method should take one [int] parameter, the utterance id. + - [code]TTS_UTTERANCE_BOUNDARY[/code] callable's method should take two [int] parameters, the index of the character and the utterance id. + [b]Note:[/b] The granularity of the boundary callbacks is engine dependent. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_speak"> + <return type="void" /> + <argument index="0" name="text" type="String" /> + <argument index="1" name="voice" type="String" /> + <argument index="2" name="volume" type="int" default="50" /> + <argument index="3" name="pitch" type="float" default="1.0" /> + <argument index="4" name="rate" type="float" default="1.0" /> + <argument index="5" name="utterance_id" type="int" default="0" /> + <argument index="6" name="interrupt" type="bool" default="false" /> + <description> + Adds an utterance to the queue. If [code]interrupt[/code] is [code]true[/code], the queue is cleared first. + - [code]voice[/code] identifier is one of the [code]"id"[/code] values returned by [method tts_get_voices] or one of the values returned by [method tts_get_voices_for_language]. + - [code]volume[/code] ranges from [code]0[/code] (lowest) to [code]100[/code] (highest). + - [code]pitch[/code] ranges from [code]0.0[/code] (lowest) to [code]2.0[/code] (highest), [code]1.0[/code] is default pitch for the current voice. + - [code]rate[/code] ranges from [code]0.1[/code] (lowest) to [code]10.0[/code] (highest), [code]1.0[/code] is a normal speaking rate. Other values act as a percentage relative. + - [code]utterance_id[/code] is passed as a parameter to the callback functions. + [b]Note:[/b] On Windows and Linux, utterance [code]text[/code] can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling [method tts_speak]. + [b]Note:[/b] The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> + <method name="tts_stop"> + <return type="void" /> + <description> + Stops synthesis in progress and removes all utterances from the queue. + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. + </description> + </method> <method name="virtual_keyboard_get_height" qualifiers="const"> <return type="int" /> <description> @@ -531,6 +945,13 @@ [b]Note:[/b] This method is implemented on Android, iOS and UWP. </description> </method> + <method name="warp_mouse"> + <return type="void" /> + <argument index="0" name="position" type="Vector2i" /> + <description> + Sets the mouse cursor position to the given [code]position[/code] relative to an origin at the upper left corner of the currently focused game Window Manager window. + </description> + </method> <method name="window_attach_instance_id"> <return type="void" /> <argument index="0" name="instance_id" type="int" /> @@ -544,6 +965,12 @@ <description> </description> </method> + <method name="window_get_active_popup" qualifiers="const"> + <return type="int" /> + <description> + Returns ID of the active popup window, or [constant INVALID_WINDOW_ID] if there is none. + </description> + </method> <method name="window_get_attached_instance_id" qualifiers="const"> <return type="int" /> <argument index="0" name="window_id" type="int" default="0" /> @@ -592,6 +1019,13 @@ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. </description> </method> + <method name="window_get_popup_safe_rect" qualifiers="const"> + <return type="Rect2i" /> + <argument index="0" name="window" type="int" /> + <description> + Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. + </description> + </method> <method name="window_get_position" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="window_id" type="int" default="0" /> @@ -749,6 +1183,14 @@ [b]Note:[/b] This method is implemented on Linux, macOS and Windows. </description> </method> + <method name="window_set_popup_safe_rect"> + <return type="void" /> + <argument index="0" name="window" type="int" /> + <argument index="1" name="rect" type="Rect2i" /> + <description> + Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup. + </description> + </method> <method name="window_set_position"> <return type="void" /> <argument index="0" name="position" type="Vector2i" /> @@ -842,6 +1284,9 @@ </constant> <constant name="FEATURE_CLIPBOARD_PRIMARY" value="18" enum="Feature"> </constant> + <constant name="FEATURE_TEXT_TO_SPEECH" value="19" enum="Feature"> + Display server supports text-to-speech. See [code]tts_*[/code] methods. + </constant> <constant name="MOUSE_MODE_VISIBLE" value="0" enum="MouseMode"> Makes the mouse cursor visible if it is hidden. </constant> @@ -930,16 +1375,24 @@ 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="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags"> + Window can't be resizing by dragging its resize grip. It's still possible to resize the window using [method window_set_size]. This flag is ignored for full screen windows. </constant> <constant name="WINDOW_FLAG_BORDERLESS" value="1" enum="WindowFlags"> + Window do not have native title bar and other decorations. This flag is ignored for full-screen windows. </constant> <constant name="WINDOW_FLAG_ALWAYS_ON_TOP" value="2" enum="WindowFlags"> + Window is floating above other regular windows. This flag is ignored for full-screen windows. </constant> <constant name="WINDOW_FLAG_TRANSPARENT" value="3" enum="WindowFlags"> + Window is will be destroyed with its transient parent and displayed on top of non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. </constant> <constant name="WINDOW_FLAG_NO_FOCUS" value="4" enum="WindowFlags"> + Window can't be focused. No-focus window will ignore all input, except mouse clicks. </constant> - <constant name="WINDOW_FLAG_MAX" value="5" enum="WindowFlags"> + <constant name="WINDOW_FLAG_POPUP" value="5" enum="WindowFlags"> + Window is part of menu or [OptionButton] dropdown. This flag can't be changed when window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have [constant WINDOW_FLAG_TRANSPARENT] set. + </constant> + <constant name="WINDOW_FLAG_MAX" value="6" enum="WindowFlags"> </constant> <constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent"> </constant> @@ -985,5 +1438,17 @@ - MacOS: [code]NSView*[/code] for the window main view. - iOS: [code]UIView*[/code] for the window main view. </constant> + <constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent"> + Utterance has begun to be spoken. + </constant> + <constant name="TTS_UTTERANCE_ENDED" value="1" enum="TTSUtteranceEvent"> + Utterance was successfully finished. + </constant> + <constant name="TTS_UTTERANCE_CANCELED" value="2" enum="TTSUtteranceEvent"> + Utterance was canceled, or TTS service was unable to process it. + </constant> + <constant name="TTS_UTTERANCE_BOUNDARY" value="3" enum="TTSUtteranceEvent"> + Utterance reached a word or sentence boundary. + </constant> </constants> </class> diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index 698d3bfcce..f217fbaf48 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -96,7 +96,7 @@ Adds a static lib from the given [code]path[/code] to the iOS project. </description> </method> - <method name="add_osx_plugin_file"> + <method name="add_macos_plugin_file"> <return type="void" /> <argument index="0" name="path" type="String" /> <description> @@ -108,6 +108,7 @@ <return type="void" /> <argument index="0" name="path" type="String" /> <argument index="1" name="tags" type="PackedStringArray" /> + <argument index="2" name="target" type="String" /> <description> Adds a shared object or a directory containing only shared objects with the given [code]tags[/code] and destination [code]path[/code]. [b]Note:[/b] In case of macOS exports, those shared objects will be added to [code]Frameworks[/code] directory of app bundle. diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml index 2ab87b0dd1..a6bdc294ac 100644 --- a/doc/classes/EditorFeatureProfile.xml +++ b/doc/classes/EditorFeatureProfile.xml @@ -57,7 +57,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's [b]Import[/b] button or the [method load_from_file] button. + Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's [b]Import[/b] button or the [method load_from_file] method. </description> </method> <method name="set_disable_class"> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 0474cbd387..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"> @@ -40,13 +42,13 @@ <member name="access" type="int" setter="set_access" getter="get_access" enum="EditorFileDialog.Access" default="0"> The location from which the user may select a file, including [code]res://[/code], [code]user://[/code], and the local file system. </member> - <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://""> + <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir"> The currently occupied directory. </member> - <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default=""""> + <member name="current_file" type="String" setter="set_current_file" getter="get_current_file"> The currently selected file. </member> - <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default=""res://""> + <member name="current_path" type="String" setter="set_current_path" getter="get_current_path"> The file system path in the address bar. </member> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> 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 new file mode 100644 index 0000000000..abd77909bd --- /dev/null +++ b/doc/classes/EditorFileSystemImportFormatSupportQuery.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EditorFileSystemImportFormatSupportQuery" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + 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 conjunction with asset format import plugins. + </description> + <tutorials> + </tutorials> + <methods> + <method name="_get_file_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + Return the file extensions supported. + </description> + </method> + <method name="_is_active" qualifiers="virtual const"> + <return type="bool" /> + <description> + Return whether this importer is active. + </description> + </method> + <method name="_query" qualifiers="virtual const"> + <return type="bool" /> + <description> + Query support. Return false if import must not continue. + </description> + </method> + </methods> +</class> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index cd249ed319..365e1f13a9 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -1,11 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="EditorInspector" inherits="ScrollContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A tab used to edit properties of the selected node. + A control used to edit properties of an object. </brief_description> <description> - The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as the Sprite2D then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. - [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_inspector]. + This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the [EditorInspector] used in the editor's Inspector dock, use [method EditorInterface.get_inspector]. + [EditorInspector] will show properties in the same order as the array returned by [method Object.get_property_list]. + If a property's name is path-like (i.e. if it contains forward slashes), [EditorInspector] will create nested sections for "directories" along the path. For example, if a property is named [code]highlighting/gdscript/node_path_color[/code], it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_GROUP] usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. [EditorInspector] will create a top-level section for each group. For example, if a property with group usage is named [code]Collide With[/code] and its hint string is [code]collide_with_[/code], a subsequent [code]collide_with_area[/code] property will be shown as "Area" inside the "Collide With" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_SUBGROUP] usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup. + [b]Note:[/b] Unlike sections created from path-like property names, [EditorInspector] won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names. </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 d28bf80a1e..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"> @@ -470,10 +517,16 @@ Returns the [EditorInterface] object that gives you control over Godot editor's window and its functionalities. </description> </method> + <method name="get_export_as_menu"> + <return type="PopupMenu" /> + <description> + Returns the [PopupMenu] under [b]Scene > Export As...[/b]. + </description> + </method> <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/EditorSceneFormatImporter.xml b/doc/classes/EditorSceneFormatImporter.xml index 63c1498f20..0290d7207d 100644 --- a/doc/classes/EditorSceneFormatImporter.xml +++ b/doc/classes/EditorSceneFormatImporter.xml @@ -29,16 +29,8 @@ <method name="_get_option_visibility" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="option" type="String" /> - <description> - </description> - </method> - <method name="_import_animation" qualifiers="virtual"> - <return type="Animation" /> - <argument index="0" name="path" type="String" /> - <argument index="1" name="flags" type="int" /> - <argument index="2" name="options" type="Dictionary" /> - <argument index="3" name="bake_fps" type="int" /> + <argument index="1" name="for_animation" type="bool" /> + <argument index="2" name="option" type="String" /> <description> </description> </method> @@ -63,5 +55,7 @@ </constant> <constant name="IMPORT_USE_NAMED_SKIN_BINDS" value="16"> </constant> + <constant name="IMPORT_DISCARD_MESHES_AND_MATERIALS" value="32"> + </constant> </constants> </class> diff --git a/doc/classes/EditorSceneFormatImporterFBX.xml b/doc/classes/EditorSceneFormatImporterFBX.xml deleted file mode 100644 index 21aebd4507..0000000000 --- a/doc/classes/EditorSceneFormatImporterFBX.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorSceneFormatImporterFBX" inherits="EditorSceneFormatImporter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - FBX 3D asset importer. - </brief_description> - <description> - This is an FBX 3D asset importer with full support for most FBX features. - If exporting a FBX scene from Autodesk Maya, use these FBX export settings: - [codeblock] - - Smoothing Groups - - Smooth Mesh - - Triangluate (for meshes with blend shapes) - - Bake Animation - - Resample All - - Deformed Models - - Skins - - Blend Shapes - - Curve Filters - - Constant Key Reducer - - Auto Tangents Only - - *Do not check* Constraints (as it will break the file) - - Can check Embed Media (embeds textures into the exported FBX file) - - Note that when importing embedded media, the texture and mesh will be a single immutable file. - - You will have to re-export then re-import the FBX if the texture has changed. - - Units: Centimeters - - Up Axis: Y - - Binary format in FBX 2017 - [/codeblock] - </description> - <tutorials> - </tutorials> -</class> diff --git a/doc/classes/EditorSceneFormatImporterGLTF.xml b/doc/classes/EditorSceneFormatImporterGLTF.xml deleted file mode 100644 index 6478e853eb..0000000000 --- a/doc/classes/EditorSceneFormatImporterGLTF.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorSceneFormatImporterGLTF" inherits="EditorSceneFormatImporter" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> -</class> diff --git a/doc/classes/EditorScenePostImportPlugin.xml b/doc/classes/EditorScenePostImportPlugin.xml index de9d5e067a..44d644411d 100644 --- a/doc/classes/EditorScenePostImportPlugin.xml +++ b/doc/classes/EditorScenePostImportPlugin.xml @@ -34,7 +34,8 @@ <method name="_get_internal_option_visibility" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="category" type="int" /> - <argument index="1" name="option" type="String" /> + <argument index="1" name="for_animation" type="bool" /> + <argument index="2" name="option" type="String" /> <description> Return true or false whether a given option should be visible. Return null to ignore. </description> @@ -42,7 +43,8 @@ <method name="_get_option_visibility" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="option" type="String" /> + <argument index="1" name="for_animation" type="bool" /> + <argument index="2" name="option" type="String" /> <description> Return true or false whether a given option should be visible. Return null to ignore. </description> @@ -86,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> @@ -112,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/EditorSettings.xml b/doc/classes/EditorSettings.xml index 81472c09ee..ac2250ab6d 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -70,6 +70,13 @@ [/codeblocks] </description> </method> + <method name="check_changed_settings_in_group" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="setting_prefix" type="String" /> + <description> + Checks if any settings with the prefix [code]setting_prefix[/code] exist in the set of changed settings. See also [method get_changed_settings]. + </description> + </method> <method name="erase"> <return type="void" /> <argument index="0" name="property" type="String" /> @@ -77,6 +84,12 @@ Erases the setting whose name is specified by [code]property[/code]. </description> </method> + <method name="get_changed_settings" qualifiers="const"> + <return type="Array" /> + <description> + Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED] + </description> + </method> <method name="get_favorites" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -118,6 +131,13 @@ Returns [code]true[/code] if the setting specified by [code]name[/code] exists, [code]false[/code] otherwise. </description> </method> + <method name="mark_setting_changed"> + <return type="void" /> + <argument index="0" name="setting" type="String" /> + <description> + Marks the passed editor setting as being changed, see [method get_changed_settings]. Only settings which exist (see [method has_setting]) will be accepted. + </description> + </method> <method name="property_can_revert"> <return type="bool" /> <argument index="0" name="name" type="String" /> diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index a45882b063..2ada211dab 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -11,7 +11,9 @@ <members> <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> + <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/EditorVCSInterface.xml b/doc/classes/EditorVCSInterface.xml index b78b027fa8..0215d81a4e 100644 --- a/doc/classes/EditorVCSInterface.xml +++ b/doc/classes/EditorVCSInterface.xml @@ -4,7 +4,7 @@ Version Control System (VCS) interface which reads and writes to the local VCS in use. </brief_description> <description> - Used by the editor to display VCS extracted information in the editor. The implementation of this API is included in VCS addons, which are essentially GDNative plugins that need to be put into the project folder. These VCS addons are scripts which are attached (on demand) to the object instance of [code]EditorVCSInterface[/code]. All the functions listed below, instead of performing the task themselves, they call the internally defined functions in the VCS addons to provide a plug-n-play experience. + Used by the editor to display VCS extracted information in the editor. The implementation of this API is included in VCS addons, which are essentially GDExtension plugins that need to be put into the project folder. These VCS addons are scripts which are attached (on demand) to the object instance of [code]EditorVCSInterface[/code]. All the functions listed below, instead of performing the task themselves, they call the internally defined functions in the VCS addons to provide a plug-n-play experience. </description> <tutorials> </tutorials> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index af4df321c1..36dfee833b 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -94,6 +94,17 @@ [/codeblock] </description> </method> + <method name="get_script_language" qualifiers="const"> + <return type="ScriptLanguage" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="get_script_language_count"> + <return type="int" /> + <description> + </description> + </method> <method name="get_singleton" qualifiers="const"> <return type="Object" /> <argument index="0" name="name" type="StringName" /> @@ -140,6 +151,12 @@ [/codeblocks] </description> </method> + <method name="get_write_movie_path" qualifiers="const"> + <return type="String" /> + <description> + Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. This path can be absolute or relative depending on how the user specified it. + </description> + </method> <method name="has_singleton" qualifiers="const"> <return type="bool" /> <argument index="0" name="name" type="StringName" /> @@ -167,6 +184,12 @@ Returns [code]true[/code] if the game is inside the fixed process and physics phase of the game loop. </description> </method> + <method name="register_script_language"> + <return type="void" /> + <argument index="0" name="language" type="ScriptLanguage" /> + <description> + </description> + </method> <method name="register_singleton"> <return type="void" /> <argument index="0" name="name" type="StringName" /> diff --git a/doc/classes/EngineProfiler.xml b/doc/classes/EngineProfiler.xml index 45eb926108..752ecda867 100644 --- a/doc/classes/EngineProfiler.xml +++ b/doc/classes/EngineProfiler.xml @@ -20,11 +20,11 @@ <method name="_tick" qualifiers="virtual"> <return type="void" /> <argument index="0" name="frame_time" type="float" /> - <argument index="1" name="idle_time" type="float" /> + <argument index="1" name="process_time" type="float" /> <argument index="2" name="physics_time" type="float" /> <argument index="3" name="physics_frame_time" type="float" /> <description> - Called once every engine iteration when the profiler is active with information about the current frame. + Called once every engine iteration when the profiler is active with information about the current frame. All time values are in seconds. Lower values represent faster processing times and are therefore considered better. </description> </method> <method name="_toggle" qualifiers="virtual"> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 90d774058b..9da360915b 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -51,16 +51,17 @@ The global color saturation value of the rendered scene (default value is 1). Effective only if [code]adjustment_enabled[/code] is [code]true[/code]. </member> <member name="ambient_light_color" type="Color" setter="set_ambient_light_color" getter="get_ambient_light_color" default="Color(0, 0, 0, 1)"> - The ambient light's [Color]. + The ambient light's [Color]. Only effective if [member ambient_light_sky_contribution] is lower than [code]1.0[/code] (exclusive). </member> <member name="ambient_light_energy" type="float" setter="set_ambient_light_energy" getter="get_ambient_light_energy" default="1.0"> - The ambient light's energy. The higher the value, the stronger the light. + The ambient light's energy. The higher the value, the stronger the light. Only effective if [member ambient_light_sky_contribution] is lower than [code]1.0[/code] (exclusive). </member> <member name="ambient_light_sky_contribution" type="float" setter="set_ambient_light_sky_contribution" getter="get_ambient_light_sky_contribution" default="1.0"> Defines the amount of light that the sky brings on the scene. A value of [code]0.0[/code] means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of [code]1.0[/code] means that [i]all[/i] the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. [b]Note:[/b] [member ambient_light_sky_contribution] is internally clamped between [code]0.0[/code] and [code]1.0[/code] (inclusive). </member> <member name="ambient_light_source" type="int" setter="set_ambient_source" getter="get_ambient_source" enum="Environment.AmbientSource" default="0"> + The ambient light source to use for rendering materials and global illumination. </member> <member name="auto_exposure_enabled" type="bool" setter="set_tonemap_auto_exposure_enabled" getter="is_tonemap_auto_exposure_enabled" default="false"> If [code]true[/code], enables the tonemapping auto exposure mode of the scene renderer. If [code]true[/code], the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. @@ -97,6 +98,7 @@ This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to [code]1.0[/code], the fog color comes completely from the [Sky]. If set to [code]0.0[/code], aerial perspective is disabled. </member> <member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.001"> + The exponential fog density to use. Higher values result in a more dense fog. </member> <member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" default="false"> If [code]true[/code], fog effects are enabled. @@ -108,10 +110,13 @@ The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value. </member> <member name="fog_light_color" type="Color" setter="set_fog_light_color" getter="get_fog_light_color" default="Color(0.5, 0.6, 0.7, 1)"> + The fog's color. </member> <member name="fog_light_energy" type="float" setter="set_fog_light_energy" getter="get_fog_light_energy" default="1.0"> + The fog's brightness. Higher values result in brighter fog. </member> <member name="fog_sun_scatter" type="float" setter="set_fog_sun_scatter" getter="get_fog_sun_scatter" default="0.0"> + If set above [code]0.0[/code], renders the scene's directional light(s) in the fog color depending on the view angle. This can be used to give the impression that the sun is "piercing" through the fog. </member> <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment.GlowBlendMode" default="2"> The glow blending mode. @@ -132,7 +137,7 @@ The lower threshold of the HDR glow. When using the OpenGL renderer (which doesn't support HDR), this needs to be below [code]1.0[/code] for glow to be visible. A value of [code]0.9[/code] works well in this case. </member> <member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" default="0.8"> - The overall brightness multiplier of the glow effect. When using the OpenGL renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering. + The overall brightness multiplier of the glow effect. When using the OpenGL renderer, this should be increased to [code]1.5[/code] to compensate for the lack of HDR rendering. </member> <member name="glow_levels/1" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0"> The intensity of the 1st level of glow. This is the most "local" level (least blurry). @@ -163,6 +168,7 @@ How strong of an impact the [member glow_map] should have on the overall glow effect. A strength of [code]0.0[/code] means the glow map has no effect on the overall glow effect. A strength of [code]1.0[/code] means the glow has a full effect on the overall glow effect (and can turn off glow entirely in specific areas of the screen if the glow map has black areas). </member> <member name="glow_mix" type="float" setter="set_glow_mix" getter="get_glow_mix" default="0.05"> + When using the [constant GLOW_BLEND_MODE_MIX] [member glow_blend_mode], this controls how much the source image is blended with the glow layer. A value of [code]0.0[/code] makes the glow rendering invisible, while a value of [code]1.0[/code] is equivalent to [constant GLOW_BLEND_MODE_REPLACE]. </member> <member name="glow_normalized" type="bool" setter="set_glow_normalized" getter="is_glow_normalized" default="false"> If [code]true[/code], glow levels will be normalized so that summed together their intensities equal [code]1.0[/code]. @@ -171,10 +177,15 @@ The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the OpenGL renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering. </member> <member name="reflected_light_source" type="int" setter="set_reflection_source" getter="get_reflection_source" enum="Environment.ReflectionSource" default="0"> + The reflected (specular) light source. </member> <member name="sdfgi_bounce_feedback" type="float" setter="set_sdfgi_bounce_feedback" getter="get_sdfgi_bounce_feedback" default="0.5"> + The energy multiplier applied to light every time it bounces from a surface when using SDFGI. Values greater than [code]0.0[/code] will simulate multiple bounces, resulting in a more realistic appearance. Increasing [member sdfgi_bounce_feedback] generally has no performance impact. See also [member sdfgi_energy]. + [b]Note:[/b] Values greater than [code]0.5[/code] can cause infinite feedback loops and should be avoided in scenes with bright materials. + [b]Note:[/b] If [member sdfgi_bounce_feedback] is [code]0.0[/code], indirect lighting will not be represented in reflections as light will only bounce one time. </member> <member name="sdfgi_cascade0_distance" type="float" setter="set_sdfgi_cascade0_distance" getter="get_sdfgi_cascade0_distance" default="12.8"> + [b]Note:[/b] This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_max_distance]. Changing its value will automatically change those properties as well. </member> <member name="sdfgi_cascades" type="int" setter="set_sdfgi_cascades" getter="get_sdfgi_cascades" default="4"> The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows displaying SDFGI further away while preserving detail up close, at the cost of performance. When using SDFGI on small-scale levels, [member sdfgi_cascades] can often be decreased between [code]1[/code] and [code]4[/code] to improve performance. @@ -185,42 +196,39 @@ [b]Note:[/b] Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. </member> <member name="sdfgi_energy" type="float" setter="set_sdfgi_energy" getter="get_sdfgi_energy" default="1.0"> + The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also [member sdfgi_bounce_feedback]. </member> <member name="sdfgi_max_distance" type="float" setter="set_sdfgi_max_distance" getter="get_sdfgi_max_distance" default="204.8"> + The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as [ReflectionProbe] will be used as a fallback. + [b]Note:[/b] This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. </member> <member name="sdfgi_min_cell_size" type="float" setter="set_sdfgi_min_cell_size" getter="get_sdfgi_min_cell_size" default="0.2"> + The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to be more precise up close, at the cost of making SDFGI updates more demanding. This can cause stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also reducing the performance impact of SDFGI updates. + [b]Note:[/b] This property is linked to [member sdfgi_max_distance] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. </member> <member name="sdfgi_normal_bias" type="float" setter="set_sdfgi_normal_bias" getter="get_sdfgi_normal_bias" default="1.1"> + The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. </member> <member name="sdfgi_probe_bias" type="float" setter="set_sdfgi_probe_bias" getter="get_sdfgi_probe_bias" default="1.1"> + The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. </member> <member name="sdfgi_read_sky_light" type="bool" setter="set_sdfgi_read_sky_light" getter="is_sdfgi_reading_sky_light" default="true"> + If [code]true[/code], SDFGI takes the environment lighting into account. This should be set to [code]false[/code] for interior scenes. </member> <member name="sdfgi_use_occlusion" type="bool" setter="set_sdfgi_use_occlusion" getter="is_sdfgi_using_occlusion" default="false"> + If [code]true[/code], SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. [member sdfgi_use_occlusion] has a performance impact and should only be enabled when needed. </member> <member name="sdfgi_y_scale" type="int" setter="set_sdfgi_y_scale" getter="get_sdfgi_y_scale" enum="Environment.SDFGIYScale" default="1"> + The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed together more closely on the Y axis. This is used to balance between quality and covering a lot of vertical ground. [member sdfgi_y_scale] should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis). </member> <member name="sky" type="Sky" setter="set_sky" getter="get_sky"> The [Sky] resource used for this [Environment]. </member> <member name="sky_custom_fov" type="float" setter="set_sky_custom_fov" getter="get_sky_custom_fov" default="0.0"> + If set to a value greater than [code]0.0[/code], overrides the field of view to use for sky rendering. If set to [code]0.0[/code], the same FOV as the current [Camera3D] is used for sky rendering. </member> <member name="sky_rotation" type="Vector3" setter="set_sky_rotation" getter="get_sky_rotation" default="Vector3(0, 0, 0)"> - </member> - <member name="ss_reflections_depth_tolerance" type="float" setter="set_ssr_depth_tolerance" getter="get_ssr_depth_tolerance" default="0.2"> - The depth tolerance for screen-space reflections. - </member> - <member name="ss_reflections_enabled" type="bool" setter="set_ssr_enabled" getter="is_ssr_enabled" default="false"> - If [code]true[/code], screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [VoxelGI]s or [ReflectionProbe]s, but are slower and can't reflect surfaces occluded by others. - </member> - <member name="ss_reflections_fade_in" type="float" setter="set_ssr_fade_in" getter="get_ssr_fade_in" default="0.15"> - The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). Only positive values are valid (negative values will be clamped to [code]0.0[/code]). - </member> - <member name="ss_reflections_fade_out" type="float" setter="set_ssr_fade_out" getter="get_ssr_fade_out" default="2.0"> - The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). - </member> - <member name="ss_reflections_max_steps" type="int" setter="set_ssr_max_steps" getter="get_ssr_max_steps" default="64"> - The maximum number of steps for screen-space reflections. Higher values are slower. + The rotation to use for sky rendering. </member> <member name="ssao_ao_channel_affect" type="float" setter="set_ssao_ao_channel_affect" getter="get_ssao_ao_channel_affect" default="0.0"> The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than [code]0[/code] will make the SSAO effect visible in areas darkened by AO textures. @@ -264,14 +272,29 @@ <member name="ssil_sharpness" type="float" setter="set_ssil_sharpness" getter="get_ssil_sharpness" default="0.98"> The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. </member> + <member name="ssr_depth_tolerance" type="float" setter="set_ssr_depth_tolerance" getter="get_ssr_depth_tolerance" default="0.2"> + The depth tolerance for screen-space reflections. + </member> + <member name="ssr_enabled" type="bool" setter="set_ssr_enabled" getter="is_ssr_enabled" default="false"> + If [code]true[/code], screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [VoxelGI]s or [ReflectionProbe]s, but are slower and can't reflect surfaces occluded by others. + </member> + <member name="ssr_fade_in" type="float" setter="set_ssr_fade_in" getter="get_ssr_fade_in" default="0.15"> + The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). Only positive values are valid (negative values will be clamped to [code]0.0[/code]). + </member> + <member name="ssr_fade_out" type="float" setter="set_ssr_fade_out" getter="get_ssr_fade_out" default="2.0"> + The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). + </member> + <member name="ssr_max_steps" type="int" setter="set_ssr_max_steps" getter="get_ssr_max_steps" default="64"> + The maximum number of steps for screen-space reflections. Higher values are slower. + </member> <member name="tonemap_exposure" type="float" setter="set_tonemap_exposure" getter="get_tonemap_exposure" default="1.0"> - The default exposure used for tonemapping. + The default exposure used for tonemapping. Higher values result in a brighter image. See also [member tonemap_white]. </member> <member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" enum="Environment.ToneMapper" default="0"> The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.) </member> <member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="1.0"> - The white reference value for tonemapping. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR]. + The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR]. See also [member tonemap_exposure]. </member> <member name="volumetric_fog_albedo" type="Color" setter="set_volumetric_fog_albedo" getter="get_volumetric_fog_albedo" default="Color(1, 1, 1, 1)"> The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to [code]Color(1, 1, 1, 1)[/code] while smoke has a darker albedo. @@ -336,10 +359,10 @@ Gather ambient light from whichever source is specified as the background. </constant> <constant name="AMBIENT_SOURCE_DISABLED" value="1" enum="AmbientSource"> - Disable ambient light. + Disable ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. </constant> <constant name="AMBIENT_SOURCE_COLOR" value="2" enum="AmbientSource"> - Specify a specific [Color] for ambient light. + Specify a specific [Color] for ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. </constant> <constant name="AMBIENT_SOURCE_SKY" value="3" enum="AmbientSource"> Gather ambient light from the [Sky] regardless of what the background is. @@ -348,22 +371,23 @@ Use the background for reflections. </constant> <constant name="REFLECTION_SOURCE_DISABLED" value="1" enum="ReflectionSource"> - Disable reflections. + Disable reflections. This provides a slight performance boost over other options. </constant> <constant name="REFLECTION_SOURCE_SKY" value="2" enum="ReflectionSource"> Use the [Sky] for reflections regardless of what the background is. </constant> <constant name="TONE_MAPPER_LINEAR" value="0" enum="ToneMapper"> - Linear tonemapper operator. Reads the linear data and passes it on unmodified. + Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. </constant> <constant name="TONE_MAPPER_REINHARDT" value="1" enum="ToneMapper"> - Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. + Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull. </constant> <constant name="TONE_MAPPER_FILMIC" value="2" enum="ToneMapper"> - Filmic tonemapper operator. + Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant TONE_MAPPER_REINHARDT]. </constant> <constant name="TONE_MAPPER_ACES" value="3" enum="ToneMapper"> - Academy Color Encoding System tonemapper operator. + Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [constant TONE_MAPPER_REINHARDT] and [constant TONE_MAPPER_FILMIC]. + [b]Note:[/b] This tonemapping operator is called "ACES Fitted" in Godot 3.x. </constant> <constant name="GLOW_BLEND_MODE_ADDITIVE" value="0" enum="GlowBlendMode"> Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. @@ -381,10 +405,13 @@ Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect. </constant> <constant name="SDFGI_Y_SCALE_50_PERCENT" value="0" enum="SDFGIYScale"> + Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. </constant> <constant name="SDFGI_Y_SCALE_75_PERCENT" value="1" enum="SDFGIYScale"> + Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. </constant> <constant name="SDFGI_Y_SCALE_100_PERCENT" value="2" enum="SDFGIYScale"> + Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. </constant> </constants> </class> 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/File.xml b/doc/classes/File.xml index 29283e107d..0b4a8fa46e 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -74,7 +74,7 @@ [/codeblocks] </description> </method> - <method name="file_exists" qualifiers="const"> + <method name="file_exists" qualifiers="static"> <return type="bool" /> <argument index="0" name="path" type="String" /> <description> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index 05d90390f8..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"> @@ -56,13 +57,13 @@ The file system access scope. See enum [code]Access[/code] constants. [b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url]. </member> - <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://""> + <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir"> The current working directory of the file dialog. </member> - <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default=""""> + <member name="current_file" type="String" setter="set_current_file" getter="get_current_file"> The currently selected file of the file dialog. </member> - <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default=""res://""> + <member name="current_path" type="String" setter="set_current_path" getter="get_current_path"> The currently selected file path of the file dialog. </member> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> @@ -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 c869141ef6..3f2ee3035c 100644 --- a/doc/classes/FogVolume.xml +++ b/doc/classes/FogVolume.xml @@ -11,13 +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 4ba15d7afc..ec2776f636 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="font_size" type="int" /> + <argument index="4" name="modulate" 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="3" name="font_size" type="int" /> + <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> - 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="font_size" 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,14 +184,31 @@ <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="RID[]" /> + <description> + Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. + </description> + </method> <method name="get_spacing" qualifiers="const"> <return type="int" /> <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> @@ -201,14 +219,19 @@ <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. + Returns the size of a bounding box of a single-line string, taking kerning and advance into account. See also [method get_multiline_string_size] and [method draw_string]. + For example, to get the string size as displayed by a single-line Label, use: + [codeblock] + var string_size = $Label.get_theme_font("font").get_string_size($Label.text, HORIZONTAL_ALIGNMENT_LEFT, -1, $Label.get_theme_font_size("font_size")) + [/codeblock] [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. - See also [method draw_string]. </description> </method> <method name="get_supported_chars" qualifiers="const"> @@ -218,9 +241,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. @@ -228,7 +264,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. @@ -241,45 +277,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 ccaefc60ee..dc2cbdde63 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. + </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), 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"> @@ -318,7 +291,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. + Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. [b]Warning:[/b] This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the [code]user://[/code] directory. </description> </method> @@ -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,18 +549,24 @@ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contents of the dynamic font source file. </member> + <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. </member> <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"> If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </member> + <member name="generate_mipmaps" type="bool" setter="set_generate_mipmaps" getter="get_generate_mipmaps" default="false"> + If set to [code]true[/code], generate mipmaps for the font textures. + </member> <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="1"> Font hinting mode. Used by dynamic fonts only. </member> 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/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index 3de0d0dbe9..53894bad87 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -57,6 +57,9 @@ <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. </member> + <member name="interpolate" type="bool" setter="set_interpolate" getter="get_interpolate" default="true"> + Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. + </member> <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. </member> diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index 899b5dec27..c4bd18db69 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -90,6 +90,7 @@ If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. </member> <member name="interpolate" type="bool" setter="set_interpolate" getter="get_interpolate" default="true"> + Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. </member> <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. 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 e7e14375d9..3fcad43efb 100644 --- a/doc/classes/GPUParticlesCollisionHeightField3D.xml +++ b/doc/classes/GPUParticlesCollisionHeightField3D.xml @@ -1,41 +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_mode" getter="is_follow_camera_mode_enabled" default="false"> - </member> - <member name="follow_camera_push_ratio" type="float" setter="set_follow_camera_push_ratio" getter="get_follow_camera_push_ratio" default="0.1"> + <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 446a90463d..195c481187 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> @@ -126,7 +126,7 @@ <return type="Dictionary" /> <argument index="0" name="sizes" type="PackedVector2Array" /> <description> - Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is a vector of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2]. + Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is an array of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2]. </description> </method> <method name="merge_polygons"> @@ -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"> @@ -209,7 +209,7 @@ <return type="PackedInt32Array" /> <argument index="0" name="polygon" type="PackedVector2Array" /> <description> - Triangulates the polygon specified by the points in [code]polygon[/code]. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [code]polygon[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PackedInt32Array] is returned. + Triangulates the polygon specified by the points in [code]polygon[/code]. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [code]polygon[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). Output triangles will always be counter clockwise, and the contour will be flipped if it's clockwise. If the triangulation did not succeed, an empty [PackedInt32Array] is returned. </description> </method> </methods> 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/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index 77afb98225..c803f43fb0 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -31,22 +31,22 @@ </method> </methods> <members> - <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" enum="GeometryInstance3D.ShadowCastingSetting" default="1"> + <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" enum="GeometryInstance3D.ShadowCastingSetting"> The selected shadow casting flag. See [enum ShadowCastingSetting] for possible values. </member> - <member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" default="0.0"> + <member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin"> The extra distance added to the GeometryInstance3D's bounding box ([AABB]) to increase its cull box. </member> - <member name="gi_lightmap_scale" type="int" setter="set_lightmap_scale" getter="get_lightmap_scale" enum="GeometryInstance3D.LightmapScale" default="0"> + <member name="gi_lightmap_scale" type="int" setter="set_lightmap_scale" getter="get_lightmap_scale" enum="GeometryInstance3D.LightmapScale"> The texel density to use for lightmapping in [LightmapGI]. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes. </member> - <member name="gi_mode" type="int" setter="set_gi_mode" getter="get_gi_mode" enum="GeometryInstance3D.GIMode" default="0"> + <member name="gi_mode" type="int" setter="set_gi_mode" getter="get_gi_mode" enum="GeometryInstance3D.GIMode"> The global illumination mode to use for the whole geometry. To avoid inconsistent results, use a mode that matches the purpose of the mesh during gameplay (static/dynamic). [b]Note:[/b] Lights' bake mode will also affect the global illumination rendering. See [member Light3D.light_bake_mode]. </member> - <member name="ignore_occlusion_culling" type="bool" setter="set_ignore_occlusion_culling" getter="is_ignoring_occlusion_culling" default="false"> + <member name="ignore_occlusion_culling" type="bool" setter="set_ignore_occlusion_culling" getter="is_ignoring_occlusion_culling"> </member> - <member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias" default="1.0"> + <member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias"> </member> <member name="material_overlay" type="Material" setter="set_material_overlay" getter="get_material_overlay"> The material overlay for the whole geometry. @@ -56,26 +56,26 @@ The material override for the whole geometry. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. </member> - <member name="transparency" type="float" setter="set_transparency" getter="get_transparency" default="0.0"> + <member name="transparency" type="float" setter="set_transparency" getter="get_transparency"> The transparency applied to the whole geometry (as a multiplier of the materials' existing transparency). [code]0.0[/code] is fully opaque, while [code]1.0[/code] is fully transparent. Values greater than [code]0.0[/code] (exclusive) will force the geometry's materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting [member transparency] to a value greater than [code]0.0[/code] (exclusive) will [i]not[/i] disable shadow rendering. In spatial shaders, [code]1.0 - transparency[/code] is set as the default value of the [code]ALPHA[/code] built-in. [b]Note:[/b] [member transparency] is clamped between [code]0.0[/code] and [code]1.0[/code], so this property cannot be used to make transparent materials more opaque than they originally are. </member> - <member name="visibility_range_begin" type="float" setter="set_visibility_range_begin" getter="get_visibility_range_begin" default="0.0"> + <member name="visibility_range_begin" type="float" setter="set_visibility_range_begin" getter="get_visibility_range_begin"> Starting distance from which the GeometryInstance3D will be visible, taking [member visibility_range_begin_margin] into account as well. The default value of 0 is used to disable the range check. </member> - <member name="visibility_range_begin_margin" type="float" setter="set_visibility_range_begin_margin" getter="get_visibility_range_begin_margin" default="0.0"> + <member name="visibility_range_begin_margin" type="float" setter="set_visibility_range_begin_margin" getter="get_visibility_range_begin_margin"> Margin for the [member visibility_range_begin] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_begin] threshold by this amount. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. </member> - <member name="visibility_range_end" type="float" setter="set_visibility_range_end" getter="get_visibility_range_end" default="0.0"> + <member name="visibility_range_end" type="float" setter="set_visibility_range_end" getter="get_visibility_range_end"> Distance from which the GeometryInstance3D will be hidden, taking [member visibility_range_end_margin] into account as well. The default value of 0 is used to disable the range check. </member> - <member name="visibility_range_end_margin" type="float" setter="set_visibility_range_end_margin" getter="get_visibility_range_end_margin" default="0.0"> + <member name="visibility_range_end_margin" type="float" setter="set_visibility_range_end_margin" getter="get_visibility_range_end_margin"> Margin for the [member visibility_range_end] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_end] threshold by this amount. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. </member> - <member name="visibility_range_fade_mode" type="int" setter="set_visibility_range_fade_mode" getter="get_visibility_range_fade_mode" enum="GeometryInstance3D.VisibilityRangeFadeMode" default="0"> + <member name="visibility_range_fade_mode" type="int" setter="set_visibility_range_fade_mode" getter="get_visibility_range_fade_mode" enum="GeometryInstance3D.VisibilityRangeFadeMode"> Controls which instances will be faded when approaching the limits of the visibility range. See [enum VisibilityRangeFadeMode] for possible values. </member> </members> 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 5525e7f1f3..965dbe7449 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -198,9 +198,13 @@ </method> </methods> <members> + <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <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> @@ -217,7 +221,6 @@ <member name="panning_scheme" type="int" setter="set_panning_scheme" getter="get_panning_scheme" enum="GraphEdit.PanningScheme" default="0"> Defines the control scheme for panning with mouse wheel. </member> - <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="right_disconnects" type="bool" setter="set_right_disconnects" getter="is_right_disconnects_enabled" default="false"> If [code]true[/code], enables disconnection of existing connections in the GraphEdit by dragging the right end. </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"> @@ -342,7 +346,7 @@ </description> </signal> <signal name="scroll_offset_changed"> - <argument index="0" name="ofs" type="Vector2" /> + <argument index="0" name="offset" type="Vector2" /> <description> Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code. </description> @@ -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 1e9169146e..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> @@ -331,7 +342,7 @@ <theme_item name="comment" data_type="style" type="StyleBox"> The [StyleBox] used when [member comment] is enabled. </theme_item> - <theme_item name="commentfocus" data_type="style" type="StyleBox"> + <theme_item name="comment_focus" data_type="style" type="StyleBox"> The [StyleBox] used when [member comment] is enabled and the [GraphNode] is focused. </theme_item> <theme_item name="frame" data_type="style" type="StyleBox"> @@ -340,8 +351,11 @@ <theme_item name="position" data_type="style" type="StyleBox"> The background used when [member overlay] is set to [constant OVERLAY_POSITION]. </theme_item> - <theme_item name="selectedframe" data_type="style" type="StyleBox"> + <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/GridContainer.xml b/doc/classes/GridContainer.xml index 59777ffb79..8b7a0fe407 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -9,6 +9,7 @@ [b]Note:[/b] GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> <members> @@ -17,10 +18,10 @@ </member> </members> <theme_items> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal separation of children nodes. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> + <theme_item name="v_separation" data_type="constant" type="int" default="4"> The vertical separation of children nodes. </theme_item> </theme_items> diff --git a/doc/classes/HBoxContainer.xml b/doc/classes/HBoxContainer.xml index 0af9f7a0f4..21267215eb 100644 --- a/doc/classes/HBoxContainer.xml +++ b/doc/classes/HBoxContainer.xml @@ -7,6 +7,7 @@ Horizontal box container. See [BoxContainer]. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <theme_items> <theme_item name="separation" data_type="constant" type="int" default="4"> diff --git a/doc/classes/HFlowContainer.xml b/doc/classes/HFlowContainer.xml index 3cee25e3ab..a8594a1c76 100644 --- a/doc/classes/HFlowContainer.xml +++ b/doc/classes/HFlowContainer.xml @@ -9,10 +9,10 @@ <tutorials> </tutorials> <theme_items> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal separation of children nodes. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> + <theme_item name="v_separation" data_type="constant" type="int" default="4"> The vertical separation of children nodes. </theme_item> </theme_items> 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/HSplitContainer.xml b/doc/classes/HSplitContainer.xml index f240718176..8137e26b8c 100644 --- a/doc/classes/HSplitContainer.xml +++ b/doc/classes/HSplitContainer.xml @@ -7,6 +7,7 @@ Horizontal split container. See [SplitContainer]. This goes from left to right. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <theme_items> <theme_item name="autohide" data_type="constant" type="int" default="1"> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 42047a68c8..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) { @@ -247,7 +250,8 @@ <member name="max_redirects" type="int" setter="set_max_redirects" getter="get_max_redirects" default="8"> Maximum number of allowed redirects. </member> - <member name="timeout" type="int" setter="set_timeout" getter="get_timeout" default="0"> + <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/HeightMapShape3D.xml b/doc/classes/HeightMapShape3D.xml index b8fe094490..206981e547 100644 --- a/doc/classes/HeightMapShape3D.xml +++ b/doc/classes/HeightMapShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="HeightMapShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Height map shape for 3D physics. + Height map shape resource for 3D physics. </brief_description> <description> - Height map shape resource, which can be added to a [PhysicsBody3D] or [Area3D]. + Height map shape resource, which can be added to a [PhysicsBody3D] or [Area3D]. Heightmap collision is typically used for colliding with terrains. However, since heightmaps cannot store overhangs, collisions with other structures (such as buildings) must be done with other collision shapes such as [ConcavePolygonShape3D]. If needed, "holes" can be created in an [HeightMapShape3D] by assigning very low points (like [code]-100000[/code]) in the desired area. + [b]Performance:[/b] [HeightMapShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. </description> <tutorials> </tutorials> diff --git a/doc/classes/IP.xml b/doc/classes/IP.xml index 7ecac8680a..569f7fe570 100644 --- a/doc/classes/IP.xml +++ b/doc/classes/IP.xml @@ -103,7 +103,7 @@ <constant name="RESOLVER_STATUS_ERROR" value="3" enum="ResolverStatus"> DNS hostname resolver status: Error. </constant> - <constant name="RESOLVER_MAX_QUERIES" value="32"> + <constant name="RESOLVER_MAX_QUERIES" value="256"> Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is returned if exceeded. </constant> <constant name="RESOLVER_INVALID_ID" value="-1"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 35868563de..a927345e79 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -23,39 +23,39 @@ <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]. + 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> </method> <method name="blend_rect_mask"> <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]. 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. [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. + 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> </method> <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]. + 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> </method> <method name="blit_rect_mask"> <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]. [code]src[/code] pixel is copied onto [code]dst[/code] if the corresponding [code]mask[/code] pixel's alpha value is not 0. [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. + 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> </method> <method name="bump_map_to_normal_map"> @@ -153,7 +153,7 @@ Returns [constant ALPHA_BLEND] if the image has data for alpha values. Returns [constant ALPHA_BIT] if all the alpha values are stored in a single bit. Returns [constant ALPHA_NONE] if no data for alpha values is found. </description> </method> - <method name="detect_used_channels"> + <method name="detect_used_channels" qualifiers="const"> <return type="int" enum="Image.UsedChannels" /> <argument index="0" name="source" type="int" enum="Image.CompressSource" default="0" /> <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 d35dacfcde..084bf7e809 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. @@ -18,7 +16,7 @@ var texture = load("res://icon.png") $Sprite2D.texture = texture [/codeblock] - This is because images have to be imported as a [StreamTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method. + This is because images have to be imported as a [CompressedTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method. [b]Note:[/b] The image can be retrieved from an imported texture using the [method Texture2D.get_image] method, which returns a copy of the image: [codeblock] var texture = load("res://icon.png") @@ -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"> @@ -44,9 +42,17 @@ Returns the format of the texture, one of [enum Image.Format]. </description> </method> + <method name="set_image"> + <return type="void" /> + <argument index="0" name="image" type="Image" /> + <description> + Replaces the texture's data with a new [Image]. This will re-allocate new memory for the texture. + If you want to update the image, but don't need to change its parameters (format, size), use [method update] instead for better performance. + </description> + </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> @@ -56,8 +62,8 @@ <argument index="0" name="image" type="Image" /> <description> Replaces the texture's data with a new [Image]. - [b]Note:[/b] The texture has to be initialized first with the [method create_from_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the [method create_from_image] method. - Use this method over [method create_from_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. + [b]Note:[/b] The texture has to be created using [method create_from_image] or initialized first with the [method set_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration. + Use this method over [method set_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. </description> </method> </methods> 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 2cbcfb8d9b..796a80873f 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> @@ -58,7 +58,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="get_action_strength" qualifiers="const"> @@ -67,7 +67,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="get_axis" qualifiers="const"> @@ -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" /> @@ -186,7 +180,7 @@ <description> Returns [code]true[/code] when the user starts pressing the action event, meaning it's [code]true[/code] only on the frame that the user pressed down the button. This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. [b]Note:[/b] Due to keyboard ghosting, [method is_action_just_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. </description> </method> @@ -196,7 +190,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] when the user stops pressing the action event, meaning it's [code]true[/code] only on the frame that the user released the button. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="is_action_pressed" qualifiers="const"> @@ -205,7 +199,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. [b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. </description> </method> @@ -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" /> @@ -375,19 +354,32 @@ <return type="void" /> <argument index="0" name="duration_ms" type="int" default="500" /> <description> - Vibrate Android and iOS devices. - [b]Note:[/b] It needs [code]VIBRATE[/code] permission for Android at export settings. iOS does not support duration. + Vibrate handheld devices. + [b]Note:[/b] This method is implemented on Android, iOS, and HTML5. + [b]Note:[/b] For Android, it requires enabling the [code]VIBRATE[/code] permission in the export preset. + [b]Note:[/b] For iOS, specifying the duration is supported in iOS 13 and later. + [b]Note:[/b] Some web browsers such as Safari and Firefox for Android do not support this method. </description> </method> - <method name="warp_mouse_position"> + <method name="warp_mouse"> <return type="void" /> - <argument index="0" name="to" type="Vector2" /> + <argument index="0" name="position" type="Vector2" /> <description> - Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the game window. + Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the currently focused Window Manager game window. Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if [enum MouseMode] is set to [code]MOUSE_MODE_CONFINED[/code] or [code]MOUSE_MODE_CONFINED_HIDDEN[/code]. </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" /> @@ -427,10 +419,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/InputEvent.xml b/doc/classes/InputEvent.xml index cbed163f18..230ad04b33 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -33,7 +33,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion]. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="is_action" qualifiers="const"> @@ -42,7 +42,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] if this input event matches a pre-defined action of any type. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="is_action_pressed" qualifiers="const"> @@ -52,7 +52,7 @@ <argument index="2" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. [b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. </description> </method> @@ -62,7 +62,7 @@ <argument index="1" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="is_action_type" qualifiers="const"> @@ -83,7 +83,7 @@ <argument index="1" name="exact_match" type="bool" default="true" /> <description> Returns [code]true[/code] if the specified [code]event[/code] matches this event. Only valid for action events i.e key ([InputEventKey]), button ([InputEventMouseButton] or [InputEventJoypadButton]), axis [InputEventJoypadMotion] or action ([InputEventAction]) events. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="is_pressed" qualifiers="const"> diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml index 5066fb29d3..edbc5b1e0b 100644 --- a/doc/classes/InputEventJoypadButton.xml +++ b/doc/classes/InputEventJoypadButton.xml @@ -17,7 +17,7 @@ If [code]true[/code], the button's state is pressed. If [code]false[/code], the button's state is released. </member> <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> - Represents the pressure the user puts on the button with his finger, if the controller supports it. Ranges from [code]0[/code] to [code]1[/code]. + Represents the pressure the user puts on the button with their finger, if the controller supports it. Ranges from [code]0[/code] to [code]1[/code]. </member> </members> </class> 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/InputMap.xml b/doc/classes/InputMap.xml index ac5921404c..eb708432b4 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -45,6 +45,7 @@ <argument index="0" name="action" type="StringName" /> <description> Returns an array of [InputEvent]s associated with a given action. + [b]Note:[/b] When used in the editor (e.g. a tool script or [EditorPlugin]), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the [code]input/*[/code] settings from [ProjectSettings]. </description> </method> <method name="action_has_event"> @@ -86,7 +87,7 @@ <argument index="2" name="exact_match" type="bool" default="false" /> <description> Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. - If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + If [code]exact_match[/code] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. </description> </method> <method name="get_actions"> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 875d8d27b2..15c97b0838 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -7,6 +7,8 @@ This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list. 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> @@ -36,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" /> @@ -120,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" /> @@ -300,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" /> @@ -366,6 +344,7 @@ <member name="auto_height" type="bool" setter="set_auto_height" getter="has_auto_height" default="false"> If [code]true[/code], the control will automatically resize the height to fit its content. </member> + <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" default="0"> The width all columns will be adjusted to. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. @@ -393,7 +372,6 @@ Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. [b]Note:[/b] This property takes effect only when [member icon_mode] is [constant ICON_MODE_TOP]. To make the text wrap, [member fixed_column_width] should be greater than zero. </member> - <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="same_column_width" type="bool" setter="set_same_column_width" getter="is_same_column_width" default="false"> Whether all columns will have the same width. If [code]true[/code], the width is equal to the largest column width of all columns. @@ -401,24 +379,31 @@ <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="0"> - 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> + <signal name="empty_clicked"> + <argument index="0" name="at_position" type="Vector2" /> + <argument index="1" name="mouse_button_index" type="int" /> + <description> + Triggered when any mouse click is issued within the rect of the list but on empty space. + </description> + </signal> <signal name="item_activated"> <argument index="0" name="index" type="int" /> <description> Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd]. </description> </signal> - <signal name="item_rmb_selected"> + <signal name="item_clicked"> <argument index="0" name="index" type="int" /> <argument index="1" name="at_position" type="Vector2" /> + <argument index="2" name="mouse_button_index" type="int" /> <description> - Triggered when specified list item has been selected via right mouse clicking. + Triggered when specified list item has been clicked with any mouse button. The click position is also provided to allow appropriate popup of context menus at the correct location. - [member allow_rmb_select] must be enabled. </description> </signal> <signal name="item_selected"> @@ -435,18 +420,6 @@ Triggered when a multiple selection is altered on a list allowing multiple selection. </description> </signal> - <signal name="nothing_selected"> - <description> - Triggered when a left mouse click is issued within the rect of the list but on empty space. - </description> - </signal> - <signal name="rmb_clicked"> - <argument index="0" name="at_position" type="Vector2" /> - <description> - Triggered when a right mouse click is issued within the rect of the list but on empty space. - [member allow_rmb_select] must be enabled. - </description> - </signal> </signals> <constants> <constant name="ICON_MODE_TOP" value="0" enum="IconMode"> @@ -475,7 +448,7 @@ <theme_item name="guide_color" data_type="color" type="Color" default="Color(0, 0, 0, 0.1)"> [Color] of the guideline. The guideline is a line drawn between each row of items. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal spacing between items. </theme_item> <theme_item name="icon_margin" data_type="constant" type="int" default="4"> @@ -487,7 +460,7 @@ <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="2"> + <theme_item name="v_separation" data_type="constant" type="int" default="2"> The vertical spacing between items. </theme_item> <theme_item name="font" data_type="font" type="Font"> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index b1046dea6b..1ebf770f7e 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,8 @@ <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"> + </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> @@ -85,7 +66,7 @@ [b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count]. </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="4" /> - <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> + <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="[]"> @@ -97,8 +78,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 +91,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 new file mode 100644 index 0000000000..5ba0a2d79a --- /dev/null +++ b/doc/classes/Label3D.xml @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Label3D" inherits="GeometryInstance3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Displays plain text in a 3D world. + </brief_description> + <description> + Label3D displays plain text in a 3D world. It gives you control over the horizontal and vertical alignment. + </description> + <tutorials> + </tutorials> + <methods> + <method name="generate_triangle_mesh" qualifiers="const"> + <return type="TriangleMesh" /> + <description> + Returns a [TriangleMesh] with the label's vertices following its current configuration (such as its [member pixel_size]). + </description> + </method> + <method name="get_draw_flag" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="flag" type="int" enum="Label3D.DrawFlags" /> + <description> + Returns the value of the specified flag. + </description> + </method> + <method name="set_draw_flag"> + <return type="void" /> + <argument index="0" name="flag" type="int" enum="Label3D.DrawFlags" /> + <argument index="1" name="enabled" type="bool" /> + <description> + If [code]true[/code], the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. + </description> + </method> + </methods> + <members> + <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="Label3D.AlphaCutMode" default="0"> + The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values. + </member> + <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="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. + </member> + <member name="double_sided" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="true"> + If [code]true[/code], text can be seen from the back as well, if [code]false[/code], it is invisible when looking at it from behind. + </member> + <member name="fixed_size" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> + 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 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, 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. + </member> + <member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0"> + Vertical space between lines in multiline [Label3D]. + </member> + <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> + Text [Color] of the [Label3D]. + </member> + <member name="no_depth_test" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> + If [code]true[/code], depth testing is disabled and the object will be drawn in render order. + </member> + <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> + 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 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. + [b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). + [b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + </member> + <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0"> + Text outline size. + </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 label to scale it in 3D. + </member> + <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> + Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. + [b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). + [b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + </member> + <member name="shaded" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> + If [code]true[/code], the [Light3D] in the [Environment] has effects on the label. + </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 display on screen. + </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="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="BaseMaterial3D.TextureFilter" default="3"> + Filter flags for the texture. See [enum BaseMaterial3D.TextureFilter] for options. + </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="vertical_alignment" type="int" setter="set_vertical_alignment" getter="get_vertical_alignment" enum="VerticalAlignment" default="1"> + Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants. + </member> + <member name="width" type="float" setter="set_width" getter="get_width" default="500.0"> + Text width (in pixels), used for autowrap and fill alignment. + </member> + </members> + <constants> + <constant name="FLAG_SHADED" value="0" enum="DrawFlags"> + If set, lights in the environment affect the label. + </constant> + <constant name="FLAG_DOUBLE_SIDED" value="1" enum="DrawFlags"> + If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind. + </constant> + <constant name="FLAG_DISABLE_DEPTH_TEST" value="2" enum="DrawFlags"> + Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + </constant> + <constant name="FLAG_FIXED_SIZE" value="3" enum="DrawFlags"> + Label is scaled by depth so that it always appears the same size on screen. + </constant> + <constant name="FLAG_MAX" value="4" enum="DrawFlags"> + Represents the size of the [enum DrawFlags] enum. + </constant> + <constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode"> + This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. + </constant> + <constant name="ALPHA_CUT_DISCARD" value="1" enum="AlphaCutMode"> + This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa]). This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i]. + [b]Note:[/b] This mode might have issues with anti-aliased fonts and outlines, try adjusting [member alpha_scissor_threshold] or using MSDF font. + [b]Note:[/b] When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + </constant> + <constant name="ALPHA_CUT_OPAQUE_PREPASS" value="2" enum="AlphaCutMode"> + This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. + [b]Note:[/b] When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + </constant> + </constants> +</class> diff --git a/doc/classes/LabelSettings.xml b/doc/classes/LabelSettings.xml new file mode 100644 index 0000000000..227313d3b3 --- /dev/null +++ b/doc/classes/LabelSettings.xml @@ -0,0 +1,29 @@ +<?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> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <members> + <member name="font" type="Font" setter="set_font" getter="get_font"> + </member> + <member name="font_color" type="Color" setter="set_font_color" getter="get_font_color" default="Color(0.875, 0.875, 0.875, 1)"> + </member> + <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> + </member> + <member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0"> + </member> + <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color(1, 1, 1, 1)"> + </member> + <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0"> + </member> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(1, 1, 1, 1)"> + </member> + <member name="shadow_offset" type="Vector2" setter="set_shadow_offset" getter="get_shadow_offset" default="Vector2(1, 1)"> + </member> + <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" default="0"> + </member> + </members> +</class> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index a058611915..0ebd83c882 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -28,6 +28,23 @@ </method> </methods> <members> + <member name="distance_fade_begin" type="float" setter="set_distance_fade_begin" getter="get_distance_fade_begin" default="40.0"> + The distance from the camera at which the light begins to fade away (in 3D units). + [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D]. + </member> + <member name="distance_fade_enabled" type="bool" setter="set_enable_distance_fade" getter="is_distance_fade_enabled" default="false"> + If [code]true[/code], the light will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. This acts as a form of level of detail (LOD). The light will fade out over [member distance_fade_begin] + [member distance_fade_length], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active lights in a scene and thus improve performance. + [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D]. + </member> + <member name="distance_fade_length" type="float" setter="set_distance_fade_length" getter="get_distance_fade_length" default="10.0"> + Distance over which the light fades. The light's energy is progressively reduced over this distance and is completely invisible at the end. + [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D]. + </member> + <member name="distance_fade_shadow" type="float" setter="set_distance_fade_shadow" getter="get_distance_fade_shadow" default="50.0"> + The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than [member distance_fade_begin] + [member distance_fade_length] to further improve performance, as shadow rendering is often more expensive than light rendering itself. + [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D], and only when [member shadow_enabled] is [code]true[/code]. + [b]Note:[/b] Due to a rendering engine limitation, shadows will be disabled instantly instead of fading smoothly according to [member distance_fade_length]. This may result in visible pop-in depending on the scene topography. + </member> <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" default="false"> If [code]true[/code], the light only appears in the editor and will not be visible at runtime. </member> @@ -56,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. @@ -63,17 +81,14 @@ <member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5"> The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. </member> - <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.2"> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1"> Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. </member> <member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0"> Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. </member> - <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 1)"> - The color of shadows cast by this light. - </member> <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false"> - If [code]true[/code], the light will cast shadows. + If [code]true[/code], the light will cast real-time shadows. This has a significant performance cost. Only enable shadow rendering when it makes a noticeable difference in the scene's appearance, and consider using [member distance_fade_enabled] to hide the light when far away from the [Camera3D]. </member> <member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="0.1"> </member> 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..13f44150d7 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 considered 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/Line2D.xml b/doc/classes/Line2D.xml index 88574c0028..e2cc43bb75 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -121,10 +121,10 @@ Takes the left pixels of the texture and renders it over the whole line. </constant> <constant name="LINE_TEXTURE_TILE" value="1" enum="LineTextureMode"> - Tiles the texture over the line. The texture must be imported with [b]Repeat[/b] enabled for it to work properly. + Tiles the texture over the line. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or [constant CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly. </constant> <constant name="LINE_TEXTURE_STRETCH" value="2" enum="LineTextureMode"> - Stretches the texture across the line. Import the texture with [b]Repeat[/b] disabled for best results. + Stretches the texture across the line. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] for best results. </constant> </constants> </class> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 136147b4b0..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"> @@ -251,7 +230,7 @@ <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> If [code]false[/code], using shortcuts will be disabled. </member> - <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> + <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="[]"> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index ad5a5a5518..7c6ff2d4e1 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -9,36 +9,11 @@ </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="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="0" /> <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> - <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" overrides="Control" enum="Control.CursorShape" default="2" /> - <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> + <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="[]"> diff --git a/doc/classes/MarginContainer.xml b/doc/classes/MarginContainer.xml index 3f9f93a39b..3b2ace8475 100644 --- a/doc/classes/MarginContainer.xml +++ b/doc/classes/MarginContainer.xml @@ -26,6 +26,7 @@ [/codeblocks] </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <theme_items> <theme_item name="margin_bottom" data_type="constant" type="int" default="0"> diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index 78dbf8729b..c5d567c1fe 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -11,6 +11,26 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="_can_do_next_pass" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_can_use_render_priority" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_get_shader_mode" qualifiers="virtual const"> + <return type="int" enum="Shader.Mode" /> + <description> + </description> + </method> + <method name="_get_shader_rid" qualifiers="virtual const"> + <return type="RID" /> + <description> + </description> + </method> <method name="inspect_native_shader_code"> <return type="void" /> <description> @@ -22,7 +42,7 @@ Sets the [Material] to be used for the next pass. This renders the object again using a different material. [b]Note:[/b] This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". </member> - <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> + <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority"> Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. [b]Note:[/b] This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". [b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index c32f7318c0..bec567b3ef 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -64,7 +64,7 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [MenuButton] is being pressed. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="3"> + <theme_item name="h_separation" data_type="constant" type="int" default="3"> The horizontal space between [MenuButton]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index c5bfdcecd2..48fa2754d5 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -13,6 +13,89 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="_get_aabb" qualifiers="virtual const"> + <return type="AABB" /> + <description> + </description> + </method> + <method name="_get_blend_shape_count" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_blend_shape_name" qualifiers="virtual const"> + <return type="StringName" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_get_surface_count" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_set_blend_shape_name" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="index" type="int" /> + <argument index="1" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="_surface_get_array_index_len" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_array_len" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_arrays" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_blend_shape_arrays" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_format" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_lods" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_material" qualifiers="virtual const"> + <return type="Material" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_get_primitive_type" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </method> + <method name="_surface_set_material" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="index" type="int" /> + <argument index="1" name="material" type="Material" /> + <description> + </description> + </method> <method name="create_convex_shape" qualifiers="const"> <return type="Shape3D" /> <argument index="0" name="clean" type="bool" default="true" /> @@ -40,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"> @@ -93,7 +176,7 @@ </method> </methods> <members> - <member name="lightmap_size_hint" type="Vector2i" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint" default="Vector2i(0, 0)"> + <member name="lightmap_size_hint" type="Vector2i" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint"> Sets a hint to be used for lightmap resolution. </member> </members> @@ -132,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. @@ -153,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. @@ -190,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. @@ -207,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/MissingNode.xml b/doc/classes/MissingNode.xml new file mode 100644 index 0000000000..b5aa02cfd6 --- /dev/null +++ b/doc/classes/MissingNode.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MissingNode" inherits="Node" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + This is an internal editor class intended for keeping data of nodes of unknown type. + </brief_description> + <description> + This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can´t be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + </description> + <tutorials> + </tutorials> + <members> + <member name="original_class" type="String" setter="set_original_class" getter="get_original_class"> + </member> + <member name="recording_properties" type="bool" setter="set_recording_properties" getter="is_recording_properties"> + </member> + </members> +</class> diff --git a/doc/classes/MissingResource.xml b/doc/classes/MissingResource.xml new file mode 100644 index 0000000000..eede6350d8 --- /dev/null +++ b/doc/classes/MissingResource.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MissingResource" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + This is an internal editor class intended for keeping data of resources of unknown type. + </brief_description> + <description> + This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can´t be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + </description> + <tutorials> + </tutorials> + <members> + <member name="original_class" type="String" setter="set_original_class" getter="get_original_class"> + </member> + <member name="recording_properties" type="bool" setter="set_recording_properties" getter="is_recording_properties"> + </member> + </members> +</class> diff --git a/doc/classes/MovieWriter.xml b/doc/classes/MovieWriter.xml new file mode 100644 index 0000000000..d47e52d7c0 --- /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 overriding [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/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml index ac17886183..059d147979 100644 --- a/doc/classes/MultiplayerAPI.xml +++ b/doc/classes/MultiplayerAPI.xml @@ -6,7 +6,7 @@ <description> This class implements the high-level multiplayer API. See also [MultiplayerPeer]. By default, [SceneTree] has a reference to this class that is used to provide multiplayer capabilities (i.e. RPCs) across the whole scene. - It is possible to override the MultiplayerAPI instance used by specific Nodes by setting the [member Node.custom_multiplayer] property, effectively allowing to run both client and server in the same scene. + It is possible to override the MultiplayerAPI instance used by specific tree branches by calling the [method SceneTree.set_multiplayer] method, effectively allowing to run both client and server in the same scene. [b]Note:[/b] The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. </description> @@ -53,7 +53,7 @@ <method name="poll"> <return type="void" /> <description> - Method used for polling the MultiplayerAPI. You only need to worry about this if you are using [member Node.custom_multiplayer] override or you set [member SceneTree.multiplayer_poll] to [code]false[/code]. By default, [SceneTree] will poll its MultiplayerAPI for you. + Method used for polling the MultiplayerAPI. You only need to worry about this if you set [member SceneTree.multiplayer_poll] to [code]false[/code]. By default, [SceneTree] will poll its MultiplayerAPI(s) for you. [b]Note:[/b] This method results in RPCs being called, so they will be executed in the same context of this function (e.g. [code]_process[/code], [code]physics[/code], [Thread]). </description> </method> diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml index c5fe04cb32..f837171e2f 100644 --- a/doc/classes/MultiplayerPeerExtension.xml +++ b/doc/classes/MultiplayerPeerExtension.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="MultiplayerPeerExtension" inherits="MultiplayerPeer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Class that can be inherited to implement custom multiplayer API networking layers via GDExtension. </brief_description> <description> + This class is designed to be inherited from a GDExtension plugin to implement custom networking layers for the multiplayer API (such as WebRTC). All the methods below [b]must[/b] be implemented to have a working custom multiplayer implementation. See also [MultiplayerAPI]. </description> <tutorials> </tutorials> @@ -10,16 +12,19 @@ <method name="_get_available_packet_count" qualifiers="virtual const"> <return type="int" /> <description> + Called when the available packet count is internally requested by the [MultiplayerAPI]. </description> </method> <method name="_get_connection_status" qualifiers="virtual const"> <return type="int" /> <description> + Called when the connection status is requested on the [MultiplayerPeer] (see [method MultiplayerPeer.get_connection_status]). </description> </method> <method name="_get_max_packet_size" qualifiers="virtual const"> <return type="int" /> <description> + Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI]. </description> </method> <method name="_get_packet" qualifiers="virtual"> @@ -27,41 +32,55 @@ <argument index="0" name="r_buffer" type="const uint8_t **" /> <argument index="1" name="r_buffer_size" type="int32_t*" /> <description> + Called when a packet needs to be received by the [MultiplayerAPI], with [code]p_buffer_size[/code] being the size of the binary [code]p_buffer[/code] in bytes. </description> </method> <method name="_get_packet_peer" qualifiers="virtual const"> <return type="int" /> <description> + Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see [method MultiplayerPeer.get_packet_peer]). + </description> + </method> + <method name="_get_packet_script" qualifiers="virtual"> + <return type="PackedByteArray" /> + <description> + Called when a packet needs to be received by the [MultiplayerAPI], if [method _get_packet] isn't implemented. Use this when extending this class via GDScript. </description> </method> <method name="_get_transfer_channel" qualifiers="virtual const"> <return type="int" /> <description> + Called when the transfer channel to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). </description> </method> <method name="_get_transfer_mode" qualifiers="virtual const"> <return type="int" /> <description> + Called when the transfer mode to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). </description> </method> <method name="_get_unique_id" qualifiers="virtual const"> <return type="int" /> <description> + Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). </description> </method> <method name="_is_refusing_new_connections" qualifiers="virtual const"> <return type="bool" /> <description> + Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). </description> </method> <method name="_is_server" qualifiers="virtual const"> <return type="bool" /> <description> + Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server]. </description> </method> <method name="_poll" qualifiers="virtual"> <return type="int" /> <description> + Called when the [MultiplayerAPI] is polled. See [method MultiplayerAPI.poll]. </description> </method> <method name="_put_packet" qualifiers="virtual"> @@ -69,30 +88,42 @@ <argument index="0" name="p_buffer" type="const uint8_t*" /> <argument index="1" name="p_buffer_size" type="int" /> <description> + Called when a packet needs to be sent by the [MultiplayerAPI], with [code]p_buffer_size[/code] being the size of the binary [code]p_buffer[/code] in bytes. + </description> + </method> + <method name="_put_packet_script" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="p_buffer" type="PackedByteArray" /> + <description> + Called when a packet needs to be sent by the [MultiplayerAPI], if [method _put_packet] isn't implemented. Use this when extending this class via GDScript. </description> </method> <method name="_set_refuse_new_connections" qualifiers="virtual"> <return type="void" /> <argument index="0" name="p_enable" type="bool" /> <description> + Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). </description> </method> <method name="_set_target_peer" qualifiers="virtual"> <return type="void" /> <argument index="0" name="p_peer" type="int" /> <description> + Called when the target peer to use is set for this [MultiplayerPeer] (see [method MultiplayerPeer.set_target_peer]). </description> </method> <method name="_set_transfer_channel" qualifiers="virtual"> <return type="void" /> <argument index="0" name="p_channel" type="int" /> <description> + Called when the channel to use is set for this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). </description> </method> <method name="_set_transfer_mode" qualifiers="virtual"> <return type="void" /> <argument index="0" name="p_mode" type="int" /> <description> + Called when the transfer mode is set on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). </description> </method> </methods> diff --git a/doc/classes/MultiplayerSpawner.xml b/doc/classes/MultiplayerSpawner.xml index 465db85455..9de67068eb 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" /> @@ -21,10 +43,6 @@ </method> </methods> <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..3766491a6c 100644 --- a/doc/classes/MultiplayerSynchronizer.xml +++ b/doc/classes/MultiplayerSynchronizer.xml @@ -6,12 +6,64 @@ </description> <tutorials> </tutorials> + <methods> + <method name="add_visibility_filter"> + <return type="void" /> + <argument index="0" name="filter" type="Callable" /> + <description> + </description> + </method> + <method name="get_visibility_for" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="peer" type="int" /> + <description> + </description> + </method> + <method name="remove_visibility_filter"> + <return type="void" /> + <argument index="0" name="filter" type="Callable" /> + <description> + </description> + </method> + <method name="set_visibility_for"> + <return type="void" /> + <argument index="0" name="peer" type="int" /> + <argument index="1" name="visible" type="bool" /> + <description> + </description> + </method> + <method name="update_visibility"> + <return type="void" /> + <argument index="0" name="for_peer" type="int" default="0" /> + <description> + </description> + </method> + </methods> <members> + <member name="public_visibility" type="bool" setter="set_visibility_public" getter="is_visibility_public" default="true"> + </member> + <member name="replication_config" type="SceneReplicationConfig" setter="set_replication_config" getter="get_replication_config"> + </member> <member name="replication_interval" type="float" setter="set_replication_interval" getter="get_replication_interval" default="0.0"> </member> - <member name="resource" type="SceneReplicationConfig" setter="set_replication_config" getter="get_replication_config"> + <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath("..")"> </member> - <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath("")"> + <member name="visibility_update_mode" type="int" setter="set_visibility_update_mode" getter="get_visibility_update_mode" enum="MultiplayerSynchronizer.VisibilityUpdateMode" default="0"> </member> </members> + <signals> + <signal name="visibility_changed"> + <argument index="0" name="for_peer" type="int" /> + <description> + </description> + </signal> + </signals> + <constants> + <constant name="VISIBILITY_PROCESS_IDLE" value="0" enum="VisibilityUpdateMode"> + </constant> + <constant name="VISIBILITY_PROCESS_PHYSICS" value="1" enum="VisibilityUpdateMode"> + </constant> + <constant name="VISIBILITY_PROCESS_NONE" value="2" enum="VisibilityUpdateMode"> + </constant> + </constants> </class> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index b7b23a1097..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,23 +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="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 18886ac33e..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,17 +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="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 b1165174a2..75b6544827 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -7,18 +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 e007633a1e..f5824a24fd 100644 --- a/doc/classes/NavigationRegion3D.xml +++ b/doc/classes/NavigationRegion3D.xml @@ -6,14 +6,40 @@ <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> <methods> <method name="bake_navigation_mesh"> <return type="void" /> + <argument index="0" name="on_thread" type="bool" default="true" /> <description> - Bakes the [NavigationMesh]. The baking is done in a separate thread because navigation baking is not a cheap operation. This can be done at runtime. When it is completed, it automatically sets the new [NavigationMesh]. + 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"> + <return type="RID" /> + <description> + 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> @@ -21,12 +47,18 @@ <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 a59666356c..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"> @@ -110,11 +120,17 @@ Sets the current velocity of the agent. </description> </method> - <method name="free" qualifiers="const"> + <method name="free_rid" qualifiers="const"> <return type="void" /> - <argument index="0" name="object" type="RID" /> + <argument index="0" name="rid" type="RID" /> <description> - Destroy the RID + 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"> @@ -123,6 +139,23 @@ 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 7d11a30647..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"> @@ -110,11 +120,17 @@ Sets the current velocity of the agent. </description> </method> - <method name="free" qualifiers="const"> + <method name="free_rid" qualifiers="const"> <return type="void" /> - <argument index="0" name="object" type="RID" /> + <argument index="0" name="rid" type="RID" /> <description> - Destroy the RID + 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"> @@ -123,6 +139,23 @@ 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 5291ecab08..b7591ed4f4 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -84,6 +84,17 @@ [b]Note:[/b] [method _ready] may be called only once for each node. After removing a node from the scene tree and adding it again, [code]_ready[/code] will not be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again. </description> </method> + <method name="_shortcut_input" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="event" type="InputEvent" /> + <description> + Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. + It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input]. + To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + This method can be used to handle shortcuts. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + </description> + </method> <method name="_unhandled_input" qualifiers="virtual"> <return type="void" /> <argument index="0" name="event" type="InputEvent" /> @@ -102,6 +113,7 @@ Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> @@ -133,7 +145,7 @@ [/csharp] [/codeblocks] If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method. - [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://godot.readthedocs.io/en/latest/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=https://godot.readthedocs.io/en/latest/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. + [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=$DOCS_URL/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=$DOCS_URL/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. </description> </method> <method name="add_sibling"> @@ -181,28 +193,45 @@ [b]Note:[/b] It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to [method Object._init] method). In that case, the node will be duplicated without a script. </description> </method> - <method name="find_nodes" qualifiers="const"> + <method name="find_child" qualifiers="const"> + <return type="Node" /> + <argument index="0" name="pattern" type="String" /> + <argument index="1" name="recursive" type="bool" default="true" /> + <argument index="2" name="owned" type="bool" default="true" /> + <description> + Finds the first descendant of this node whose name matches [code]pattern[/code] as in [method String.match]. + [code]pattern[/code] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). + If [code]recursive[/code] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [code]recursive[/code] is [code]false[/code], only this node's direct children are matched. + If [code]owned[/code] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. + Returns [code]null[/code] if no matching [Node] is found. + [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] with unique names instead (see [member unique_name_in_owner]), or caching the node references into variable. + [b]Note:[/b] To find all descendant nodes matching a pattern or a class type, see [method find_children]. + </description> + </method> + <method name="find_children" qualifiers="const"> <return type="Node[]" /> - <argument index="0" name="mask" type="String" /> + <argument index="0" name="pattern" type="String" /> <argument index="1" name="type" type="String" default="""" /> <argument index="2" name="recursive" type="bool" default="true" /> <argument index="3" name="owned" type="bool" default="true" /> <description> - Finds descendants of this node whose, name matches [code]mask[/code] as in [method String.match], and/or type matches [code]type[/code] as in [method Object.is_class]. - [code]mask[/code] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). - [code]type[/code] will check equality or inheritance. It is case-sensitive, [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around. - If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. - Returns an empty array, if no matching nodes are found. - [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get references to other nodes. To avoid using [method find_nodes] too often, consider caching the node references into variables. + Finds descendants of this node whose name matches [code]pattern[/code] as in [method String.match], and/or type matches [code]type[/code] as in [method Object.is_class]. + [code]pattern[/code] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). + [code]type[/code] will check equality or inheritance, and is case-sensitive. [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around. + If [code]recursive[/code] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [code]recursive[/code] is [code]false[/code], only this node's direct children are matched. + If [code]owned[/code] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. + Returns an empty array if no matching nodes are found. + [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get references to other nodes. Whenever possible, consider caching the node references into variables. + [b]Note:[/b] If you only want to find the first descendant node that matches a pattern, see [method find_child]. </description> </method> <method name="find_parent" qualifiers="const"> <return type="Node" /> - <argument index="0" name="mask" type="String" /> + <argument index="0" name="pattern" type="String" /> <description> - Finds the first parent of the current node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). - [b]Note:[/b] It does not match against the full path, just against individual node names. - [b]Note:[/b] As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using [method get_node] instead. To avoid using [method find_parent] too often, consider caching the node reference into a variable. + Finds the first parent of the current node whose name matches [code]pattern[/code] as in [method String.match]. + [code]pattern[/code] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). + [b]Note:[/b] As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using [method get_node] with unique names instead (see [member unique_name_in_owner]), or caching the node references into variable. </description> </method> <method name="get_child" qualifiers="const"> @@ -462,6 +491,12 @@ Returns [code]true[/code] if internal processing is enabled (see [method set_process_internal]). </description> </method> + <method name="is_processing_shortcut_input" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the node is processing shortcuts (see [method set_process_shortcut_input]). + </description> + </method> <method name="is_processing_unhandled_input" qualifiers="const"> <return type="bool" /> <description> @@ -483,10 +518,11 @@ [b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]). </description> </method> - <method name="print_stray_nodes"> + <method name="print_orphan_nodes"> <return type="void" /> <description> - Prints all stray nodes (nodes outside the [SceneTree]). Used for debugging. Works only in debug builds. + Prints all orphan nodes (nodes outside the [SceneTree]). Used for debugging. + [b]Note:[/b] [method print_orphan_nodes] only works in debug builds. When called in a project exported in release mode, [method print_orphan_nodes] will not print anything. </description> </method> <method name="print_tree"> @@ -586,10 +622,10 @@ </description> </method> <method name="rpc" qualifiers="vararg"> - <return type="Variant" /> + <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> @@ -601,15 +637,15 @@ <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"> - <return type="Variant" /> + <return type="void" /> <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"> @@ -672,6 +708,13 @@ [b]Warning:[/b] Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. </description> </method> + <method name="set_process_shortcut_input"> + <return type="void" /> + <argument index="0" name="enable" type="bool" /> + <description> + Enables shortcut processing. Enabled automatically if [method _shortcut_input] is overridden. Any calls to this before [method _ready] will be ignored. + </description> + </method> <method name="set_process_unhandled_input"> <return type="void" /> <argument index="0" name="enable" type="bool" /> @@ -702,14 +745,11 @@ </method> </methods> <members> - <member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer"> - The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one. - </member> <member name="editor_description" type="String" setter="set_editor_description" getter="get_editor_description" default=""""> - Add a custom description to a node. + Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree. </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> - The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). + The [MultiplayerAPI] instance associated with this node. See [method SceneTree.get_multiplayer]. </member> <member name="name" type="StringName" setter="set_name" getter="get_name"> The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed. @@ -717,6 +757,7 @@ </member> <member name="owner" type="Node" setter="set_owner" getter="get_owner"> The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]), all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing. + [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=$DOCS_URL/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=$DOCS_URL/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. </member> <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Node.ProcessMode" default="0"> Can be used to pause or unpause the node, or make the node paused based on the [SceneTree], or make it inherit the process mode from its parent (default). @@ -727,18 +768,24 @@ <member name="scene_file_path" type="String" setter="set_scene_file_path" getter="get_scene_file_path"> If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in [member scene_file_path] (e.g. [code]res://levels/1.tscn[/code]). Otherwise, [member scene_file_path] is set to an empty string. </member> + <member name="unique_name_in_owner" type="bool" setter="set_unique_name_in_owner" getter="is_unique_name_in_owner" default="false"> + Sets this node's name as a unique name in its [member owner]. This allows the node to be accessed as [code]%Name[/code] instead of the full path, from any node within that scene. + If another node with the same owner already had that name declared as unique, that other node's name will no longer be set as having a unique name. + </member> </members> <signals> <signal name="child_entered_tree"> <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"> @@ -754,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"> @@ -764,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. @@ -803,10 +854,13 @@ Notification received when the node is instantiated. </constant> <constant name="NOTIFICATION_DRAG_BEGIN" value="21"> - Notification received when a drag begins. + Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one. + Can be triggered either by dragging a [Control] that provides drag data (see [method Control._get_drag_data]) or using [method Control.force_drag]. + Use [method Viewport.gui_get_drag_data] to get the dragged data. </constant> <constant name="NOTIFICATION_DRAG_END" value="22"> - Notification received when a drag ends. + Notification received when a drag operation ends. + Use [method Viewport.gui_is_drag_successful] to check if the drag succeeded. </constant> <constant name="NOTIFICATION_PATH_RENAMED" value="23"> Notification received when the node's name or one of its parents' name is changed. This notification is [i]not[/i] received when the node is removed from the scene tree to be added to another parent later on. 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 3d3e139781..d9e0680a38 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -5,21 +5,22 @@ </brief_description> <description> A pre-parsed relative or absolute path in a scene tree, for use with [method Node.get_node] and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For instance, [code]"Path2D/PathFollow2D/Sprite2D:texture:size"[/code] would refer to the [code]size[/code] property of the [code]texture[/code] resource on the node named [code]"Sprite2D"[/code] which is a child of the other named nodes in the path. - You will usually just pass a string to [method Node.get_node] and it will be automatically converted, but you may occasionally want to parse a path ahead of time with [NodePath] or the literal syntax [code]@"path"[/code]. Exporting a [NodePath] variable will give you a node selection widget in the properties panel of the editor, which can often be useful. + You will usually just pass a string to [method Node.get_node] and it will be automatically converted, but you may occasionally want to parse a path ahead of time with [NodePath] or the literal syntax [code]^"path"[/code]. Exporting a [NodePath] variable will give you a node selection widget in the properties panel of the editor, which can often be useful. A [NodePath] is composed of a list of slash-separated node names (like a filesystem path) and an optional colon-separated list of "subnames" which can be resources or properties. Some examples of NodePaths include the following: [codeblock] # No leading slash means it is relative to the current node. - @"A" # Immediate child A - @"A/B" # A's child B - @"." # The current node. - @".." # The parent node. - @"../C" # A sibling node C. + ^"A" # Immediate child A + ^"A/B" # A's child B + ^"." # The current node. + ^".." # The parent node. + ^"../C" # A sibling node C. # A leading slash means it is absolute from the SceneTree. - @"/root" # Equivalent to get_tree().get_root(). - @"/root/Main" # If your main scene's root node were named "Main". - @"/root/MyAutoload" # If you have an autoloaded node or scene. + ^"/root" # Equivalent to get_tree().get_root(). + ^"/root/Main" # If your main scene's root node were named "Main". + ^"/root/MyAutoload" # If you have an autoloaded node or scene. [/codeblock] + See also [StringName], which is a similar concept for general-purpose string interning. [b]Note:[/b] In the editor, [NodePath] properties are automatically updated when moving, renaming or deleting a node in the scene tree, but they are never updated at runtime. </description> <tutorials> @@ -36,7 +37,7 @@ <return type="NodePath" /> <argument index="0" name="from" type="NodePath" /> <description> - Constructs a [NodePath] as a copy of the given [NodePath]. + Constructs a [NodePath] as a copy of the given [NodePath]. [code]NodePath("example")[/code] is equivalent to [code]^"example"[/code]. </description> </constructor> <constructor name="NodePath"> @@ -86,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> @@ -106,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") @@ -156,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> @@ -172,22 +185,12 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="NodePath" /> <description> </description> </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="NodePath" /> <description> </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 bc9bfc9676..5473347cb1 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] @@ -278,7 +288,7 @@ <return type="String" /> <description> Returns the name of the host OS. - On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] (Universal Windows Platform) if exported thereon. + On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] if exported on Universal Windows Platform. On macOS, this is [code]"macOS"[/code]. On Linux-based operating systems, this is [code]"Linux"[/code]. On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback. @@ -375,6 +385,23 @@ [b]Note:[/b] Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android. </description> </method> + <method name="get_system_font_path" qualifiers="const"> + <return type="String" /> + <argument index="0" name="font_name" type="String" /> + <argument index="1" name="bold" type="bool" default="false" /> + <argument index="2" name="italic" type="bool" default="false" /> + <description> + Returns path to the system font file with [code]font_name[/code] and style. Return empty string if no matching fonts found. + [b]Note:[/b] This method is implemented on iOS, Linux, macOS and Windows. + </description> + </method> + <method name="get_system_fonts" qualifiers="const"> + <return type="PackedStringArray" /> + <description> + Returns list of font family names available. + [b]Note:[/b] This method is implemented on iOS, Linux, macOS and Windows. + </description> + </method> <method name="get_thread_caller_id" qualifiers="const"> <return type="int" /> <description> @@ -434,6 +461,15 @@ Returns [code]true[/code] if the input keycode corresponds to a Unicode character. </description> </method> + <method name="is_process_running" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="pid" type="int" /> + <description> + Returns [code]true[/code] if the child process ID ([code]pid[/code]) is still running or [code]false[/code] if it has terminated. + Must be a valid ID generated from [method create_process]. + [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + </description> + </method> <method name="is_stdout_verbose" qualifiers="const"> <return type="bool" /> <description> @@ -455,6 +491,19 @@ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. </description> </method> + <method name="move_to_trash" qualifiers="const"> + <return type="int" enum="Error" /> + <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"> <return type="void" /> <description> @@ -533,7 +582,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 a57101b62d..11ae7cc2b0 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -53,7 +53,8 @@ <method name="_init" qualifiers="virtual"> <return type="void" /> <description> - Called when the object is initialized. + Called when the object is initialized in memory. Can be defined to take in parameters, that are passed in when constructing. + [b]Note:[/b] If [method _init] is defined with required parameters, then explicit construction is the only valid means of creating an Object of the class. If any other means (such as [method PackedScene.instantiate]) is used, then initialization will fail. </description> </method> <method name="_notification" qualifiers="virtual"> @@ -106,7 +107,7 @@ </description> </method> <method name="call_deferred" qualifiers="vararg"> - <return type="void" /> + <return type="Variant" /> <argument index="0" name="method" type="StringName" /> <description> Calls the [code]method[/code] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: @@ -156,7 +157,7 @@ <description> Connects a [code]signal[/code] to a [code]callable[/code]. Pass optional [code]binds[/code] to the call as an [Array] of parameters. These parameters will be passed to the [Callable]'s method after any parameter used in the call to [method emit_signal]. Use [code]flags[/code] to set deferred or one-shot connections. See [enum ConnectFlags] constants. [b]Note:[/b] This method is the legacy implementation for connecting signals. The recommended modern approach is to use [method Signal.connect] and to use [method Callable.bind] to add and validate parameter binds. Both syntaxes are shown below. - A signal can only be connected once to a [Callable]. It will throw an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. + A signal can only be connected once to a [Callable]. It will print an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. If the callable's target is destroyed in the game's lifecycle, the connection will be lost. [b]Examples with recommended syntax:[/b] Connecting signals is one of the most common operations in Godot and the API gives many options to do so, which are described further down. The code block below shows the recommended approach for both GDScript and C#. @@ -244,7 +245,7 @@ } [/csharp] [/codeblocks] - While all options have the same outcome ([code]button[/code]'s [signal BaseButton.button_down] signal will be connected to [code]_on_button_down[/code]), option 3 offers the best validation: it will throw a compile-time error if either the [code]button_down[/code] signal or the [code]_on_button_down[/code] callable are undefined. On the other hand, option 2 only relies on string names and will only be able to validate either names at runtime: it will throw a runtime error if [code]"button_down"[/code] doesn't correspond to a signal, or if [code]"_on_button_down"[/code] is not a registered method in the object [code]self[/code]. The main reason for using options 1, 2, or 4 would be if you actually need to use strings (e.g. to connect signals programmatically based on strings read from a configuration file). Otherwise, option 3 is the recommended (and fastest) method. + While all options have the same outcome ([code]button[/code]'s [signal BaseButton.button_down] signal will be connected to [code]_on_button_down[/code]), option 3 offers the best validation: it will print a compile-time error if either the [code]button_down[/code] signal or the [code]_on_button_down[/code] callable are undefined. On the other hand, option 2 only relies on string names and will only be able to validate either names at runtime: it will print a runtime error if [code]"button_down"[/code] doesn't correspond to a signal, or if [code]"_on_button_down"[/code] is not a registered method in the object [code]self[/code]. The main reason for using options 1, 2, or 4 would be if you actually need to use strings (e.g. to connect signals programmatically based on strings read from a configuration file). Otherwise, option 3 is the recommended (and fastest) method. [b]Parameter bindings and passing:[/b] For legacy or language-specific reasons, there are also several ways to bind parameters to signals. One can pass a [code]binds[/code] [Array] to [method Object.connect] or [method Signal.connect], or use the recommended [method Callable.bind] method to create a new callable from an existing one, with the given parameter binds. One can also pass additional parameters when emitting the signal with [method emit_signal]. The examples below show the relationship between those two types of parameters. @@ -296,11 +297,11 @@ <argument index="1" name="callable" type="Callable" /> <description> Disconnects a [code]signal[/code] from a given [code]callable[/code]. - If you try to disconnect a connection that does not exist, the method will throw an error. Use [method is_connected] to ensure that the connection exists. + If you try to disconnect a connection that does not exist, the method will print an error. Use [method is_connected] to ensure that the connection exists. </description> </method> <method name="emit_signal" qualifiers="vararg"> - <return type="void" /> + <return type="int" enum="Error" /> <argument index="0" name="signal" type="StringName" /> <description> Emits the given [code]signal[/code]. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: @@ -324,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). @@ -365,8 +366,10 @@ <method name="get_meta" qualifiers="const"> <return type="Variant" /> <argument index="0" name="name" type="StringName" /> + <argument index="1" name="default" type="Variant" default="null" /> <description> Returns the object's metadata entry for the given [code]name[/code]. + Throws error if the entry does not exist, unless [code]default[/code] is not [code]null[/code] (in which case the default value will be returned). </description> </method> <method name="get_meta_list" qualifiers="const"> @@ -396,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> @@ -487,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/OmniLight3D.xml b/doc/classes/OmniLight3D.xml index f83d31a9b5..ce63dbdbc1 100644 --- a/doc/classes/OmniLight3D.xml +++ b/doc/classes/OmniLight3D.xml @@ -19,6 +19,7 @@ <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1"> See [enum ShadowMode]. </member> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" overrides="Light3D" default="0.2" /> </members> <constants> <constant name="SHADOW_DUAL_PARABOLOID" value="0" enum="ShadowMode"> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index f65925f0f6..a7b1f0ea33 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -6,6 +6,7 @@ <description> OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. See also [BaseButton] which contains common properties and methods associated with this node. + [b]Note:[/b] Properties [member Button.text] and [member Button.icon] are automatically set based on the selected item. They shouldn't be changed manually. </description> <tutorials> </tutorials> @@ -29,8 +30,9 @@ </method> <method name="add_separator"> <return type="void" /> + <argument index="0" name="text" type="String" default="""" /> <description> - Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. + Adds a separator to the list of items. Separators help to group items, and can optionally be given a [code]text[/code] header. A separator also gets an index assigned, and is appended at the end of the item list. </description> </method> <method name="clear"> @@ -74,6 +76,13 @@ Returns the text of the item at index [code]idx[/code]. </description> </method> + <method name="get_item_tooltip" qualifiers="const"> + <return type="String" /> + <argument index="0" name="idx" type="int" /> + <description> + Returns the tooltip of the item at index [code]idx[/code]. + </description> + </method> <method name="get_popup" qualifiers="const"> <return type="PopupMenu" /> <description> @@ -81,6 +90,12 @@ [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_selectable_item" qualifiers="const"> + <return type="int" /> + <argument index="0" name="from_last" type="bool" default="false" /> + <description> + </description> + </method> <method name="get_selected_id" qualifiers="const"> <return type="int" /> <description> @@ -93,6 +108,11 @@ Gets the metadata of the selected item. Metadata for items can be set using [method set_item_metadata]. </description> </method> + <method name="has_selectable_items" qualifiers="const"> + <return type="bool" /> + <description> + </description> + </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="idx" type="int" /> @@ -100,6 +120,12 @@ Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. </description> </method> + <method name="is_item_separator" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="idx" type="int" /> + <description> + </description> + </method> <method name="remove_item"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -156,6 +182,14 @@ Sets the text of the item at index [code]idx[/code]. </description> </method> + <method name="set_item_tooltip"> + <return type="void" /> + <argument index="0" name="idx" type="int" /> + <argument index="1" name="tooltip" type="String" /> + <description> + Sets the tooltip of the item at index [code]idx[/code]. + </description> + </method> </methods> <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" /> @@ -204,7 +238,7 @@ <theme_item name="arrow_margin" data_type="constant" type="int" default="4"> The horizontal space between the arrow icon and the right edge of the button. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> + <theme_item name="h_separation" data_type="constant" type="int" default="2"> The horizontal space between [OptionButton]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index be51b1dcf8..3af3bb8697 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedByteArray" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of bytes. + A packed array of bytes. </brief_description> <description> - An [Array] specifically designed to hold bytes. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold bytes. Packs data tightly, so it saves memory for large array sizes. </description> <tutorials> </tutorials> @@ -61,6 +61,13 @@ Returns a new [PackedByteArray] with the data compressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="decode_double" qualifiers="const"> <return type="float" /> <argument index="0" name="byte_offset" type="int" /> @@ -257,6 +264,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="get_string_from_ascii" qualifiers="const"> <return type="String" /> <description> @@ -352,6 +367,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -386,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> @@ -394,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> @@ -402,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> @@ -418,11 +441,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedByteArray" /> <description> </description> @@ -435,11 +453,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedByteArray" /> <description> </description> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index f98c5c37e4..12a553af49 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedColorArray" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of [Color]s. + A packed array of [Color]s. </brief_description> <description> - An [Array] specifically designed to hold [Color]. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold [Color]. Packs data tightly, so it saves memory for large array sizes. </description> <tutorials> </tutorials> @@ -54,6 +54,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Color" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedColorArray" /> <description> @@ -67,6 +74,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Color" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Color" /> @@ -115,6 +130,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Color" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -154,11 +177,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedColorArray" /> <description> </description> @@ -171,11 +189,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedColorArray" /> <description> </description> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 393af5f6c4..0a114e6c06 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedFloat32Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of 32-bit floating-point values. + A packed array of 32-bit floating-point values. </brief_description> <description> - An [Array] specifically designed to hold 32-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold 32-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. If you need to pack 64-bit floats tightly, see [PackedFloat64Array]. </description> <tutorials> @@ -55,6 +55,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedFloat32Array" /> <description> @@ -68,6 +75,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="float" /> @@ -116,6 +131,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -157,11 +180,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedFloat32Array" /> <description> </description> @@ -174,11 +192,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedFloat32Array" /> <description> </description> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 5a80d7b2e9..0327559f5b 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedFloat64Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of 64-bit floating-point values. + A packed array of 64-bit floating-point values. </brief_description> <description> - An [Array] specifically designed to hold 64-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold 64-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. If you only need to pack 32-bit floats tightly, see [PackedFloat32Array] for a more memory-friendly alternative. </description> <tutorials> @@ -55,6 +55,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedFloat64Array" /> <description> @@ -68,6 +75,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="float" /> @@ -116,6 +131,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -157,11 +180,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedFloat64Array" /> <description> </description> @@ -174,11 +192,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedFloat64Array" /> <description> </description> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 17085a9626..f8b606d266 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedInt32Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of 32-bit integers. + A packed array of 32-bit integers. </brief_description> <description> - An [Array] specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 32-bit integers, which means it can take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. If you need to pack 64-bit integers tightly, see [PackedInt64Array]. </description> <tutorials> @@ -55,6 +55,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedInt32Array" /> <description> @@ -68,6 +75,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="int" /> @@ -116,6 +131,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -157,11 +180,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedInt32Array" /> <description> </description> @@ -174,11 +192,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedInt32Array" /> <description> </description> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 066bc05f54..ea3e304d35 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedInt64Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of 64-bit integers. + A packed array of 64-bit integers. </brief_description> <description> - An [Array] specifically designed to hold 64-bit integer values. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold 64-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 64-bit integers, which means it can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. If you only need to pack 32-bit integers tightly, see [PackedInt32Array] for a more memory-friendly alternative. </description> <tutorials> @@ -55,6 +55,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedInt64Array" /> <description> @@ -68,6 +75,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="int" /> @@ -116,6 +131,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -157,11 +180,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedInt64Array" /> <description> </description> @@ -174,11 +192,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedInt64Array" /> <description> </description> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 1a1a7f8333..821fc1ae95 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -82,7 +82,7 @@ Returns [code]true[/code] if the scene file has nodes. </description> </method> - <method name="get_state"> + <method name="get_state" qualifiers="const"> <return type="SceneState" /> <description> Returns the [code]SceneState[/code] representing the scene file contents. diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 3cf43ecb28..a4653344f0 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedStringArray" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of [String]s. + A packed array of [String]s. </brief_description> <description> - An [Array] specifically designed to hold [String]s. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold [String]s. Packs data tightly, so it saves memory for large array sizes. + If you want to join the strings in the array, use [method String.join]. + [codeblock] + var string_array = PackedStringArray(["hello", "world"]) + var string = " ".join(string_array) + print(string) # "hello world" + [/codeblock] </description> <tutorials> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> @@ -55,6 +61,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="String" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedStringArray" /> <description> @@ -68,6 +81,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="String" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="String" /> @@ -116,6 +137,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="String" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -155,11 +184,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedStringArray" /> <description> </description> @@ -172,11 +196,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedStringArray" /> <description> </description> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 9abc366702..8f3e5d173d 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedVector2Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of [Vector2]s. + A packed array of [Vector2]s. </brief_description> <description> - An [Array] specifically designed to hold [Vector2]. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold [Vector2]. Packs data tightly, so it saves memory for large array sizes. </description> <tutorials> <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> @@ -55,6 +55,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector2" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedVector2Array" /> <description> @@ -68,6 +75,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector2" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Vector2" /> @@ -116,6 +131,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector2" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -155,11 +178,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedVector2Array" /> <description> </description> @@ -178,11 +196,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedVector2Array" /> <description> </description> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index ff9fc6a757..1207293c32 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PackedVector3Array" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A packed [Array] of [Vector3]s. + A packed array of [Vector3]s. </brief_description> <description> - An [Array] specifically designed to hold [Vector3]. Packs data tightly, so it saves memory for large array sizes. + An array specifically designed to hold [Vector3]. Packs data tightly, so it saves memory for large array sizes. </description> <tutorials> </tutorials> @@ -54,6 +54,13 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector3" /> + <description> + Returns the number of times an element is in the array. + </description> + </method> <method name="duplicate"> <return type="PackedVector3Array" /> <description> @@ -67,6 +74,14 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> + <method name="find" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector3" /> + <argument index="1" name="from" type="int" default="0" /> + <description> + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Vector3" /> @@ -115,6 +130,14 @@ Reverses the order of the elements in the array. </description> </method> + <method name="rfind" qualifiers="const"> + <return type="int" /> + <argument index="0" name="value" type="Vector3" /> + <argument index="1" name="from" type="int" default="-1" /> + <description> + Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. + </description> + </method> <method name="set"> <return type="void" /> <argument index="0" name="index" type="int" /> @@ -154,11 +177,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="PackedVector3Array" /> <description> </description> @@ -177,11 +195,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="PackedVector3Array" /> <description> </description> diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 580bf60518..7c6622be3c 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -61,7 +61,7 @@ Returns whether this [PacketPeerUDP] is bound to an address and can receive packets. </description> </method> - <method name="is_connected_to_host" qualifiers="const"> + <method name="is_socket_connected" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml index 1bb26045d9..fff30e0dc0 100644 --- a/doc/classes/PanelContainer.xml +++ b/doc/classes/PanelContainer.xml @@ -7,6 +7,7 @@ Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> </tutorials> <members> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 1ce21d96e1..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,13 +110,13 @@ 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. </member> <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" default="0.0"> - Collision bouncyness. + Collision bounciness. </member> <member name="collision_enabled" type="bool" setter="set_collision_enabled" getter="is_collision_enabled" default="false"> True if collisions are enabled for this particle system. @@ -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> @@ -325,19 +330,22 @@ <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape"> Particles will be emitted in the volume of a sphere. </constant> - <constant name="EMISSION_SHAPE_BOX" value="2" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_SPHERE_SURFACE" value="2" enum="EmissionShape"> + Particles will be emitted on the surface of a sphere. + </constant> + <constant name="EMISSION_SHAPE_BOX" value="3" enum="EmissionShape"> Particles will be emitted in the volume of a box. </constant> - <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_POINTS" value="4" enum="EmissionShape"> Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture]. </constant> - <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="5" enum="EmissionShape"> Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture]. </constant> - <constant name="EMISSION_SHAPE_RING" value="5" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_RING" value="6" enum="EmissionShape"> Particles will be emitted in a ring or cylinder. </constant> - <constant name="EMISSION_SHAPE_MAX" value="6" enum="EmissionShape"> + <constant name="EMISSION_SHAPE_MAX" value="7" enum="EmissionShape"> Represents the size of the [enum EmissionShape] enum. </constant> <constant name="SUB_EMITTER_DISABLED" value="0" enum="SubEmitterMode"> diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 3b8e481519..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 throws 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 throws 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 throws 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/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index e7c702aefb..7e8cc91766 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -7,6 +7,13 @@ <tutorials> </tutorials> <methods> + <method name="_integrate_forces" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="state" type="PhysicsDirectBodyState3D" /> + <description> + Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [member custom_integrator] property allows you to disable the default behavior and do fully custom force integration for a body. + </description> + </method> <method name="apply_central_impulse"> <return type="void" /> <argument index="0" name="impulse" type="Vector3" /> @@ -44,6 +51,9 @@ <member name="angular_damp_mode" type="int" setter="set_angular_damp_mode" getter="get_angular_damp_mode" enum="PhysicalBone3D.DampMode" default="0"> Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. </member> + <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)"> + The PhysicalBone3D's rotational velocity in [i]radians[/i] per second. + </member> <member name="body_offset" type="Transform3D" setter="set_body_offset" getter="get_body_offset" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> Sets the body's transform. </member> @@ -53,6 +63,9 @@ <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> If [code]true[/code], the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force. </member> + <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" default="false"> + If [code]true[/code], internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined. + </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" default="1.0"> The body's friction, from [code]0[/code] (frictionless) to [code]1[/code] (max friction). </member> @@ -75,6 +88,9 @@ <member name="linear_damp_mode" type="int" setter="set_linear_damp_mode" getter="get_linear_damp_mode" enum="PhysicalBone3D.DampMode" default="0"> Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. </member> + <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> + The body's linear velocity in units per second. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. + </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0"> The body's mass. </member> diff --git a/doc/classes/PhysicalSkyMaterial.xml b/doc/classes/PhysicalSkyMaterial.xml index 3e85074e41..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"> - Sets 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, 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/PhysicsDirectBodyState3DExtension.xml b/doc/classes/PhysicsDirectBodyState3DExtension.xml new file mode 100644 index 0000000000..f0659f8f1b --- /dev/null +++ b/doc/classes/PhysicsDirectBodyState3DExtension.xml @@ -0,0 +1,260 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PhysicsDirectBodyState3DExtension" inherits="PhysicsDirectBodyState3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_add_constant_central_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_add_constant_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <argument index="1" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_add_constant_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_central_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_central_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="impulse" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <argument index="1" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="impulse" type="Vector3" /> + <argument index="1" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_apply_torque_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="impulse" type="Vector3" /> + <description> + </description> + </method> + <method name="_get_angular_velocity" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_center_of_mass" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_center_of_mass_local" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_constant_force" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_constant_torque" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_contact_collider" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_collider_id" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_collider_object" qualifiers="virtual const"> + <return type="Object" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_collider_position" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_collider_shape" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_collider_velocity_at_position" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_count" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_contact_impulse" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_local_normal" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_local_position" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_contact_local_shape" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="contact_idx" type="int" /> + <description> + </description> + </method> + <method name="_get_inverse_inertia" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_inverse_mass" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> + <method name="_get_linear_velocity" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_principal_inertia_axes" qualifiers="virtual const"> + <return type="Basis" /> + <description> + </description> + </method> + <method name="_get_space_state" qualifiers="virtual"> + <return type="PhysicsDirectSpaceState3D" /> + <description> + </description> + </method> + <method name="_get_step" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> + <method name="_get_total_angular_damp" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> + <method name="_get_total_gravity" qualifiers="virtual const"> + <return type="Vector3" /> + <description> + </description> + </method> + <method name="_get_total_linear_damp" qualifiers="virtual const"> + <return type="float" /> + <description> + </description> + </method> + <method name="_get_transform" qualifiers="virtual const"> + <return type="Transform3D" /> + <description> + </description> + </method> + <method name="_get_velocity_at_local_position" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="local_position" type="Vector3" /> + <description> + </description> + </method> + <method name="_integrate_forces" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_is_sleeping" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_set_angular_velocity" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="velocity" type="Vector3" /> + <description> + </description> + </method> + <method name="_set_constant_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_set_constant_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_set_linear_velocity" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="velocity" type="Vector3" /> + <description> + </description> + </method> + <method name="_set_sleep_state" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="enabled" type="bool" /> + <description> + </description> + </method> + <method name="_set_transform" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="transform" type="Transform3D" /> + <description> + </description> + </method> + </methods> +</class> diff --git a/doc/classes/PhysicsDirectSpaceState3DExtension.xml b/doc/classes/PhysicsDirectSpaceState3DExtension.xml new file mode 100644 index 0000000000..f150907963 --- /dev/null +++ b/doc/classes/PhysicsDirectSpaceState3DExtension.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PhysicsDirectSpaceState3DExtension" inherits="PhysicsDirectSpaceState3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_cast_motion" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shape_rid" type="RID" /> + <argument index="1" name="transform" type="Transform3D" /> + <argument index="2" name="motion" type="Vector3" /> + <argument index="3" name="margin" type="float" /> + <argument index="4" name="collision_mask" type="int" /> + <argument index="5" name="collide_with_bodies" type="bool" /> + <argument index="6" name="collide_with_areas" type="bool" /> + <argument index="7" name="closest_safe" type="float*" /> + <argument index="8" name="closest_unsafe" type="float*" /> + <argument index="9" name="info" type="PhysicsServer3DExtensionShapeRestInfo*" /> + <description> + </description> + </method> + <method name="_collide_shape" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shape_rid" type="RID" /> + <argument index="1" name="transform" type="Transform3D" /> + <argument index="2" name="motion" type="Vector3" /> + <argument index="3" name="margin" type="float" /> + <argument index="4" name="collision_mask" type="int" /> + <argument index="5" name="collide_with_bodies" type="bool" /> + <argument index="6" name="collide_with_areas" type="bool" /> + <argument index="7" name="results" type="void*" /> + <argument index="8" name="max_results" type="int" /> + <argument index="9" name="result_count" type="int32_t*" /> + <description> + </description> + </method> + <method name="_get_closest_point_to_object_volume" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="object" type="RID" /> + <argument index="1" name="point" type="Vector3" /> + <description> + </description> + </method> + <method name="_intersect_point" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="position" type="Vector3" /> + <argument index="1" name="collision_mask" type="int" /> + <argument index="2" name="collide_with_bodies" type="bool" /> + <argument index="3" name="collide_with_areas" type="bool" /> + <argument index="4" name="results" type="PhysicsServer3DExtensionShapeResult*" /> + <argument index="5" name="max_results" type="int" /> + <description> + </description> + </method> + <method name="_intersect_ray" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="from" type="Vector3" /> + <argument index="1" name="to" type="Vector3" /> + <argument index="2" name="collision_mask" type="int" /> + <argument index="3" name="collide_with_bodies" type="bool" /> + <argument index="4" name="collide_with_areas" type="bool" /> + <argument index="5" name="hit_from_inside" type="bool" /> + <argument index="6" name="hit_back_faces" type="bool" /> + <argument index="7" name="result" type="PhysicsServer3DExtensionRayResult*" /> + <description> + </description> + </method> + <method name="_intersect_shape" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="shape_rid" type="RID" /> + <argument index="1" name="transform" type="Transform3D" /> + <argument index="2" name="motion" type="Vector3" /> + <argument index="3" name="margin" type="float" /> + <argument index="4" name="collision_mask" type="int" /> + <argument index="5" name="collide_with_bodies" type="bool" /> + <argument index="6" name="collide_with_areas" type="bool" /> + <argument index="7" name="result_count" type="PhysicsServer3DExtensionShapeResult*" /> + <argument index="8" name="max_results" type="int" /> + <description> + </description> + </method> + <method name="_rest_info" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shape_rid" type="RID" /> + <argument index="1" name="transform" type="Transform3D" /> + <argument index="2" name="motion" type="Vector3" /> + <argument index="3" name="margin" type="float" /> + <argument index="4" name="collision_mask" type="int" /> + <argument index="5" name="collide_with_bodies" type="bool" /> + <argument index="6" name="collide_with_areas" type="bool" /> + <argument index="7" name="rest_info" type="PhysicsServer3DExtensionShapeRestInfo*" /> + <description> + </description> + </method> + </methods> +</class> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 7a9a0ac7c5..2e84287227 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -733,7 +733,7 @@ <return type="int" /> <argument index="0" name="process_info" type="int" enum="PhysicsServer3D.ProcessInfo" /> <description> - Returns an Info defined by the [enum ProcessInfo] input given. + Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] for a list of available states. </description> </method> <method name="heightmap_shape_create"> diff --git a/doc/classes/PhysicsServer3DExtension.xml b/doc/classes/PhysicsServer3DExtension.xml new file mode 100644 index 0000000000..795f5b86dd --- /dev/null +++ b/doc/classes/PhysicsServer3DExtension.xml @@ -0,0 +1,897 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PhysicsServer3DExtension" inherits="PhysicsServer3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_area_add_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape" type="RID" /> + <argument index="2" name="transform" type="Transform3D" /> + <argument index="3" name="disabled" type="bool" /> + <description> + </description> + </method> + <method name="_area_attach_object_instance_id" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="id" type="int" /> + <description> + </description> + </method> + <method name="_area_clear_shapes" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <description> + </description> + </method> + <method name="_area_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_area_get_object_instance_id" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="area" type="RID" /> + <description> + </description> + </method> + <method name="_area_get_param" qualifiers="virtual const"> + <return type="Variant" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.AreaParameter" /> + <description> + </description> + </method> + <method name="_area_get_shape" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_area_get_shape_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="area" type="RID" /> + <description> + </description> + </method> + <method name="_area_get_shape_transform" qualifiers="virtual const"> + <return type="Transform3D" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_area_get_space" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="area" type="RID" /> + <description> + </description> + </method> + <method name="_area_get_transform" qualifiers="virtual const"> + <return type="Transform3D" /> + <argument index="0" name="area" type="RID" /> + <description> + </description> + </method> + <method name="_area_remove_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_area_set_area_monitor_callback" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="callback" type="Callable" /> + <description> + </description> + </method> + <method name="_area_set_collision_layer" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="layer" type="int" /> + <description> + </description> + </method> + <method name="_area_set_collision_mask" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="mask" type="int" /> + <description> + </description> + </method> + <method name="_area_set_monitor_callback" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="callback" type="Callable" /> + <description> + </description> + </method> + <method name="_area_set_monitorable" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="monitorable" type="bool" /> + <description> + </description> + </method> + <method name="_area_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.AreaParameter" /> + <argument index="2" name="value" type="Variant" /> + <description> + </description> + </method> + <method name="_area_set_ray_pickable" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="enable" type="bool" /> + <description> + </description> + </method> + <method name="_area_set_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="shape" type="RID" /> + <description> + </description> + </method> + <method name="_area_set_shape_disabled" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="disabled" type="bool" /> + <description> + </description> + </method> + <method name="_area_set_shape_transform" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="transform" type="Transform3D" /> + <description> + </description> + </method> + <method name="_area_set_space" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="space" type="RID" /> + <description> + </description> + </method> + <method name="_area_set_transform" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="area" type="RID" /> + <argument index="1" name="transform" type="Transform3D" /> + <description> + </description> + </method> + <method name="_body_add_collision_exception" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="excepted_body" type="RID" /> + <description> + </description> + </method> + <method name="_body_add_constant_central_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_add_constant_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <argument index="2" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_add_constant_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_add_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape" type="RID" /> + <argument index="2" name="transform" type="Transform3D" /> + <argument index="3" name="disabled" type="bool" /> + <description> + </description> + </method> + <method name="_body_apply_central_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_apply_central_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="impulse" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_apply_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <argument index="2" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_apply_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="impulse" type="Vector3" /> + <argument index="2" name="position" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_apply_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_apply_torque_impulse" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="impulse" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_attach_object_instance_id" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="id" type="int" /> + <description> + </description> + </method> + <method name="_body_clear_shapes" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_body_get_collision_layer" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_collision_mask" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_constant_force" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_constant_torque" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_direct_state" qualifiers="virtual"> + <return type="PhysicsDirectBodyState3D" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_max_contacts_reported" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_mode" qualifiers="virtual const"> + <return type="int" enum="PhysicsServer3D.BodyMode" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_object_instance_id" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_param" qualifiers="virtual const"> + <return type="Variant" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" /> + <description> + </description> + </method> + <method name="_body_get_shape" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_body_get_shape_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_shape_transform" qualifiers="virtual const"> + <return type="Transform3D" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_body_get_space" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_get_state" qualifiers="virtual const"> + <return type="Variant" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="state" type="int" enum="PhysicsServer3D.BodyState" /> + <description> + </description> + </method> + <method name="_body_is_axis_locked" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="axis" type="int" enum="PhysicsServer3D.BodyAxis" /> + <description> + </description> + </method> + <method name="_body_is_continuous_collision_detection_enabled" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_is_omitting_force_integration" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_remove_collision_exception" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="excepted_body" type="RID" /> + <description> + </description> + </method> + <method name="_body_remove_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <description> + </description> + </method> + <method name="_body_reset_mass_properties" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_body_set_axis_lock" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="axis" type="int" enum="PhysicsServer3D.BodyAxis" /> + <argument index="2" name="lock" type="bool" /> + <description> + </description> + </method> + <method name="_body_set_axis_velocity" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="axis_velocity" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_set_collision_layer" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="layer" type="int" /> + <description> + </description> + </method> + <method name="_body_set_collision_mask" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="mask" type="int" /> + <description> + </description> + </method> + <method name="_body_set_constant_force" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_set_constant_torque" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + </description> + </method> + <method name="_body_set_enable_continuous_collision_detection" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="enable" type="bool" /> + <description> + </description> + </method> + <method name="_body_set_force_integration_callback" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="callable" type="Callable" /> + <argument index="2" name="userdata" type="Variant" /> + <description> + </description> + </method> + <method name="_body_set_max_contacts_reported" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="amount" type="int" /> + <description> + </description> + </method> + <method name="_body_set_mode" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="mode" type="int" enum="PhysicsServer3D.BodyMode" /> + <description> + </description> + </method> + <method name="_body_set_omit_force_integration" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="enable" type="bool" /> + <description> + </description> + </method> + <method name="_body_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" /> + <argument index="2" name="value" type="Variant" /> + <description> + </description> + </method> + <method name="_body_set_ray_pickable" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="enable" type="bool" /> + <description> + </description> + </method> + <method name="_body_set_shape" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="shape" type="RID" /> + <description> + </description> + </method> + <method name="_body_set_shape_disabled" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="disabled" type="bool" /> + <description> + </description> + </method> + <method name="_body_set_shape_transform" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="shape_idx" type="int" /> + <argument index="2" name="transform" type="Transform3D" /> + <description> + </description> + </method> + <method name="_body_set_space" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="space" type="RID" /> + <description> + </description> + </method> + <method name="_body_set_state" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="state" type="int" enum="PhysicsServer3D.BodyState" /> + <argument index="2" name="value" type="Variant" /> + <description> + </description> + </method> + <method name="_body_test_motion" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="from" type="Transform3D" /> + <argument index="2" name="motion" type="Vector3" /> + <argument index="3" name="margin" type="float" /> + <argument index="4" name="max_collisions" type="int" /> + <argument index="5" name="collide_separation_ray" type="bool" /> + <argument index="6" name="result" type="PhysicsServer3DExtensionMotionResult*" /> + <description> + </description> + </method> + <method name="_box_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_capsule_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_concave_polygon_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_cone_twist_joint_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.ConeTwistJointParam" /> + <description> + </description> + </method> + <method name="_cone_twist_joint_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.ConeTwistJointParam" /> + <argument index="2" name="value" type="float" /> + <description> + </description> + </method> + <method name="_convex_polygon_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_custom_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_cylinder_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_free_rid" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="rid" type="RID" /> + <description> + </description> + </method> + <method name="_generic_6dof_joint_get_flag" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="axis" type="int" enum="Vector3.Axis" /> + <argument index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" /> + <description> + </description> + </method> + <method name="_generic_6dof_joint_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="axis" type="int" enum="Vector3.Axis" /> + <argument index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" /> + <description> + </description> + </method> + <method name="_generic_6dof_joint_set_flag" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="axis" type="int" enum="Vector3.Axis" /> + <argument index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" /> + <argument index="3" name="enable" type="bool" /> + <description> + </description> + </method> + <method name="_generic_6dof_joint_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="axis" type="int" enum="Vector3.Axis" /> + <argument index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" /> + <argument index="3" name="value" type="float" /> + <description> + </description> + </method> + <method name="_get_process_info" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="process_info" type="int" enum="PhysicsServer3D.ProcessInfo" /> + <description> + </description> + </method> + <method name="_heightmap_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_hinge_joint_get_flag" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="flag" type="int" enum="PhysicsServer3D.HingeJointFlag" /> + <description> + </description> + </method> + <method name="_hinge_joint_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.HingeJointParam" /> + <description> + </description> + </method> + <method name="_hinge_joint_set_flag" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="flag" type="int" enum="PhysicsServer3D.HingeJointFlag" /> + <argument index="2" name="enabled" type="bool" /> + <description> + </description> + </method> + <method name="_hinge_joint_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.HingeJointParam" /> + <argument index="2" name="value" type="float" /> + <description> + </description> + </method> + <method name="_joint_clear" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <description> + </description> + </method> + <method name="_joint_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_joint_get_solver_priority" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="joint" type="RID" /> + <description> + </description> + </method> + <method name="_joint_get_type" qualifiers="virtual const"> + <return type="int" enum="PhysicsServer3D.JointType" /> + <argument index="0" name="joint" type="RID" /> + <description> + </description> + </method> + <method name="_joint_make_cone_twist" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="body_A" type="RID" /> + <argument index="2" name="local_ref_A" type="Transform3D" /> + <argument index="3" name="body_B" type="RID" /> + <argument index="4" name="local_ref_B" type="Transform3D" /> + <description> + </description> + </method> + <method name="_joint_make_generic_6dof" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="body_A" type="RID" /> + <argument index="2" name="local_ref_A" type="Transform3D" /> + <argument index="3" name="body_B" type="RID" /> + <argument index="4" name="local_ref_B" type="Transform3D" /> + <description> + </description> + </method> + <method name="_joint_make_hinge" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="body_A" type="RID" /> + <argument index="2" name="hinge_A" type="Transform3D" /> + <argument index="3" name="body_B" type="RID" /> + <argument index="4" name="hinge_B" type="Transform3D" /> + <description> + </description> + </method> + <method name="_joint_make_pin" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="body_A" type="RID" /> + <argument index="2" name="local_A" type="Vector3" /> + <argument index="3" name="body_B" type="RID" /> + <argument index="4" name="local_B" type="Vector3" /> + <description> + </description> + </method> + <method name="_joint_make_slider" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="body_A" type="RID" /> + <argument index="2" name="local_ref_A" type="Transform3D" /> + <argument index="3" name="body_B" type="RID" /> + <argument index="4" name="local_ref_B" type="Transform3D" /> + <description> + </description> + </method> + <method name="_joint_set_solver_priority" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="priority" type="int" /> + <description> + </description> + </method> + <method name="_pin_joint_get_local_a" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="joint" type="RID" /> + <description> + </description> + </method> + <method name="_pin_joint_get_local_b" qualifiers="virtual const"> + <return type="Vector3" /> + <argument index="0" name="joint" type="RID" /> + <description> + </description> + </method> + <method name="_pin_joint_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.PinJointParam" /> + <description> + </description> + </method> + <method name="_pin_joint_set_local_a" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="local_A" type="Vector3" /> + <description> + </description> + </method> + <method name="_pin_joint_set_local_b" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="local_B" type="Vector3" /> + <description> + </description> + </method> + <method name="_pin_joint_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.PinJointParam" /> + <argument index="2" name="value" type="float" /> + <description> + </description> + </method> + <method name="_separation_ray_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_set_active" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="active" type="bool" /> + <description> + </description> + </method> + <method name="_shape_get_data" qualifiers="virtual const"> + <return type="Variant" /> + <argument index="0" name="shape" type="RID" /> + <description> + </description> + </method> + <method name="_shape_get_type" qualifiers="virtual const"> + <return type="int" enum="PhysicsServer3D.ShapeType" /> + <argument index="0" name="shape" type="RID" /> + <description> + </description> + </method> + <method name="_shape_set_data" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shape" type="RID" /> + <argument index="1" name="data" type="Variant" /> + <description> + </description> + </method> + <method name="_slider_joint_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.SliderJointParam" /> + <description> + </description> + </method> + <method name="_slider_joint_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="joint" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.SliderJointParam" /> + <argument index="2" name="value" type="float" /> + <description> + </description> + </method> + <method name="_soft_body_get_bounds" qualifiers="virtual const"> + <return type="AABB" /> + <argument index="0" name="body" type="RID" /> + <description> + </description> + </method> + <method name="_space_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_space_get_direct_state" qualifiers="virtual"> + <return type="PhysicsDirectSpaceState3D" /> + <argument index="0" name="space" type="RID" /> + <description> + </description> + </method> + <method name="_space_get_param" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="space" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.SpaceParameter" /> + <description> + </description> + </method> + <method name="_space_is_active" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="space" type="RID" /> + <description> + </description> + </method> + <method name="_space_set_active" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="space" type="RID" /> + <argument index="1" name="active" type="bool" /> + <description> + </description> + </method> + <method name="_space_set_param" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="space" type="RID" /> + <argument index="1" name="param" type="int" enum="PhysicsServer3D.SpaceParameter" /> + <argument index="2" name="value" type="float" /> + <description> + </description> + </method> + <method name="_sphere_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + <method name="_world_boundary_shape_create" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> + </methods> +</class> diff --git a/doc/classes/PhysicsServer3DRenderingServerHandler.xml b/doc/classes/PhysicsServer3DRenderingServerHandler.xml new file mode 100644 index 0000000000..a40a2dd1c6 --- /dev/null +++ b/doc/classes/PhysicsServer3DRenderingServerHandler.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PhysicsServer3DRenderingServerHandler" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_set_aabb" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="aabb" type="AABB" /> + <description> + </description> + </method> + <method name="_set_normal" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="vertex_id" type="int" /> + <argument index="1" name="normals" type="const void*" /> + <description> + </description> + </method> + <method name="_set_vertex" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="vertex_id" type="int" /> + <argument index="1" name="vertices" type="const void*" /> + <description> + </description> + </method> + </methods> +</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/PlaceholderCubemap.xml b/doc/classes/PlaceholderCubemap.xml new file mode 100644 index 0000000000..3617c6ac2c --- /dev/null +++ b/doc/classes/PlaceholderCubemap.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderCubemap" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/PlaceholderCubemapArray.xml b/doc/classes/PlaceholderCubemapArray.xml new file mode 100644 index 0000000000..1fcf1e7795 --- /dev/null +++ b/doc/classes/PlaceholderCubemapArray.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderCubemapArray" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/PlaceholderMaterial.xml b/doc/classes/PlaceholderMaterial.xml new file mode 100644 index 0000000000..c66641d81c --- /dev/null +++ b/doc/classes/PlaceholderMaterial.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderMaterial" inherits="Material" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/PlaceholderMesh.xml b/doc/classes/PlaceholderMesh.xml new file mode 100644 index 0000000000..cc688816b6 --- /dev/null +++ b/doc/classes/PlaceholderMesh.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderMesh" inherits="Mesh" 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="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> + </member> + </members> +</class> diff --git a/doc/classes/PlaceholderTexture2D.xml b/doc/classes/PlaceholderTexture2D.xml new file mode 100644 index 0000000000..76e575265b --- /dev/null +++ b/doc/classes/PlaceholderTexture2D.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderTexture2D" inherits="Texture2D" 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="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(1, 1)"> + </member> + </members> +</class> diff --git a/doc/classes/PlaceholderTexture2DArray.xml b/doc/classes/PlaceholderTexture2DArray.xml new file mode 100644 index 0000000000..a502e5d334 --- /dev/null +++ b/doc/classes/PlaceholderTexture2DArray.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderTexture2DArray" inherits="PlaceholderTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/PlaceholderTexture3D.xml b/doc/classes/PlaceholderTexture3D.xml new file mode 100644 index 0000000000..d31e538307 --- /dev/null +++ b/doc/classes/PlaceholderTexture3D.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderTexture3D" inherits="Texture3D" 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="size" type="Vector3i" setter="set_size" getter="get_size" default="Vector3i(1, 1, 1)"> + </member> + </members> +</class> diff --git a/doc/classes/PlaceholderTextureLayered.xml b/doc/classes/PlaceholderTextureLayered.xml new file mode 100644 index 0000000000..39af08473a --- /dev/null +++ b/doc/classes/PlaceholderTextureLayered.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PlaceholderTextureLayered" inherits="TextureLayered" 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="layers" type="int" setter="set_layers" getter="get_layers" default="1"> + </member> + <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(1, 1)"> + </member> + </members> +</class> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index f037b0bf1e..32eb71f1c7 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -77,15 +77,15 @@ <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"> <return type="bool" /> <argument index="0" name="point" type="Vector3" /> - <argument index="1" name="epsilon" type="float" default="1e-05" /> + <argument index="1" name="tolerance" type="float" default="1e-05" /> <description> - Returns [code]true[/code] if [code]point[/code] is inside the plane. Comparison uses a custom minimum [code]epsilon[/code] threshold. + Returns [code]true[/code] if [code]point[/code] is inside the plane. Comparison uses a custom minimum [code]tolerance[/code] threshold. </description> </method> <method name="intersect_3" qualifiers="const"> @@ -109,7 +109,7 @@ <argument index="0" name="from" type="Vector3" /> <argument index="1" name="to" type="Vector3" /> <description> - Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned. + Returns the intersection point of a segment from position [code]from[/code] to position [code]to[/code] with this plane. If no intersection is found, [code]null[/code] is returned. </description> </method> <method name="is_equal_approx" qualifiers="const"> @@ -121,7 +121,7 @@ </method> <method name="is_point_over" qualifiers="const"> <return type="bool" /> - <argument index="0" name="plane" type="Vector3" /> + <argument index="0" name="point" type="Vector3" /> <description> Returns [code]true[/code] if [code]point[/code] is located above the plane. </description> @@ -173,11 +173,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Plane" /> <description> Returns [code]true[/code] if the planes are not equal. @@ -186,11 +181,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Plane" /> <description> Returns [code]true[/code] if the planes are exactly equal. diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index 06efadb071..3fcf0a9b8f 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -4,15 +4,13 @@ Popup is a base window container for popup-like subwindows. </brief_description> <description> - Popup is a base window container for popup-like subwindows. It's a modal by default (see [member close_on_parent_focus]) and has helpers for custom popup behavior. + Popup is a base window container for popup-like subwindows. It's a modal by default (see [member popup_window]) and has helpers for custom popup behavior. </description> <tutorials> </tutorials> <members> <member name="borderless" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" /> - <member name="close_on_parent_focus" type="bool" setter="set_close_on_parent_focus" getter="get_close_on_parent_focus" default="true"> - If true, the [Popup] will close when its parent [Window] is focused. - </member> + <member name="popup_window" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" /> <member name="transient" type="bool" setter="set_transient" getter="is_transient" overrides="Window" default="true" /> <member name="unresizable" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" /> <member name="visible" type="bool" setter="set_visible" getter="is_visible" overrides="Window" default="false" /> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index b64c392357..5da2196f29 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -7,6 +7,8 @@ [PopupMenu] is a modal window used to display a list of options. They are popular in toolbars or context menus. The size of a [PopupMenu] can be limited by using [member Window.max_size]. If the height of the list of items is larger than the maximum height of the [PopupMenu], a [ScrollContainer] within the popup will allow the user to scroll the contents. If no maximum size is set, or if it is set to 0, the [PopupMenu] height will be limited by its parent rect. + 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> @@ -180,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> @@ -200,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" /> @@ -235,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" /> @@ -394,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" /> @@ -435,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" /> @@ -567,8 +560,11 @@ <theme_item name="font_separator_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> [Color] used for labeled separators' text. See [method add_separator]. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> - The horizontal space between the item's name and the shortcut text/submenu arrow. + <theme_item name="font_separator_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + The tint of text outline of the labeled separator. + </theme_item> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> + The horizontal space between the item's elements. </theme_item> <theme_item name="item_end_padding" data_type="constant" type="int" default="2"> </theme_item> @@ -577,12 +573,21 @@ <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> + <theme_item name="separator_outline_size" data_type="constant" type="int" default="0"> + The size of the labeled separator text outline. + </theme_item> + <theme_item name="v_separation" data_type="constant" type="int" default="4"> The vertical space between each menu item. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] used for the menu items. </theme_item> + <theme_item name="font_separator" data_type="font" type="Font"> + [Font] used for the labeled separator. + </theme_item> + <theme_item name="font_separator_size" data_type="font_size" type="int"> + Font size of the labeled separator. + </theme_item> <theme_item name="font_size" data_type="font_size" type="int"> Font size of the menu items. </theme_item> diff --git a/doc/classes/PortableCompressedTexture2D.xml b/doc/classes/PortableCompressedTexture2D.xml new file mode 100644 index 0000000000..aad72bbb48 --- /dev/null +++ b/doc/classes/PortableCompressedTexture2D.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PortableCompressedTexture2D" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Provides a compressed texture for disk and/or VRAM in a way that is portable. + </brief_description> + <description> + This class allows storing compressed textures as self contained (not imported) resources. + For 2D usage (compressed on disk, uncompressed on VRAM), the lossy and lossless modes are recommended. For 3D usage (compressed on VRAM) it depends on the target platform. + If you intend to only use desktop, S3TC or BPTC are recommended. For only mobile, ETC2 is recommended. + For portable, self contained 3D textures that work on both desktop and mobile, Basis Universal is recommended (although it has a small quality cost and longer compression time as a tradeoff). + This resource is intended to be created from code. + </description> + <tutorials> + </tutorials> + <methods> + <method name="create_from_image"> + <return type="void" /> + <argument index="0" name="image" type="Image" /> + <argument index="1" name="compression_mode" type="int" enum="PortableCompressedTexture2D.CompressionMode" /> + <argument index="2" name="normal_map" type="bool" default="false" /> + <argument index="3" name="lossy_quality" type="float" default="0.8" /> + <description> + Initializes the compressed texture from a base image. The compression mode must be provided. + If this image will be used as a normal map, the "normal map" flag is recommended, to ensure optimum quality. + If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WEBP compression quality. + </description> + </method> + <method name="get_compression_mode" qualifiers="const"> + <return type="int" enum="PortableCompressedTexture2D.CompressionMode" /> + <description> + Return the compression mode used (valid after initialized). + </description> + </method> + <method name="get_format" qualifiers="const"> + <return type="int" enum="Image.Format" /> + <description> + Return the image format used (valid after initialized). + </description> + </method> + <method name="is_keeping_all_compressed_buffers" qualifiers="static"> + <return type="bool" /> + <description> + Return whether the flag is overridden for all textures of this type. + </description> + </method> + <method name="set_keep_all_compressed_buffers" qualifiers="static"> + <return type="void" /> + <argument index="0" name="keep" type="bool" /> + <description> + Overrides the flag globally for all textures of this type. This is used primarily by the editor. + </description> + </method> + </methods> + <members> + <member name="_data" type="PackedByteArray" setter="_set_data" getter="_get_data" default="PackedByteArray()"> + </member> + <member name="keep_compressed_buffer" type="bool" setter="set_keep_compressed_buffer" getter="is_keeping_compressed_buffer" default="false"> + When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved. + This flag allows to keep the compressed data in memory if you intend it to persist after loading. + </member> + <member name="size_override" type="Vector2" setter="set_size_override" getter="get_size_override" default="Vector2(0, 0)"> + Allow overriding the texture size (for 2D only). + </member> + </members> + <constants> + <constant name="COMPRESSION_MODE_LOSSLESS" value="0" enum="CompressionMode"> + </constant> + <constant name="COMPRESSION_MODE_LOSSY" value="1" enum="CompressionMode"> + </constant> + <constant name="COMPRESSION_MODE_BASIS_UNIVERSAL" value="2" enum="CompressionMode"> + </constant> + <constant name="COMPRESSION_MODE_S3TC" value="3" enum="CompressionMode"> + </constant> + <constant name="COMPRESSION_MODE_ETC2" value="4" enum="CompressionMode"> + </constant> + <constant name="COMPRESSION_MODE_BPTC" value="5" enum="CompressionMode"> + </constant> + </constants> +</class> diff --git a/doc/classes/Position2D.xml b/doc/classes/Position2D.xml index 881ec028de..754fd1fdf1 100644 --- a/doc/classes/Position2D.xml +++ b/doc/classes/Position2D.xml @@ -8,4 +8,9 @@ </description> <tutorials> </tutorials> + <members> + <member name="gizmo_extents" type="float" setter="set_gizmo_extents" getter="get_gizmo_extents" default="10.0"> + Size of the gizmo cross that appears in the editor. + </member> + </members> </class> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index d0136e389a..7046a21f68 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -9,6 +9,11 @@ <tutorials> </tutorials> <methods> + <method name="_create_mesh_array" qualifiers="virtual const"> + <return type="Array" /> + <description> + </description> + </method> <method name="get_mesh_arrays" qualifiers="const"> <return type="Array" /> <description> @@ -29,10 +34,10 @@ </method> </methods> <members> - <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> + <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb"> Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. </member> - <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false"> + <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces"> If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. This gives the same result as using [constant BaseMaterial3D.CULL_FRONT] in [member BaseMaterial3D.cull_mode]. </member> diff --git a/doc/classes/PrismMesh.xml b/doc/classes/PrismMesh.xml index 10c2b11a9a..a7bfa43c52 100644 --- a/doc/classes/PrismMesh.xml +++ b/doc/classes/PrismMesh.xml @@ -12,7 +12,7 @@ <member name="left_to_right" type="float" setter="set_left_to_right" getter="get_left_to_right" default="0.5"> Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. </member> - <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(2, 2, 2)"> + <member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(1, 1, 1)"> Size of the prism. </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0"> diff --git a/doc/classes/ProceduralSkyMaterial.xml b/doc/classes/ProceduralSkyMaterial.xml index 2b15508119..3cc4bd71f7 100644 --- a/doc/classes/ProceduralSkyMaterial.xml +++ b/doc/classes/ProceduralSkyMaterial.xml @@ -23,6 +23,12 @@ <member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" default="Color(0.6463, 0.6558, 0.6708, 1)"> Color of the ground at the horizon. Blends with [member ground_bottom_color]. </member> + <member name="sky_cover" type="Texture2D" setter="set_sky_cover" getter="get_sky_cover"> + The sky cover texture to use. This texture must use an equirectangular projection (similar to [PanoramaSkyMaterial]). The texture's colors will be [i]added[/i] to the existing sky color, and will be multiplied by [member sky_energy] and [member sky_cover_modulate]. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look). + </member> + <member name="sky_cover_modulate" type="Color" setter="set_sky_cover_modulate" getter="get_sky_cover_modulate" default="Color(1, 1, 1, 1)"> + The tint to apply to the [member sky_cover] texture. This can be used to change the sky cover's colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined in [member sky_cover]. + </member> <member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve" default="0.15"> How quickly the [member sky_horizon_color] fades into the [member sky_top_color]. </member> @@ -41,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/ProgressBar.xml b/doc/classes/ProgressBar.xml index 60b66a2493..8a781c51fb 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -9,12 +9,27 @@ <tutorials> </tutorials> <members> + <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode" default="0"> + The fill direction. See [enum FillMode] for possible values. + </member> <member name="percent_visible" type="bool" setter="set_percent_visible" getter="is_percent_visible" default="true"> If [code]true[/code], the fill percentage is displayed on the bar. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> - <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="0.01" /> </members> + <constants> + <constant name="FILL_BEGIN_TO_END" value="0" enum="FillMode"> + The progress bar fills from begin to end horizontally, according to the language direction. If [method Control.is_layout_rtl] returns [code]false[/code], it fills from left to right, and if it returns [code]true[/code], it fills from right to left. + </constant> + <constant name="FILL_END_TO_BEGIN" value="1" enum="FillMode"> + The progress bar fills from end to begin horizontally, according to the language direction. If [method Control.is_layout_rtl] returns [code]false[/code], it fills from right to left, and if it returns [code]true[/code], it fills from left to right. + </constant> + <constant name="FILL_TOP_TO_BOTTOM" value="2" enum="FillMode"> + The progress fills from top to bottom. + </constant> + <constant name="FILL_BOTTOM_TO_TOP" value="3" enum="FillMode"> + The progress fills from bottom to top. + </constant> + </constants> <theme_items> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> The color of the text. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 0a695414ee..f7567133cd 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> @@ -226,6 +232,9 @@ The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. The window title will be set to match the project name automatically on startup. [b]Note:[/b] Changing this value will also change the user data folder's path if [member application/config/use_custom_user_dir] is [code]false[/code]. After renaming the project, you will no longer be able to access existing data in [code]user://[/code] unless you rename the old folder to match the new project name. See [url=$DOCS_URL/tutorials/io/data_paths.html]Data paths[/url] in the documentation for more information. </member> + <member name="application/config/name_localized" type="Dictionary" setter="" getter="" default="{}"> + Translations of the project's name. This setting is used by OS tools to translate application name on Android, iOS and macOS. + </member> <member name="application/config/project_settings_override" type="String" setter="" getter="" default=""""> Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. See "Overriding" in the [ProjectSettings] class description at the top for more information. [b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings. @@ -301,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> @@ -331,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. @@ -350,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. @@ -471,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> @@ -509,7 +541,7 @@ </member> <member name="display/window/size/resizable" type="bool" setter="" getter="" default="true"> Allows the window to be resizable by default. - [b]Note:[/b] This setting is ignored on iOS and Android. + [b]Note:[/b] This setting is ignored on iOS. </member> <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="600"> Sets the game's main viewport height. On desktop platforms, this is also the initial window height. @@ -530,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> @@ -550,6 +608,14 @@ <member name="editor/script/templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. </member> + <member name="filesystem/import/blender/enabled" type="bool" setter="" getter="" default="true"> + If [code]true[/code], Blender 3D scene files with the [code].blend[/code] extension will be imported by converting them to glTF 2.0. + This requires configuring a path to a Blender executable in the editor settings at [code]filesystem/import/blender/blender3_path[/code]. Blender 3.0 or later is required. + </member> + <member name="filesystem/import/fbx/enabled" type="bool" setter="" getter="" default="true"> + If [code]true[/code], Autodesk FBX 3D scene files with the [code].fbx[/code] extension will be imported by converting them to glTF 2.0. + This requires configuring a path to a FBX2glTF executable in the editor settings at [code]filesystem/import/fbx/fbx2gltf_path[/code]. + </member> <member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0"> Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. </member> @@ -565,13 +631,23 @@ 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). + Enabling [member gui/theme/default_font_generate_mipmaps] increases font generation time and memory usage. Only enable this setting if you actually need it. + [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). + MSDF font rendering can be combined with [member gui/theme/default_font_generate_mipmaps] to further improve font rendering quality when scaled down. + [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> @@ -782,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> @@ -1346,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"> @@ -1493,7 +1575,7 @@ </member> <member name="physics/3d/physics_engine" type="String" setter="" getter="" default=""DEFAULT""> Sets which physics engine to use for 3D physics. - "DEFAULT" is currently the [url=https://bulletphysics.org]Bullet[/url] physics engine. The "GodotPhysics3D" engine is still supported as an alternative. + "DEFAULT" and "GodotPhysics3D" are the same, as there is currently no alternative 3D physics server implemented. </member> <member name="physics/3d/run_on_separate_thread" type="bool" setter="" getter="" default="false"> If [code]true[/code], the 3D physics server runs on a separate thread, making better use of multi-core CPUs. If [code]false[/code], the 3D physics server runs on the main thread. Running the physics server on a separate thread can increase performance, but restricts API access to only physics process. @@ -1536,18 +1618,6 @@ [b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_ticks_per_second] instead. [b]Note:[/b] Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended not to increase [member physics/common/physics_ticks_per_second] above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. </member> - <member name="rendering/2d/opengl/batching_send_null" type="int" setter="" getter="" default="0"> - </member> - <member name="rendering/2d/opengl/batching_stream" type="int" setter="" getter="" default="0"> - </member> - <member name="rendering/2d/opengl/legacy_orphan_buffers" type="int" setter="" getter="" default="0"> - </member> - <member name="rendering/2d/opengl/legacy_stream" type="int" setter="" getter="" default="0"> - </member> - <member name="rendering/2d/options/ninepatch_mode" type="int" setter="" getter="" default="1"> - </member> - <member name="rendering/2d/options/use_software_skinning" type="bool" setter="" getter="" default="true"> - </member> <member name="rendering/2d/sdf/oversize" type="int" setter="" getter="" default="1"> </member> <member name="rendering/2d/sdf/scale" type="int" setter="" getter="" default="1"> @@ -1567,38 +1637,16 @@ </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"> </member> <member name="rendering/anti_aliasing/screen_space_roughness_limiter/limit" type="float" setter="" getter="" default="0.18"> </member> - <member name="rendering/batching/debug/diagnose_frame" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/debug/flash_batching" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/lights/max_join_items" type="int" setter="" getter="" default="32"> - </member> - <member name="rendering/batching/lights/scissor_area_threshold" type="float" setter="" getter="" default="1.0"> - </member> - <member name="rendering/batching/options/single_rect_fallback" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/options/use_batching" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/options/use_batching_in_editor" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/parameters/batch_buffer_size" type="int" setter="" getter="" default="16384"> - </member> - <member name="rendering/batching/parameters/colored_vertex_format_threshold" type="float" setter="" getter="" default="0.25"> - </member> - <member name="rendering/batching/parameters/item_reordering_lookahead" type="int" setter="" getter="" default="4"> - </member> - <member name="rendering/batching/parameters/max_join_item_commands" type="int" setter="" getter="" default="16"> - </member> - <member name="rendering/batching/precision/uv_contract" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/batching/precision/uv_contract_amount" type="int" setter="" getter="" default="100"> - </member> <member name="rendering/camera/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="1"> Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. </member> @@ -1608,13 +1656,16 @@ <member name="rendering/camera/depth_of_field/depth_of_field_use_jitter" type="bool" setter="" getter="" default="false"> 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 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. - [b]Note:[/b] Only supported when using the Vulkan Clustered backend (not Vulkan Mobile or OpenGL). When using Vulkan Mobile or OpenGL, there is no depth prepass performed. + [b]Note:[/b] Only supported when using the Vulkan Clustered backend or the OpenGL backend. When using Vulkan Mobile there is no depth prepass performed. </member> <member name="rendering/driver/driver_name" type="String" setter="" getter="" default=""vulkan""> The video driver to use. - [b]Note:[/b] OpenGL support is currently incomplete. Only basic 2D rendering is supported, and single-window mode is required for correct operation. + [b]Note:[/b] OpenGL support is currently incomplete. Only basic rendering is supported. [b]Note:[/b] The backend in use can be overridden at runtime via the [code]--rendering-driver[/code] command line argument. [b]FIXME:[/b] No longer valid after DisplayServer split: In such cases, this property is not updated, so use [code]OS.get_current_video_driver[/code] to query it at run-time. @@ -1652,11 +1703,8 @@ <member name="rendering/environment/ssao/fadeout_to" type="float" setter="" getter="" default="300.0"> Distance at which the screen-space ambient occlusion is fully faded out. Use this hide ambient occlusion at great distances. </member> - <member name="rendering/environment/ssao/half_size" type="bool" setter="" getter="" default="false"> - If [code]true[/code], screen-space ambient occlusion will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details. - </member> - <member name="rendering/environment/ssao/half_size.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/environment/ssao/half_size] on mobile devices, due to performance concerns. + <member name="rendering/environment/ssao/half_size" type="bool" setter="" getter="" default="true"> + If [code]true[/code], screen-space ambient occlusion will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details. If [code]false[/code], screen-space ambient occlusion will be rendered at full size. </member> <member name="rendering/environment/ssao/quality" type="int" setter="" getter="" default="2"> Sets the quality of the screen-space ambient occlusion effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]ULTRA[/code] will use the [member rendering/environment/ssao/adaptive_target] setting. @@ -1697,10 +1745,6 @@ <member name="rendering/environment/volumetric_fog/volume_size" type="int" setter="" getter="" default="64"> Base size used to determine size of froxel buffer in the camera X-axis and Y-axis. The final size is scaled by the aspect ratio of the screen, so actual values may differ from what is set. Set a larger size for more detailed fog, set a smaller size for better performance. </member> - <member name="rendering/gles2/compatibility/disable_half_float" type="bool" setter="" getter="" default="false"> - </member> - <member name="rendering/gles2/compatibility/enable_high_float.Android" type="bool" setter="" getter="" default="false"> - </member> <member name="rendering/global_illumination/gi/use_half_resolution" type="bool" setter="" getter="" default="false"> If [code]true[/code], renders [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. [LightmapGI] rendering is not affected by this setting. [b]Note:[/b] This property is only read when the project starts. To set half-resolution GI at run-time, call [method RenderingServer.gi_set_use_half_resolution] instead. @@ -1714,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> @@ -1743,6 +1799,15 @@ </member> <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 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="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> <member name="rendering/limits/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10"> @@ -1813,12 +1878,6 @@ </member> <member name="rendering/shader_compiler/shader_cache/use_zstd_compression" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/shading/overrides/force_blinn_over_ggx" type="bool" setter="" getter="" default="false"> - If [code]true[/code], uses faster but lower-quality Blinn model to generate blurred reflections instead of the GGX model. - </member> - <member name="rendering/shading/overrides/force_blinn_over_ggx.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/shading/overrides/force_blinn_over_ggx] on mobile devices, due to performance concerns or driver support. - </member> <member name="rendering/shading/overrides/force_lambert_over_burley" type="bool" setter="" getter="" default="false"> If [code]true[/code], uses faster but lower-quality Lambert material lighting model instead of Burley. </member> @@ -1839,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> @@ -1909,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"> @@ -1921,8 +1986,29 @@ </member> <member name="rendering/vulkan/staging_buffer/texture_upload_region_size_px" type="int" setter="" getter="" default="64"> </member> - <member name="rendering/xr/enabled" type="bool" setter="" getter="" default="false"> - If [code]true[/code], XR support is enabled in Godot, this ensures required shaders are compiled. + <member name="threading/worker_pool/low_priority_thread_ratio" type="float" setter="" getter="" default="0.3"> + </member> + <member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1"> + </member> + <member name="threading/worker_pool/use_system_threads_for_low_priority_tasks" type="bool" setter="" getter="" default="true"> + </member> + <member name="xr/openxr/default_action_map" type="String" setter="" getter="" default=""res://openxr_action_map.tres""> + Action map configuration to load by default. + </member> + <member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false"> + If [code]true[/code] Godot will setup and initialise OpenXR on startup. + </member> + <member name="xr/openxr/form_factor" type="int" setter="" getter="" default=""0""> + Specify whether OpenXR should be configured for an HMD or a hand held device. + </member> + <member name="xr/openxr/reference_space" type="int" setter="" getter="" default=""1""> + Specify the default reference space. + </member> + <member name="xr/openxr/view_configuration" type="int" setter="" getter="" default=""1""> + Specify the view configuration with which to configure OpenXR setting up either Mono or Stereo rendering. + </member> + <member name="xr/shaders/enabled" type="bool" setter="" getter="" default="false"> + If [code]true[/code], Godot will compile shaders required for XR. </member> </members> </class> diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml new file mode 100644 index 0000000000..115015c2d7 --- /dev/null +++ b/doc/classes/Projection.xml @@ -0,0 +1,273 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Projection" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <constructors> + <constructor name="Projection"> + <return type="Projection" /> + <description> + </description> + </constructor> + <constructor name="Projection"> + <return type="Projection" /> + <argument index="0" name="from" type="Projection" /> + <description> + </description> + </constructor> + <constructor name="Projection"> + <return type="Projection" /> + <argument index="0" name="from" type="Transform3D" /> + <description> + </description> + </constructor> + </constructors> + <methods> + <method name="create_depth_correction" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="flip_y" type="bool" /> + <description> + </description> + </method> + <method name="create_fit_aabb" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="aabb" type="AABB" /> + <description> + </description> + </method> + <method name="create_for_hmd" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="eye" type="int" /> + <argument index="1" name="aspect" type="float" /> + <argument index="2" name="intraocular_dist" type="float" /> + <argument index="3" name="display_width" type="float" /> + <argument index="4" name="display_to_lens" type="float" /> + <argument index="5" name="oversample" type="float" /> + <argument index="6" name="z_near" type="float" /> + <argument index="7" name="z_far" type="float" /> + <description> + </description> + </method> + <method name="create_frustum" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="left" type="float" /> + <argument index="1" name="right" type="float" /> + <argument index="2" name="bottom" type="float" /> + <argument index="3" name="top" type="float" /> + <argument index="4" name="z_near" type="float" /> + <argument index="5" name="z_far" type="float" /> + <description> + </description> + </method> + <method name="create_frustum_aspect" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="size" type="float" /> + <argument index="1" name="aspect" type="float" /> + <argument index="2" name="offset" type="Vector2" /> + <argument index="3" name="z_near" type="float" /> + <argument index="4" name="z_far" type="float" /> + <argument index="5" name="flip_fov" type="bool" default="false" /> + <description> + </description> + </method> + <method name="create_light_atlas_rect" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="rect" type="Rect2" /> + <description> + </description> + </method> + <method name="create_orthogonal" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="left" type="float" /> + <argument index="1" name="right" type="float" /> + <argument index="2" name="bottom" type="float" /> + <argument index="3" name="top" type="float" /> + <argument index="4" name="z_near" type="float" /> + <argument index="5" name="z_far" type="float" /> + <description> + </description> + </method> + <method name="create_orthogonal_aspect" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="size" type="float" /> + <argument index="1" name="aspect" type="float" /> + <argument index="2" name="z_near" type="float" /> + <argument index="3" name="z_far" type="float" /> + <argument index="4" name="flip_fov" type="bool" default="false" /> + <description> + </description> + </method> + <method name="create_perspective" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="fovy" type="float" /> + <argument index="1" name="aspect" type="float" /> + <argument index="2" name="z_near" type="float" /> + <argument index="3" name="z_far" type="float" /> + <argument index="4" name="flip_fov" type="bool" default="false" /> + <description> + </description> + </method> + <method name="create_perspective_hmd" qualifiers="static"> + <return type="Projection" /> + <argument index="0" name="fovy" type="float" /> + <argument index="1" name="aspect" type="float" /> + <argument index="2" name="z_near" type="float" /> + <argument index="3" name="z_far" type="float" /> + <argument index="4" name="flip_fov" type="bool" /> + <argument index="5" name="eye" type="int" /> + <argument index="6" name="intraocular_dist" type="float" /> + <argument index="7" name=" convergence_dist" type="float" /> + <description> + </description> + </method> + <method name="determinant" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="flipped_y" qualifiers="const"> + <return type="Projection" /> + <description> + </description> + </method> + <method name="get_aspect" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="get_far_plane_half_extents" qualifiers="const"> + <return type="Vector2" /> + <description> + </description> + </method> + <method name="get_fov" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="get_fovy" qualifiers="static"> + <return type="float" /> + <argument index="0" name="fovx" type="float" /> + <argument index="1" name="aspect" type="float" /> + <description> + </description> + </method> + <method name="get_lod_multiplier" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="get_pixels_per_meter" qualifiers="const"> + <return type="int" /> + <argument index="0" name="for_pixel_width" type="int" /> + <description> + </description> + </method> + <method name="get_projection_plane" qualifiers="const"> + <return type="Plane" /> + <argument index="0" name="plane" type="int" /> + <description> + </description> + </method> + <method name="get_viewport_half_extents" qualifiers="const"> + <return type="Vector2" /> + <description> + </description> + </method> + <method name="get_z_far" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="get_z_near" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="inverse" qualifiers="const"> + <return type="Projection" /> + <description> + </description> + </method> + <method name="is_orthogonal" qualifiers="const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="jitter_offseted" qualifiers="const"> + <return type="Projection" /> + <argument index="0" name="offset" type="Vector2" /> + <description> + </description> + </method> + <method name="perspective_znear_adjusted" qualifiers="const"> + <return type="Projection" /> + <argument index="0" name="new_znear" type="float" /> + <description> + </description> + </method> + </methods> + <members> + <member name="w" type="Vector4" setter="" getter="" default="Vector4(0, 0, 0)"> + </member> + <member name="x" type="Vector4" setter="" getter="" default="Vector4(1, 0, 0)"> + </member> + <member name="y" type="Vector4" setter="" getter="" default="Vector4(0, 1, 0)"> + </member> + <member name="z" type="Vector4" setter="" getter="" default="Vector4(0, 0, 1)"> + </member> + </members> + <constants> + <constant name="PLANE_NEAR" value="0"> + </constant> + <constant name="PLANE_FAR" value="1"> + </constant> + <constant name="PLANE_LEFT" value="2"> + </constant> + <constant name="PLANE_TOP" value="3"> + </constant> + <constant name="PLANE_RIGHT" value="4"> + </constant> + <constant name="PLANE_BOTTOM" value="5"> + </constant> + <constant name="IDENTITY" value="Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"> + </constant> + <constant name="ZERO" value="Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"> + </constant> + </constants> + <operators> + <operator name="operator !="> + <return type="bool" /> + <argument index="0" name="right" type="Projection" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Projection" /> + <argument index="0" name="right" type="Projection" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + </description> + </operator> + <operator name="operator =="> + <return type="bool" /> + <argument index="0" name="right" type="Projection" /> + <description> + </description> + </operator> + <operator name="operator []"> + <return type="Vector4" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </operator> + </operators> +</class> diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index c94b649b58..30e96607da 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -74,16 +74,6 @@ [b]Note:[/b] This method has an abnormally high amount of floating-point error, so methods such as [code]is_zero_approx[/code] will not work reliably. </description> </method> - <method name="cubic_slerp" qualifiers="const"> - <return type="Quaternion" /> - <argument index="0" name="b" type="Quaternion" /> - <argument index="1" name="pre_a" type="Quaternion" /> - <argument index="2" name="post_b" type="Quaternion" /> - <argument index="3" name="weight" type="float" /> - <description> - Performs a cubic spherical interpolation between quaternions [code]pre_a[/code], this vector, [code]b[/code], and [code]post_b[/code], by the given amount [code]weight[/code]. - </description> - </method> <method name="dot" qualifiers="const"> <return type="float" /> <argument index="0" name="with" type="Quaternion" /> @@ -91,6 +81,11 @@ Returns the dot product of two quaternions. </description> </method> + <method name="exp" qualifiers="const"> + <return type="Quaternion" /> + <description> + </description> + </method> <method name="get_angle" qualifiers="const"> <return type="float" /> <description> @@ -138,6 +133,11 @@ Returns the length of the quaternion, squared. </description> </method> + <method name="log" qualifiers="const"> + <return type="Quaternion" /> + <description> + </description> + </method> <method name="normalized" qualifiers="const"> <return type="Quaternion" /> <description> @@ -161,6 +161,16 @@ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees. </description> </method> + <method name="spherical_cubic_interpolate" qualifiers="const"> + <return type="Quaternion" /> + <argument index="0" name="b" type="Quaternion" /> + <argument index="1" name="pre_a" type="Quaternion" /> + <argument index="2" name="post_b" type="Quaternion" /> + <argument index="3" name="weight" type="float" /> + <description> + Performs a spherical cubic interpolation between quaternions [code]pre_a[/code], this vector, [code]b[/code], and [code]post_b[/code], by the given amount [code]weight[/code]. + </description> + </method> </methods> <members> <member name="w" type="float" setter="" getter="" default="1.0"> @@ -188,11 +198,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Quaternion" /> <description> Returns [code]true[/code] if the quaternions are not equal. @@ -257,11 +262,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Quaternion" /> <description> Returns [code]true[/code] if the quaternions are exactly equal. diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index 6888c1f56c..39be605e1b 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -40,11 +40,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="RID" /> <description> </description> @@ -63,11 +58,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="RID" /> <description> </description> diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index 70a9912b76..22793e75d8 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -4,54 +4,61 @@ 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> <methods> + <method name="_value_changed" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="new_value" type="float" /> + <description> + Called when the [Range]'s value is changed (following the same conditions as [signal value_changed]). + </description> + </method> <method name="share"> <return type="void" /> <argument index="0" name="with" type="Node" /> <description> - Binds two ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. + Binds two [Range]s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. </description> </method> <method name="unshare"> <return type="void" /> <description> - Stops range from sharing its member variables with any other. + Stops the [Range] from sharing its member variables with any other. </description> </method> </methods> <members> - <member name="allow_greater" type="bool" setter="set_allow_greater" getter="is_greater_allowed" default="false"> + <member name="allow_greater" type="bool" setter="set_allow_greater" getter="is_greater_allowed"> If [code]true[/code], [member value] may be greater than [member max_value]. </member> - <member name="allow_lesser" type="bool" setter="set_allow_lesser" getter="is_lesser_allowed" default="false"> + <member name="allow_lesser" type="bool" setter="set_allow_lesser" getter="is_lesser_allowed"> If [code]true[/code], [member value] may be less than [member min_value]. </member> - <member name="exp_edit" type="bool" setter="set_exp_ratio" getter="is_ratio_exp" default="false"> + <member name="exp_edit" type="bool" setter="set_exp_ratio" getter="is_ratio_exp"> If [code]true[/code], and [code]min_value[/code] is greater than 0, [code]value[/code] will be represented exponentially rather than linearly. </member> - <member name="max_value" type="float" setter="set_max" getter="get_max" default="100.0"> + <member name="max_value" type="float" setter="set_max" getter="get_max"> Maximum value. Range is clamped if [code]value[/code] is greater than [code]max_value[/code]. </member> - <member name="min_value" type="float" setter="set_min" getter="get_min" default="0.0"> + <member name="min_value" type="float" setter="set_min" getter="get_min"> Minimum value. Range is clamped if [code]value[/code] is less than [code]min_value[/code]. </member> - <member name="page" type="float" setter="set_page" getter="get_page" default="0.0"> + <member name="page" type="float" setter="set_page" getter="get_page"> Page size. Used mainly for [ScrollBar]. ScrollBar's length is its size multiplied by [code]page[/code] over the difference between [code]min_value[/code] and [code]max_value[/code]. </member> <member name="ratio" type="float" setter="set_as_ratio" getter="get_as_ratio"> The value mapped between 0 and 1. </member> - <member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values" default="false"> + <member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values"> If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer. </member> - <member name="step" type="float" setter="set_step" getter="get_step" default="1.0"> + <member name="step" type="float" setter="set_step" getter="get_step"> If greater than 0, [code]value[/code] will always be rounded to a multiple of [code]step[/code]. If [code]rounded[/code] is also [code]true[/code], [code]value[/code] will first be rounded to a multiple of [code]step[/code] then rounded to the nearest integer. </member> - <member name="value" type="float" setter="set_value" getter="get_value" default="0.0"> + <member name="value" type="float" setter="set_value" getter="get_value"> Range's current value. </member> </members> @@ -64,7 +71,8 @@ <signal name="value_changed"> <argument index="0" name="value" type="float" /> <description> - Emitted when [member value] changes. + Emitted when [member value] changes. When used on a [Slider], this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [signal value_changed], consider using a [i]debouncing[/i] [Timer] to call the function less often. + [b]Note:[/b] Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also emitted when [code]value[/code] is set directly via code. </description> </signal> </signals> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index a975382bfa..e4b66a9d53 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -189,11 +189,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Rect2" /> <description> Returns [code]true[/code] if the rectangles are not equal. @@ -209,11 +204,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Rect2" /> <description> Returns [code]true[/code] if the rectangles are exactly equal. diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 78ab4b9103..c9ae685a15 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -153,7 +153,6 @@ <argument index="0" name="b" type="Rect2i" /> <description> Returns [code]true[/code] if the [Rect2i] overlaps with [code]b[/code] (i.e. they have at least one point in common). - If [code]include_borders[/code] is [code]true[/code], they will also be considered overlapping if their borders touch, even without intersection. </description> </method> <method name="merge" qualifiers="const"> @@ -179,11 +178,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Rect2i" /> <description> Returns [code]true[/code] if the rectangles are not equal. @@ -191,11 +185,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Rect2i" /> <description> Returns [code]true[/code] if the rectangles are equal. diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml index cc3da8a789..124d752ae0 100644 --- a/doc/classes/RectangleShape2D.xml +++ b/doc/classes/RectangleShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="RectangleShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Rectangle shape for 2D collisions. + Rectangle shape resource for 2D physics. </brief_description> <description> - Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. + 2D rectangle shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. This shape is useful for modeling box-like 2D objects. + [b]Performance:[/b] Being a primitive collision shape, [RectangleShape2D] is fast to check collisions against (though not as fast as [CircleShape2D]). </description> <tutorials> <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index debbfd8d5d..ff66a89cb7 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -5,7 +5,7 @@ </brief_description> <description> Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur to simulate different material roughnesses. - The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [member update_mode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [ReflectionProbe]s can also be combined with [VoxelGI], SDFGI ([member Environment.sdfgi_enabled]) and screen-space reflections ([member Environment.ss_reflections_enabled]) to get more accurate reflections in specific areas. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. + The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [member update_mode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [ReflectionProbe]s can also be combined with [VoxelGI], SDFGI ([member Environment.sdfgi_enabled]) and screen-space reflections ([member Environment.ssr_enabled]) to get more accurate reflections in specific areas. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. [b]Note:[/b] Unlike [VoxelGI] and SDFGI, [ReflectionProbe]s only source their environment from a [WorldEnvironment] node. If you specify an [Environment] resource within a [Camera3D] node, it will be ignored by the [ReflectionProbe]. This can lead to incorrect lighting within the [ReflectionProbe]. </description> <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 bb8aa8c9db..c2752d9f7b 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -149,6 +149,17 @@ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. </description> </method> + <method name="canvas_item_add_animation_slice"> + <return type="void" /> + <argument index="0" name="item" type="RID" /> + <argument index="1" name="animation_length" type="float" /> + <argument index="2" name="slice_begin" type="float" /> + <argument index="3" name="slice_end" type="float" /> + <argument index="4" name="offset" type="float" default="0.0" /> + <description> + Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. + </description> + </method> <method name="canvas_item_add_circle"> <return type="void" /> <argument index="0" name="item" type="RID" /> @@ -172,6 +183,7 @@ <argument index="2" name="to" type="Vector2" /> <argument index="3" name="color" type="Color" /> <argument index="4" name="width" type="float" default="1.0" /> + <argument index="5" name="antialiased" type="bool" default="false" /> <description> </description> </method> @@ -878,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> @@ -1174,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"> @@ -1190,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"> @@ -1240,6 +1252,13 @@ Returns the id of the test texture. Creates one if none exists. </description> </method> + <method name="get_video_adapter_api_version" qualifiers="const"> + <return type="String" /> + <description> + Returns the version of the graphics video adapter [i]currently in use[/i] (e.g. "1.2.189" for Vulkan, "3.3.0 NVIDIA 510.60.02" for OpenGL). This version may be different from the actual latest version supported by the hardware, as Godot may not always request the latest version. + [b]Note:[/b] When running a headless or server binary, this function returns an empty string. + </description> + </method> <method name="get_video_adapter_name" qualifiers="const"> <return type="String" /> <description> @@ -1605,10 +1624,10 @@ Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_mode]. See [enum LightDirectionalShadowMode] for options. </description> </method> - <method name="light_directional_set_sky_only"> + <method name="light_directional_set_sky_mode"> <return type="void" /> <argument index="0" name="light" type="RID" /> - <argument index="1" name="enable" type="bool" /> + <argument index="1" name="mode" type="int" enum="RenderingServer.LightDirectionalSkyMode" /> <description> If [code]true[/code], this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. </description> @@ -1650,6 +1669,17 @@ Sets the cull mask for this Light3D. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask]. </description> </method> + <method name="light_set_distance_fade"> + <return type="void" /> + <argument index="0" name="decal" type="RID" /> + <argument index="1" name="enabled" type="bool" /> + <argument index="2" name="begin" type="float" /> + <argument index="3" name="shadow" type="float" /> + <argument index="4" name="length" type="float" /> + <description> + Sets the distance fade for this Light3D. This acts as a form of level of detail (LOD) and can be used to improve performance. Equivalent to [member Light3D.distance_fade_enabled], [member Light3D.distance_fade_begin], [member Light3D.distance_fade_shadow], and [member Light3D.distance_fade_length]. + </description> + </method> <method name="light_set_max_sdfgi_cascade"> <return type="void" /> <argument index="0" name="light" type="RID" /> @@ -1698,14 +1728,6 @@ If [code]true[/code], light will cast shadows. Equivalent to [member Light3D.shadow_enabled]. </description> </method> - <method name="light_set_shadow_color"> - <return type="void" /> - <argument index="0" name="light" type="RID" /> - <argument index="1" name="color" type="Color" /> - <description> - Sets the color of the shadow cast by the light. Equivalent to [member Light3D.shadow_color]. - </description> - </method> <method name="lightmap_create"> <return type="RID" /> <description> @@ -2497,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> @@ -2720,6 +2748,13 @@ Returns the parameters of a shader. </description> </method> + <method name="shader_set_code"> + <return type="void" /> + <argument index="0" name="shader" type="RID" /> + <argument index="1" name="code" type="String" /> + <description> + </description> + </method> <method name="shader_set_default_texture_param"> <return type="void" /> <argument index="0" name="shader" type="RID" /> @@ -2731,9 +2766,10 @@ [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"> + <method name="shader_set_path_hint"> <return type="void" /> - <argument index="0" name="quality" type="int" enum="RenderingServer.ShadowQuality" /> + <argument index="0" name="shader" type="RID" /> + <argument index="1" name="path" type="String" /> <description> </description> </method> @@ -3013,7 +3049,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"> @@ -3198,6 +3234,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" /> @@ -3247,24 +3302,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" /> @@ -3318,6 +3355,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" /> @@ -3326,6 +3371,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> @@ -3781,6 +3842,15 @@ <constant name="LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS" value="2" enum="LightDirectionalShadowMode"> Use 4 splits for shadow projection when using directional light. </constant> + <constant name="LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_AND_SKY" value="0" enum="LightDirectionalSkyMode"> + Use DirectionalLight3D in both sky rendering and scene lighting. + </constant> + <constant name="LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_ONLY" value="1" enum="LightDirectionalSkyMode"> + Only use DirectionalLight3D in scene lighting. + </constant> + <constant name="LIGHT_DIRECTIONAL_SKY_MODE_SKY_ONLY" value="2" enum="LightDirectionalSkyMode"> + Only use DirectionalLight3D in sky rendering. + </constant> <constant name="SHADOW_QUALITY_HARD" value="0" enum="ShadowQuality"> Lowest shadow filtering quality (fastest). Soft shadows are not available with this quality setting, which means the [member Light3D.shadow_blur] property is ignored if [member Light3D.light_size] and [member Light3D.light_angular_distance] is [code]0.0[/code]. [b]Note:[/b] The variable shadow blur performed by [member Light3D.light_size] and [member Light3D.light_angular_distance] is still effective when using hard shadow filtering. In this case, [member Light3D.shadow_blur] [i]is[/i] taken into account. However, the results will not be blurred, instead the blur amount is treated as a maximum radius for the penumbra. @@ -3900,19 +3970,27 @@ <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_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="1" enum="FogVolumeShape"> + <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"> - Enables bilinear scaling on 3D viewports. 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. + 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> <constant name="VIEWPORT_SCALING_3D_MODE_FSR" value="1" enum="ViewportScaling3DMode"> - Enables FSR upscaling on 3D viewports. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling 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 be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. </constant> <constant name="VIEWPORT_SCALING_3D_MODE_MAX" value="2" enum="ViewportScaling3DMode"> </constant> @@ -4066,6 +4144,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"> @@ -4135,24 +4227,29 @@ Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect. </constant> <constant name="ENV_TONE_MAPPER_LINEAR" value="0" enum="EnvironmentToneMapper"> - Output color as they came in. + Output color as they came in. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. </constant> <constant name="ENV_TONE_MAPPER_REINHARD" value="1" enum="EnvironmentToneMapper"> - Use the Reinhard tonemapper. + Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull. </constant> <constant name="ENV_TONE_MAPPER_FILMIC" value="2" enum="EnvironmentToneMapper"> - Use the filmic tonemapper. + Use the filmic tonemapper. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant ENV_TONE_MAPPER_REINHARD]. </constant> <constant name="ENV_TONE_MAPPER_ACES" value="3" enum="EnvironmentToneMapper"> - Use the ACES tonemapper. + Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [constant ENV_TONE_MAPPER_REINHARD] and [constant ENV_TONE_MAPPER_FILMIC]. + [b]Note:[/b] This tonemapping operator is called "ACES Fitted" in Godot 3.x. </constant> - <constant name="ENV_SSR_ROUGNESS_QUALITY_DISABLED" value="0" enum="EnvironmentSSRRoughnessQuality"> + <constant name="ENV_SSR_ROUGHNESS_QUALITY_DISABLED" value="0" enum="EnvironmentSSRRoughnessQuality"> + Lowest quality of roughness filter for screen-space reflections. Rough materials will not have blurrier screen-space reflections compared to smooth (non-rough) materials. This is the fastest option. </constant> - <constant name="ENV_SSR_ROUGNESS_QUALITY_LOW" value="1" enum="EnvironmentSSRRoughnessQuality"> + <constant name="ENV_SSR_ROUGHNESS_QUALITY_LOW" value="1" enum="EnvironmentSSRRoughnessQuality"> + Low quality of roughness filter for screen-space reflections. </constant> - <constant name="ENV_SSR_ROUGNESS_QUALITY_MEDIUM" value="2" enum="EnvironmentSSRRoughnessQuality"> + <constant name="ENV_SSR_ROUGHNESS_QUALITY_MEDIUM" value="2" enum="EnvironmentSSRRoughnessQuality"> + Medium quality of roughness filter for screen-space reflections. </constant> - <constant name="ENV_SSR_ROUGNESS_QUALITY_HIGH" value="3" enum="EnvironmentSSRRoughnessQuality"> + <constant name="ENV_SSR_ROUGHNESS_QUALITY_HIGH" value="3" enum="EnvironmentSSRRoughnessQuality"> + High quality of roughness filter for screen-space reflections. This is the slowest option. </constant> <constant name="ENV_SSAO_QUALITY_VERY_LOW" value="0" enum="EnvironmentSSAOQuality"> Lowest quality of screen-space ambient occlusion. diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 0850d39015..b08b1540ab 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -12,6 +12,11 @@ <link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link> </tutorials> <methods> + <method name="_get_rid" qualifiers="virtual"> + <return type="RID" /> + <description> + </description> + </method> <method name="duplicate" qualifiers="const"> <return type="Resource" /> <argument index="0" name="subresources" type="bool" default="false" /> diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index c516aec809..fef94b5f3b 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -6,7 +6,7 @@ <description> Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the [ResourceLoader] singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine. Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with [code]class_name[/code] for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a [ResourceFormatSaver]. - [b]Note:[/b] You can also extend [EditorImportPlugin] if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import [code].png[/code] textures as [code].stex[/code] ([StreamTexture2D]) first, so they can be loaded with better efficiency on the graphics card. + [b]Note:[/b] You can also extend [EditorImportPlugin] if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import [code].png[/code] textures as [code].ctex[/code] ([CompressedTexture2D]) first, so they can be loaded with better efficiency on the graphics card. </description> <tutorials> </tutorials> @@ -17,6 +17,12 @@ <description> </description> </method> + <method name="_get_classes_used" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> <method name="_get_dependencies" qualifiers="virtual const"> <return type="PackedStringArray" /> <argument index="0" name="path" type="String" /> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 1ffb0dba5c..dd52d09750 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -6,11 +6,21 @@ <description> Singleton used to load resource files from the filesystem. It uses the many [ResourceFormatLoader] classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine. + [b]Note:[/b] You have to import the files into the engine first to load them using [method load]. If you want to load [Image]s at run-time, you may use [method Image.load]. If you want to import audio files, you can use the snippet described in [member AudioStreamMP3.data]. </description> <tutorials> <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 implicitly 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 +99,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 3872db5ea9..240c72a131 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 implicitly 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,6 +26,13 @@ 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" /> @@ -24,31 +40,34 @@ <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. + The [code]flags[/code] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. Returns [constant OK] on success. </description> </method> </methods> <constants> - <constant name="FLAG_RELATIVE_PATHS" value="1" 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" 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 f480071d32..8228bcc442 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -49,11 +49,18 @@ Clears the tag stack and sets [member text] to an empty string. </description> </method> + <method name="deselect"> + <return type="void" /> + <description> + Clears the current selection. + </description> + </method> <method name="get_character_line"> <return type="int" /> <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"> @@ -61,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"> @@ -86,6 +97,14 @@ <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"> + <return type="PopupMenu" /> + <description> + Returns the [PopupMenu] of this [RichTextLabel]. By default, this menu is displayed when right-clicking on the [RichTextLabel]. + [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_paragraph_count" qualifiers="const"> @@ -99,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"> @@ -142,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"> @@ -157,6 +179,18 @@ Installs a custom effect. [code]effect[/code] should be a valid [RichTextEffect]. </description> </method> + <method name="is_menu_visible" qualifiers="const"> + <return type="bool" /> + <description> + 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> @@ -238,22 +272,22 @@ <method name="push_font"> <return type="void" /> <argument index="0" name="font" type="Font" /> + <argument index="1" name="font_size" type="int" /> <description> Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration. </description> </method> - <method name="push_font_features"> + <method name="push_font_size"> <return type="void" /> - <argument index="0" name="opentype_features" type="Dictionary" /> + <argument index="0" name="font_size" type="int" /> <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"> + <method name="push_hint"> <return type="void" /> - <argument index="0" name="font_size" type="int" /> + <argument index="0" name="description" type="String" /> <description> - Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. + Adds a [code][hint][/code] tag to the tag stack. Same as BBCode [code][hint=something]{text}[/hint][/code]. </description> </method> <method name="push_indent"> @@ -316,7 +350,7 @@ <argument index="0" name="alignment" type="int" enum="HorizontalAlignment" /> <argument index="1" name="base_direction" type="int" enum="Control.TextDirection" default="0" /> <argument index="2" name="language" type="String" default="""" /> - <argument index="3" name="st_parser" type="int" enum="Control.StructuredTextParser" default="0" /> + <argument index="3" name="st_parser" type="int" enum="TextServer.StructuredTextParser" default="0" /> <description> Adds a [code][p][/code] tag to the tag stack. </description> @@ -363,6 +397,13 @@ Scrolls the window's top line to match first line of the [code]paragraph[/code]. </description> </method> + <method name="select_all"> + <return type="void" /> + <description> + Select all the text. + If [member selection_enabled] is [code]false[/code], no selection will occur. + </description> + </method> <method name="set_cell_border_color"> <return type="void" /> <argument index="0" name="color" type="Color" /> @@ -406,12 +447,16 @@ </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. </member> + <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> + <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="false"> + If [code]true[/code], a right-click displays the context menu. + </member> <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]"> The currently installed custom effects. This is an array of [RichTextEffect]s. To add a custom effect, it's more convenient to use [method install_effect]. @@ -423,6 +468,9 @@ If [code]true[/code], the label's height will be automatically updated to fit its content. [b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions. </member> + <member name="hint_underlined" type="bool" setter="set_hint_underline" getter="is_hint_underlined" default="true"> + If [code]true[/code], the label underlines hint tags such as [code][hint=description]{text}[/hint][/code]. + </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> @@ -436,7 +484,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="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> + <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> @@ -446,7 +497,10 @@ <member name="selection_enabled" type="bool" setter="set_selection_enabled" getter="is_selection_enabled" default="false"> If [code]true[/code], the label allows text selection. </member> - <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> + <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> + If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled. + </member> + <member name="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="[]"> @@ -462,15 +516,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> @@ -491,18 +553,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> @@ -563,24 +613,11 @@ </constant> <constant name="ITEM_META" value="23" enum="ItemType"> </constant> - <constant name="ITEM_DROPCAP" value="24" enum="ItemType"> - </constant> - <constant name="ITEM_CUSTOMFX" value="25" 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 name="ITEM_HINT" value="24" enum="ItemType"> </constant> - <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the left. + <constant name="ITEM_DROPCAP" value="25" enum="ItemType"> </constant> - <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> - Displays [member percent_visible] glyphs, starting from the right. + <constant name="ITEM_CUSTOMFX" value="26" enum="ItemType"> </constant> </constants> <theme_items> @@ -623,10 +660,10 @@ <theme_item name="shadow_outline_size" data_type="constant" type="int" default="1"> The size of the shadow outline. </theme_item> - <theme_item name="table_hseparation" data_type="constant" type="int" default="3"> + <theme_item name="table_h_separation" data_type="constant" type="int" default="3"> The horizontal separation of elements in a table. </theme_item> - <theme_item name="table_vseparation" data_type="constant" type="int" default="3"> + <theme_item name="table_v_separation" data_type="constant" type="int" default="3"> The vertical separation of elements in a table. </theme_item> <theme_item name="bold_font" data_type="font" type="Font"> diff --git a/doc/classes/RigidDynamicBody2D.xml b/doc/classes/RigidDynamicBody2D.xml index 696ad7a98e..087156989e 100644 --- a/doc/classes/RigidDynamicBody2D.xml +++ b/doc/classes/RigidDynamicBody2D.xml @@ -219,8 +219,8 @@ Emitted when one of this RigidDynamicBody2D's [Shape2D]s collides with another [PhysicsBody2D] or [TileMap]'s [Shape2D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. [code]body_rid[/code] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - [code]body_shape_index[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_shape_exited"> @@ -232,8 +232,8 @@ Emitted when the collision between one of this RigidDynamicBody2D's [Shape2D]s and another [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. [code]body_rid[/code] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - [code]body_shape_index[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. + [code]body_shape_index[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="sleeping_state_changed"> diff --git a/doc/classes/RigidDynamicBody3D.xml b/doc/classes/RigidDynamicBody3D.xml index 5fd53a7638..285176b8b0 100644 --- a/doc/classes/RigidDynamicBody3D.xml +++ b/doc/classes/RigidDynamicBody3D.xml @@ -225,9 +225,8 @@ Emitted when one of this RigidDynamicBody3D's [Shape3D]s collides with another [PhysicsBody3D] or [GridMap]'s [Shape3D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. [code]body_rid[/code] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - [code]body_shape_index[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. - [b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape3D]. Don't use multiple [CollisionShape3D]s when using a [ConcavePolygonShape3D] with Bullet physics if you need shape indices. + [code]body_shape_index[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="body_shape_exited"> @@ -239,9 +238,8 @@ Emitted when the collision between one of this RigidDynamicBody3D's [Shape3D]s and another [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. [code]body_rid[/code] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [GridMap]s are detected if the Meshes have [Shape3D]s. [code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - [code]body_shape_index[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. - [code]local_shape_index[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. - [b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape3D]. Don't use multiple [CollisionShape3D]s when using a [ConcavePolygonShape3D] with Bullet physics if you need shape indices. + [code]body_shape_index[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))[/code]. + [code]local_shape_index[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with [code]self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code]. </description> </signal> <signal name="sleeping_state_changed"> 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 288c35f159..9982cc0d60 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -14,27 +14,26 @@ </tutorials> <methods> <method name="call_group" qualifiers="vararg"> - <return type="Variant" /> + <return type="void" /> <argument index="0" name="group" type="StringName" /> <argument index="1" name="method" type="StringName" /> <description> - Calls [code]method[/code] on each member of the given group. You can pass arguments to [code]method[/code] by specifying them at the end of the method call. This method is equivalent of calling [method call_group_flags] with [constant GROUP_CALL_DEFAULT] flag. - [b]Note:[/b] Due to design limitations, [method call_group] will fail silently if one of the arguments is [code]null[/code]. - [b]Note:[/b] [method call_group] will always call methods with an one-frame delay, in a way similar to [method Object.call_deferred]. To call methods immediately, use [method call_group_flags] with the [constant GROUP_CALL_REALTIME] flag. + Calls [code]method[/code] on each member of the given group. You can pass arguments to [code]method[/code] by specifying them at the end of the method call. If a node doesn't have the given method or the argument list does not match (either in count or in types), it will be skipped. + [b]Note:[/b] [method call_group] will call methods immediately on all members at once, which can cause stuttering if an expensive method is called on lots of members. To wait for one frame after [method call_group] was called, use [method call_group_flags] with the [constant GROUP_CALL_DEFERRED] flag. </description> </method> <method name="call_group_flags" qualifiers="vararg"> - <return type="Variant" /> + <return type="void" /> <argument index="0" name="flags" type="int" /> <argument index="1" name="group" type="StringName" /> <argument index="2" name="method" type="StringName" /> <description> - Calls [code]method[/code] on each member of the given group, respecting the given [enum GroupCallFlags]. You can pass arguments to [code]method[/code] by specifying them at the end of the method call. - [b]Note:[/b] Due to design limitations, [method call_group_flags] will fail silently if one of the arguments is [code]null[/code]. + Calls [code]method[/code] on each member of the given group, respecting the given [enum GroupCallFlags]. You can pass arguments to [code]method[/code] by specifying them at the end of the method call. If a node doesn't have the given method or the argument list does not match (either in count or in types), it will be skipped. [codeblock] - # Call the method immediately and in reverse order. - get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy") + # Call the method in a deferred manner and in reverse order. + get_tree().call_group_flags(SceneTree.GROUP_CALL_DEFERRED | SceneTree.GROUP_CALL_REVERSE) [/codeblock] + [b]Note:[/b] Group call flags are used to control the method calling behavior. By default, methods will be called immediately in a way similar to [method call_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [code]flags[/code] argument, methods will be called with a one-frame delay in a way similar to [method Object.set_deferred]. </description> </method> <method name="change_scene"> @@ -91,6 +90,7 @@ <return type="Node" /> <argument index="0" name="group" type="StringName" /> <description> + Returns the first node in the specified group, or [code]null[/code] if the group is empty or does not exist. </description> </method> <method name="get_frame" qualifiers="const"> @@ -99,6 +99,13 @@ Returns the current frame number, i.e. the total frame count since the application started. </description> </method> + <method name="get_multiplayer" qualifiers="const"> + <return type="MultiplayerAPI" /> + <argument index="0" name="for_path" type="NodePath" default="NodePath("")" /> + <description> + Return the [MultiplayerAPI] configured for the given path, or the default one if [code]for_path[/code] is empty. + </description> + </method> <method name="get_node_count" qualifiers="const"> <return type="int" /> <description> @@ -131,6 +138,7 @@ <argument index="1" name="notification" type="int" /> <description> Sends the given notification to all members of the [code]group[/code]. + [b]Note:[/b] [method notify_group] will immediately notify all members at once, which can cause stuttering if an expensive method is called as a result of sending the notification lots of members. To wait for one frame, use [method notify_group_flags] with the [constant GROUP_CALL_DEFERRED] flag. </description> </method> <method name="notify_group_flags"> @@ -140,6 +148,7 @@ <argument index="2" name="notification" type="int" /> <description> Sends the given notification to all members of the [code]group[/code], respecting the given [enum GroupCallFlags]. + [b]Note:[/b] Group call flags are used to control the notification sending behavior. By default, notifications will be sent immediately in a way similar to [method notify_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [code]flags[/code] argument, notifications will be sent with a one-frame delay in a way similar to using [code]Object.call_deferred("notification", ...)[/code]. </description> </method> <method name="queue_delete"> @@ -166,14 +175,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" /> @@ -181,6 +182,7 @@ <argument index="2" name="value" type="Variant" /> <description> Sets the given [code]property[/code] to [code]value[/code] on all members of the given group. + [b]Note:[/b] [method set_group] will set the property immediately on all members at once, which can cause stuttering if a property with an expensive setter is set on lots of members. To wait for one frame, use [method set_group_flags] with the [constant GROUP_CALL_DEFERRED] flag. </description> </method> <method name="set_group_flags"> @@ -191,18 +193,23 @@ <argument index="3" name="value" type="Variant" /> <description> Sets the given [code]property[/code] to [code]value[/code] on all members of the given group, respecting the given [enum GroupCallFlags]. + [b]Note:[/b] Group call flags are used to control the property setting behavior. By default, properties will be set immediately in a way similar to [method set_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [code]flags[/code] argument, properties will be set with a one-frame delay in a way similar to [method Object.call_deferred]. </description> </method> - <method name="set_quit_on_go_back"> + <method name="set_multiplayer"> <return type="void" /> - <argument index="0" name="enabled" type="bool" /> + <argument index="0" name="multiplayer" type="MultiplayerAPI" /> + <argument index="1" name="root_path" type="NodePath" default="NodePath("")" /> <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]. + 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> </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> @@ -212,12 +219,12 @@ <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> - <member name="multiplayer" type="MultiplayerAPI" setter="set_multiplayer" getter="get_multiplayer"> - The default [MultiplayerAPI] instance for this [SceneTree]. - </member> <member name="multiplayer_poll" type="bool" setter="set_multiplayer_poll_enabled" getter="is_multiplayer_poll_enabled" default="true"> If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame]. If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads. @@ -227,18 +234,15 @@ - 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> </members> <signals> - <signal name="files_dropped"> - <argument index="0" name="files" type="PackedStringArray" /> - <argument index="1" name="screen" type="int" /> - <description> - Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. - </description> - </signal> <signal name="node_added"> <argument index="0" name="node" type="Node" /> <description> @@ -291,8 +295,8 @@ <constant name="GROUP_CALL_REVERSE" value="1" enum="GroupCallFlags"> Call a group in reverse scene order. </constant> - <constant name="GROUP_CALL_REALTIME" value="2" enum="GroupCallFlags"> - Call a group immediately (calls are normally made on idle). + <constant name="GROUP_CALL_DEFERRED" value="2" enum="GroupCallFlags"> + Call a group with a one-frame delay (idle frame, not physics). </constant> <constant name="GROUP_CALL_UNIQUE" value="4" enum="GroupCallFlags"> Call a group only once even if the call is executed many times. 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/ScriptExtension.xml b/doc/classes/ScriptExtension.xml new file mode 100644 index 0000000000..91fa6206d7 --- /dev/null +++ b/doc/classes/ScriptExtension.xml @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ScriptExtension" inherits="Script" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_can_instantiate" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_editor_can_reload_from_file" qualifiers="virtual"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_get_base_script" qualifiers="virtual const"> + <return type="Script" /> + <description> + </description> + </method> + <method name="_get_constants" qualifiers="virtual const"> + <return type="Dictionary" /> + <description> + </description> + </method> + <method name="_get_documentation" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_instance_base_type" qualifiers="virtual const"> + <return type="StringName" /> + <description> + </description> + </method> + <method name="_get_language" qualifiers="virtual const"> + <return type="ScriptLanguage" /> + <description> + </description> + </method> + <method name="_get_member_line" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="member" type="StringName" /> + <description> + </description> + </method> + <method name="_get_members" qualifiers="virtual const"> + <return type="StringName[]" /> + <description> + </description> + </method> + <method name="_get_method_info" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="method" type="StringName" /> + <description> + </description> + </method> + <method name="_get_property_default_value" qualifiers="virtual const"> + <return type="Variant" /> + <argument index="0" name="property" type="StringName" /> + <description> + </description> + </method> + <method name="_get_rpc_methods" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_script_method_list" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_script_property_list" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_script_signal_list" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_source_code" qualifiers="virtual const"> + <return type="String" /> + <description> + </description> + </method> + <method name="_has_method" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="method" type="StringName" /> + <description> + </description> + </method> + <method name="_has_script_signal" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="signal" type="StringName" /> + <description> + </description> + </method> + <method name="_has_source_code" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_inherits_script" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="script" type="Script" /> + <description> + </description> + </method> + <method name="_instance_create" qualifiers="virtual const"> + <return type="void*" /> + <argument index="0" name="for_object" type="Object" /> + <description> + </description> + </method> + <method name="_instance_has" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="object" type="Object" /> + <description> + </description> + </method> + <method name="_is_placeholder_fallback_enabled" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_is_tool" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_is_valid" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_placeholder_erased" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="placeholder" type="void*" /> + <description> + </description> + </method> + <method name="_placeholder_instance_create" qualifiers="virtual const"> + <return type="void*" /> + <argument index="0" name="for_object" type="Object" /> + <description> + </description> + </method> + <method name="_reload" qualifiers="virtual"> + <return type="int" enum="Error" /> + <argument index="0" name="keep_state" type="bool" /> + <description> + </description> + </method> + <method name="_set_source_code" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="code" type="String" /> + <description> + </description> + </method> + <method name="_update_exports" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + </methods> +</class> diff --git a/doc/classes/ScriptLanguage.xml b/doc/classes/ScriptLanguage.xml new file mode 100644 index 0000000000..b229e461f5 --- /dev/null +++ b/doc/classes/ScriptLanguage.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ScriptLanguage" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml new file mode 100644 index 0000000000..45d4cf44fa --- /dev/null +++ b/doc/classes/ScriptLanguageExtension.xml @@ -0,0 +1,425 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ScriptLanguageExtension" inherits="ScriptLanguage" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="_add_global_constant" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="value" type="Variant" /> + <description> + </description> + </method> + <method name="_add_named_global_constant" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="value" type="Variant" /> + <description> + </description> + </method> + <method name="_alloc_instance_binding_data" qualifiers="virtual"> + <return type="void*" /> + <argument index="0" name="object" type="Object" /> + <description> + </description> + </method> + <method name="_auto_indent_code" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="code" type="String" /> + <argument index="1" name="from_line" type="int" /> + <argument index="2" name="to_line" type="int" /> + <description> + </description> + </method> + <method name="_can_inherit_from_file" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_complete_code" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="code" type="String" /> + <argument index="1" name="path" type="String" /> + <argument index="2" name="owner" type="Object" /> + <description> + </description> + </method> + <method name="_create_script" qualifiers="virtual const"> + <return type="Object" /> + <description> + </description> + </method> + <method name="_debug_get_current_stack_info" qualifiers="virtual"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_debug_get_error" qualifiers="virtual const"> + <return type="String" /> + <description> + </description> + </method> + <method name="_debug_get_globals" qualifiers="virtual"> + <return type="Dictionary" /> + <argument index="0" name="max_subitems" type="int" /> + <argument index="1" name="max_depth" type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_count" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_function" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="level" type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_instance" qualifiers="virtual"> + <return type="void*" /> + <argument index="0" name="level" type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_line" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="level" type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_locals" qualifiers="virtual"> + <return type="Dictionary" /> + <argument index="0" name="level" type="int" /> + <argument index="1" name="max_subitems" type="int" /> + <argument index="2" name="max_depth" type="int" /> + <description> + </description> + </method> + <method name="_debug_get_stack_level_members" qualifiers="virtual"> + <return type="Dictionary" /> + <argument index="0" name="level" type="int" /> + <argument index="1" name="max_subitems" type="int" /> + <argument index="2" name="max_depth" type="int" /> + <description> + </description> + </method> + <method name="_debug_parse_stack_level_expression" qualifiers="virtual"> + <return type="String" /> + <argument index="0" name="level" type="int" /> + <argument index="1" name="expression" type="String" /> + <argument index="2" name="max_subitems" type="int" /> + <argument index="3" name="max_depth" type="int" /> + <description> + </description> + </method> + <method name="_execute_file" qualifiers="virtual"> + <return type="int" enum="Error" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_find_function" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="class_name" type="String" /> + <argument index="1" name="function_name" type="String" /> + <description> + </description> + </method> + <method name="_finish" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_frame" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_free_instance_binding_data" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="data" type="void*" /> + <description> + </description> + </method> + <method name="_get_built_in_templates" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <argument index="0" name="object" type="StringName" /> + <description> + </description> + </method> + <method name="_get_comment_delimiters" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + </description> + </method> + <method name="_get_extension" qualifiers="virtual const"> + <return type="String" /> + <description> + </description> + </method> + <method name="_get_global_class_name" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_get_name" qualifiers="virtual const"> + <return type="String" /> + <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> + </description> + </method> + <method name="_get_public_functions" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> + <method name="_get_recognized_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + </description> + </method> + <method name="_get_reserved_words" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + </description> + </method> + <method name="_get_string_delimiters" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + </description> + </method> + <method name="_get_type" qualifiers="virtual const"> + <return type="String" /> + <description> + </description> + </method> + <method name="_handles_global_class_type" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="type" type="String" /> + <description> + </description> + </method> + <method name="_has_named_classes" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_init" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_is_control_flow_keyword" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="keyword" type="String" /> + <description> + </description> + </method> + <method name="_is_using_templates" qualifiers="virtual"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_lookup_code" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="code" type="String" /> + <argument index="1" name="symbol" type="String" /> + <argument index="2" name="path" type="String" /> + <argument index="3" name="owner" type="Object" /> + <description> + </description> + </method> + <method name="_make_function" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="class_name" type="String" /> + <argument index="1" name="function_name" type="String" /> + <argument index="2" name="function_args" type="PackedStringArray" /> + <description> + </description> + </method> + <method name="_make_template" qualifiers="virtual const"> + <return type="Script" /> + <argument index="0" name="template" type="String" /> + <argument index="1" name="class_name" type="String" /> + <argument index="2" name="base_class_name" type="String" /> + <description> + </description> + </method> + <method name="_open_in_external_editor" qualifiers="virtual"> + <return type="int" enum="Error" /> + <argument index="0" name="script" type="Script" /> + <argument index="1" name="line" type="int" /> + <argument index="2" name="column" type="int" /> + <description> + </description> + </method> + <method name="_overrides_external_editor" qualifiers="virtual"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_profiling_get_accumulated_data" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="info_array" type="ScriptLanguageExtensionProfilingInfo*" /> + <argument index="1" name="info_max" type="int" /> + <description> + </description> + </method> + <method name="_profiling_get_frame_data" qualifiers="virtual"> + <return type="int" /> + <argument index="0" name="info_array" type="ScriptLanguageExtensionProfilingInfo*" /> + <argument index="1" name="info_max" type="int" /> + <description> + </description> + </method> + <method name="_profiling_start" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_profiling_stop" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_refcount_decremented_instance_binding" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="object" type="Object" /> + <description> + </description> + </method> + <method name="_refcount_incremented_instance_binding" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="object" type="Object" /> + <description> + </description> + </method> + <method name="_reload_all_scripts" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_reload_tool_script" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="script" type="Script" /> + <argument index="1" name="soft_reload" type="bool" /> + <description> + </description> + </method> + <method name="_remove_named_global_constant" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="_supports_builtin_mode" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_supports_documentation" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_thread_enter" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_thread_exit" qualifiers="virtual"> + <return type="void" /> + <description> + </description> + </method> + <method name="_validate" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="script" type="String" /> + <argument index="1" name="path" type="String" /> + <argument index="2" name="validate_functions" type="bool" /> + <argument index="3" name="validate_errors" type="bool" /> + <argument index="4" name="validate_warnings" type="bool" /> + <argument index="5" name="validate_safe_lines" type="bool" /> + <description> + </description> + </method> + <method name="_validate_path" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + </methods> + <constants> + <constant name="LOOKUP_RESULT_SCRIPT_LOCATION" value="0" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS" value="1" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_CONSTANT" value="2" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_PROPERTY" value="3" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_METHOD" value="4" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_SIGNAL" value="5" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_ENUM" value="6" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE" value="7" enum="LookupResultType"> + </constant> + <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. + </constant> + <constant name="LOCATION_PARENT_MASK" value="256" enum="CodeCompletionLocation"> + The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in a the class or a parent class. + </constant> + <constant name="LOCATION_OTHER_USER_CODE" value="512" enum="CodeCompletionLocation"> + The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). + </constant> + <constant name="LOCATION_OTHER" value="1024" enum="CodeCompletionLocation"> + The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. + </constant> + <constant name="CODE_COMPLETION_KIND_CLASS" value="0" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_FUNCTION" value="1" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_SIGNAL" value="2" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_VARIABLE" value="3" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_MEMBER" value="4" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_ENUM" value="5" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_CONSTANT" value="6" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_NODE_PATH" value="7" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_FILE_PATH" value="8" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_PLAIN_TEXT" value="9" enum="CodeCompletionKind"> + </constant> + <constant name="CODE_COMPLETION_KIND_MAX" value="10" enum="CodeCompletionKind"> + </constant> + </constants> +</class> diff --git a/doc/classes/ScrollBar.xml b/doc/classes/ScrollBar.xml index 266787c9c8..d0dd69408e 100644 --- a/doc/classes/ScrollBar.xml +++ b/doc/classes/ScrollBar.xml @@ -12,8 +12,6 @@ <member name="custom_step" type="float" setter="set_custom_step" getter="get_custom_step" default="-1.0"> Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> - <member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="0.0" /> </members> <signals> <signal name="scrolling"> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index ea1d972d14..1bbf5cb91b 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -5,10 +5,11 @@ </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.rect_min_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> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="ensure_control_visible"> @@ -40,13 +41,13 @@ </method> </methods> <members> + <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" default="false"> If [code]true[/code], the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. </member> <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" enum="ScrollContainer.ScrollMode" default="1"> Controls whether horizontal scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. </member> - <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="scroll_deadzone" type="int" setter="set_deadzone" getter="get_deadzone" default="0"> </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> diff --git a/doc/classes/SegmentShape2D.xml b/doc/classes/SegmentShape2D.xml index 8109886262..a1809301e5 100644 --- a/doc/classes/SegmentShape2D.xml +++ b/doc/classes/SegmentShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SegmentShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Segment shape for 2D collisions. + Segment shape resource for 2D physics. </brief_description> <description> - Segment shape for 2D collisions. Consists of two points, [code]a[/code] and [code]b[/code]. + 2D segment shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. Consists of two points, [code]a[/code] and [code]b[/code]. + [b]Performance:[/b] Being a primitive collision shape, [SegmentShape2D] is fast to check collisions against (though not as fast as [CircleShape2D]). </description> <tutorials> </tutorials> diff --git a/doc/classes/SeparationRayShape2D.xml b/doc/classes/SeparationRayShape2D.xml index 3e7a2857bf..d67c7b4cd9 100644 --- a/doc/classes/SeparationRayShape2D.xml +++ b/doc/classes/SeparationRayShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SeparationRayShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Separation ray shape for 2D collisions. + Separation ray shape resource for 2D physics. </brief_description> <description> - Separation ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + 2D separation ray shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + [b]Performance:[/b] Being a primitive collision shape, [SeparationRayShape2D] is fast to check collisions against. </description> <tutorials> </tutorials> diff --git a/doc/classes/SeparationRayShape3D.xml b/doc/classes/SeparationRayShape3D.xml index 028c3ba511..0fb4a07457 100644 --- a/doc/classes/SeparationRayShape3D.xml +++ b/doc/classes/SeparationRayShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SeparationRayShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Separation ray shape for 3D collisions. + Separation ray shape resource for 3D physics. </brief_description> <description> - Separation ray shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + 3D separation ray shape to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + [b]Performance:[/b] Being a primitive collision shape, [SeparationRayShape3D] is fast to check collisions against. </description> <tutorials> </tutorials> diff --git a/doc/classes/ShaderInclude.xml b/doc/classes/ShaderInclude.xml new file mode 100644 index 0000000000..40072a933b --- /dev/null +++ b/doc/classes/ShaderInclude.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ShaderInclude" inherits="Resource" 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="code" type="String" setter="set_code" getter="get_code" default=""""> + </member> + </members> +</class> diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 03ff3cc188..94fb2d7dc7 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -26,7 +26,9 @@ <argument index="1" name="with_shape" type="Shape2D" /> <argument index="2" name="shape_xform" type="Transform2D" /> <description> - Returns a list of the points where this shape touches another. If there are no collisions the list is empty. + Returns a list of contact point pairs where this shape touches another. + If there are no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of [code]with_shape[/code]. + A collision pair A, B can be used to calculate the collision normal with [code](B - A).normalized()[/code], and the collision depth with [code](B - A).length()[/code]. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]). </description> </method> @@ -50,7 +52,9 @@ <argument index="3" name="shape_xform" type="Transform2D" /> <argument index="4" name="shape_motion" type="Vector2" /> <description> - Returns a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions the list is empty. + Returns a list of contact point pairs where this shape would touch another, if a given movement was applied. + If there would be no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of [code]with_shape[/code]. + A collision pair A, B can be used to calculate the collision normal with [code](B - A).normalized()[/code], and the collision depth with [code](B - A).length()[/code]. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]). </description> </method> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 1b67900607..049e7f8777 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -6,6 +6,8 @@ <description> </description> <tutorials> + <link title="Using Signals">$DOCS_URL/getting_started/step_by_step/signals.html</link> + <link title="GDScript Basics">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#signals</link> </tutorials> <constructors> <constructor name="Signal"> @@ -99,22 +101,12 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Signal" /> <description> </description> </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Signal" /> <description> </description> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 80a36acacc..6295724aa2 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -111,6 +111,14 @@ <return type="Transform3D" /> <argument index="0" name="bone_idx" type="int" /> <description> + Returns the global pose override transform for [code]bone_idx[/code]. + </description> + </method> + <method name="get_bone_global_rest" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the global rest transform for [code]bone_idx[/code]. </description> </method> <method name="get_bone_local_pose_override" qualifiers="const"> @@ -384,6 +392,10 @@ <members> <member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true"> </member> + <member name="motion_scale" type="float" setter="set_motion_scale" getter="get_motion_scale" default="1.0"> + Multiplies the position 3D track animation. + [b]Note:[/b] Unless this value is [code]1.0[/code], the key value in animation will not match the actual position value. + </member> <member name="show_rest_only" type="bool" setter="set_show_rest_only" getter="is_show_rest_only" default="false"> </member> </members> diff --git a/doc/classes/SkeletonProfile.xml b/doc/classes/SkeletonProfile.xml new file mode 100644 index 0000000000..5c2d0eefb4 --- /dev/null +++ b/doc/classes/SkeletonProfile.xml @@ -0,0 +1,193 @@ +<?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> + <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" default="&"""> + A name of bone that will be used as the root bone in [AnimationTree]. + [b]Note:[/b] In most cases, it is the bone of the parent of the hips that exists at the world origin in the humanoid model. + </member> + <member name="scale_base_bone" type="StringName" setter="set_scale_base_bone" getter="get_scale_base_bone" default="&"""> + A name of bone which height will be used as the coefficient for normalization. + [b]Note:[/b] In most cases, it is hips in the humanoid model. + </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..11f0521718 --- /dev/null +++ b/doc/classes/SkeletonProfileHumanoid.xml @@ -0,0 +1,16 @@ +<?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" /> + <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" overrides="SkeletonProfile" default="&"Root"" /> + <member name="scale_base_bone" type="StringName" setter="set_scale_base_bone" getter="get_scale_base_bone" overrides="SkeletonProfile" default="&"Hips"" /> + </members> +</class> diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml index 03f20b0aab..4139530db1 100644 --- a/doc/classes/Slider.xml +++ b/doc/classes/Slider.xml @@ -13,11 +13,9 @@ <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true"> If [code]true[/code], the slider can be interacted with. If [code]false[/code], the value can be changed only by code. </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> <member name="scrollable" type="bool" setter="set_scrollable" getter="is_scrollable" default="true"> If [code]true[/code], the value can be changed using the mouse wheel. </member> - <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="0" /> <member name="tick_count" type="int" setter="set_ticks" getter="get_ticks" default="0"> Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. </member> diff --git a/doc/classes/SphereMesh.xml b/doc/classes/SphereMesh.xml index d0549d6b52..28c9704626 100644 --- a/doc/classes/SphereMesh.xml +++ b/doc/classes/SphereMesh.xml @@ -9,7 +9,7 @@ <tutorials> </tutorials> <members> - <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> + <member name="height" type="float" setter="set_height" getter="get_height" default="1.0"> Full height of the sphere. </member> <member name="is_hemisphere" type="bool" setter="set_is_hemisphere" getter="get_is_hemisphere" default="false"> @@ -19,7 +19,7 @@ <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="64"> Number of radial segments on the sphere. </member> - <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"> Radius of sphere. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" default="32"> diff --git a/doc/classes/SphereShape3D.xml b/doc/classes/SphereShape3D.xml index b5e9c9069b..b4713b1d41 100644 --- a/doc/classes/SphereShape3D.xml +++ b/doc/classes/SphereShape3D.xml @@ -1,16 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SphereShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Sphere shape for 3D collisions. + Sphere shape resource for 3D collisions. </brief_description> <description> - Sphere shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. This shape is useful for modeling sphere-like 3D objects. + 3D sphere shape to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. This shape is useful for modeling sphere-like 3D objects. + [b]Performance:[/b] Being a primitive collision shape, [SphereShape3D] is the fastest collision shape to check collisions against, as it only requires a distance check with the shape's origin. </description> <tutorials> <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/SpinBox.xml b/doc/classes/SpinBox.xml index 5e3eb0c9f8..e84f9c38ff 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -25,6 +25,7 @@ The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. See [Range] class for more options over the [SpinBox]. [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. + [b]Note:[/b] If you want to implement drag and drop for the underlying [LineEdit], you can use [method Control.set_drag_forwarding] on the node returned by [method get_line_edit]. </description> <tutorials> </tutorials> diff --git a/doc/classes/SplitContainer.xml b/doc/classes/SplitContainer.xml index b2fcd46731..f2bc65f8df 100644 --- a/doc/classes/SplitContainer.xml +++ b/doc/classes/SplitContainer.xml @@ -7,6 +7,7 @@ Container for splitting two [Control]s vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="clamp_split_offset"> diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index 405fff0ce8..bc381578d9 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -53,6 +53,9 @@ <member name="double_sided" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="true"> If [code]true[/code], texture can be seen from the back as well, if [code]false[/code], it is invisible when looking at it from behind. </member> + <member name="fixed_size" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> + If [code]true[/code], the label is rendered at the same size regardless of distance. + </member> <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false"> If [code]true[/code], texture is flipped horizontally. </member> @@ -63,15 +66,26 @@ A color value used to [i]multiply[/i] the texture's colors. Can be used for mood-coloring or to simulate the color of light. [b]Note:[/b] If a [member GeometryInstance3D.material_override] is defined on the [SpriteBase3D], the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in [member modulate] will be ignored. For a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] must be [code]true[/code]. For a [ShaderMaterial], [code]ALBEDO *= COLOR.rgb;[/code] must be inserted in the shader's [code]fragment()[/code] function. </member> + <member name="no_depth_test" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> + If [code]true[/code], depth testing is disabled and the object will be drawn in render order. + </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </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 sprite to scale it in 3D. </member> + <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> + Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects. + [b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). + [b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + </member> <member name="shaded" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false"> If [code]true[/code], the [Light3D] in the [Environment] has effects on the sprite. </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 BaseMaterial3D.TextureFilter] for options. + </member> <member name="transparent" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="true"> If [code]true[/code], the texture's transparency and the opacity are used to make those parts of the sprite invisible. </member> @@ -86,7 +100,13 @@ <constant name="FLAG_DOUBLE_SIDED" value="2" enum="DrawFlags"> If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind. </constant> - <constant name="FLAG_MAX" value="3" enum="DrawFlags"> + <constant name="FLAG_DISABLE_DEPTH_TEST" value="3" enum="DrawFlags"> + Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + </constant> + <constant name="FLAG_FIXED_SIZE" value="4" enum="DrawFlags"> + Label is scaled by depth so that it always appears the same size on screen. + </constant> + <constant name="FLAG_MAX" value="5" enum="DrawFlags"> Represents the size of the [enum DrawFlags] enum. </constant> <constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode"> 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/StreamCubemap.xml b/doc/classes/StreamCubemap.xml deleted file mode 100644 index 61ab28ad41..0000000000 --- a/doc/classes/StreamCubemap.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamCubemap" inherits="StreamTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> -</class> diff --git a/doc/classes/StreamCubemapArray.xml b/doc/classes/StreamCubemapArray.xml deleted file mode 100644 index 98e10d9a47..0000000000 --- a/doc/classes/StreamCubemapArray.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamCubemapArray" inherits="StreamTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </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/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml index a1f1f1be79..f06cf5c7a2 100644 --- a/doc/classes/StreamPeerTCP.xml +++ b/doc/classes/StreamPeerTCP.xml @@ -51,16 +51,16 @@ Returns the local port to which this peer is bound. </description> </method> - <method name="get_status"> + <method name="get_status" qualifiers="const"> <return type="int" enum="StreamPeerTCP.Status" /> <description> Returns the status of the connection, see [enum Status]. </description> </method> - <method name="is_connected_to_host" qualifiers="const"> - <return type="bool" /> + <method name="poll"> + <return type="int" enum="Error" /> <description> - Returns [code]true[/code] if this peer is currently connected or is connecting to a host, [code]false[/code] otherwise. + Poll the socket, updating its state. See [method get_status]. </description> </method> <method name="set_no_delay"> diff --git a/doc/classes/StreamTexture2DArray.xml b/doc/classes/StreamTexture2DArray.xml deleted file mode 100644 index e78a23416c..0000000000 --- a/doc/classes/StreamTexture2DArray.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamTexture2DArray" inherits="StreamTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> -</class> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index c1a7a2edda..9f197dae02 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -49,7 +49,10 @@ <method name="bigrams" qualifiers="const"> <return type="PackedStringArray" /> <description> - Returns the bigrams (pairs of consecutive letters) of this string. + Returns an array containing the bigrams (pairs of consecutive letters) of this string. + [codeblock] + print("Bigrams".bigrams()) # Prints "[Bi, ig, gr, ra, am, ms]" + [/codeblock] </description> </method> <method name="bin_to_int" qualifiers="const"> @@ -101,6 +104,11 @@ <return type="String" /> <argument index="0" name="char" type="int" /> <description> + Directly converts an decimal integer to a unicode character. Tables of these characters can be found in various locations, for example [url=https://unicodelookup.com/]here.[/url] + [codeblock] + print(String.chr(65)) # Prints "A" + print(String.chr(129302)) # Prints "🤖" (robot face emoji) + [/codeblock] </description> </method> <method name="contains" qualifiers="const"> @@ -172,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"> @@ -265,6 +288,8 @@ <return type="String" /> <argument index="0" name="size" type="int" /> <description> + Converts an integer representing a number of bytes into a human-readable form. + Note that this output is in [url=https://en.wikipedia.org/wiki/Binary_prefix#IEC_prefixes]IEC prefix format[/url], and includes [code]B[/code], [code]KiB[/code], [code]MiB[/code], [code]GiB[/code], [code]TiB[/code], [code]PiB[/code], and [code]EiB[/code]. </description> </method> <method name="indent" qualifiers="const"> @@ -326,7 +351,13 @@ <method name="is_valid_float" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if this string contains a valid float. + Returns [code]true[/code] if this string contains a valid float. This is inclusive of integers, and also supports exponents: + [codeblock] + print("1.7".is_valid_float()) # Prints "true" + print("24".is_valid_float()) # Prints "true" + print("7e3".is_valid_float()) # Prints "true" + print("Hello".is_valid_float()) # Prints "false" + [/codeblock] </description> </method> <method name="is_valid_hex_number" qualifiers="const"> @@ -346,12 +377,24 @@ <return type="bool" /> <description> Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores ([code]_[/code]) and the first character may not be a digit. + [codeblock] + print("good_ident_1".is_valid_identifier()) # Prints "true" + print("1st_bad_ident".is_valid_identifier()) # Prints "false" + print("bad_ident_#2".is_valid_identifier()) # Prints "false" + [/codeblock] </description> </method> <method name="is_valid_int" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this string contains a valid integer. + [codeblock] + print("7".is_valid_int()) # Prints "true" + print("14.6".is_valid_int()) # Prints "false" + print("L".is_valid_int()) # Prints "false" + print("+3".is_valid_int()) # Prints "true" + print("-12".is_valid_int()) # Prints "true" + [/codeblock] </description> </method> <method name="is_valid_ip_address" qualifiers="const"> @@ -384,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" @@ -420,14 +463,14 @@ <return type="bool" /> <argument index="0" name="expr" type="String" /> <description> - Does a simple case-sensitive expression match, where [code]"*"[/code] matches zero or more arbitrary characters and [code]"?"[/code] matches any single character except a period ([code]"."[/code]). + Does a simple case-sensitive expression match, where [code]"*"[/code] matches zero or more arbitrary characters and [code]"?"[/code] matches any single character except a period ([code]"."[/code]). An empty string or empty expression always evaluates to [code]false[/code]. </description> </method> <method name="matchn" qualifiers="const"> <return type="bool" /> <argument index="0" name="expr" type="String" /> <description> - Does a simple case-insensitive expression match, where [code]"*"[/code] matches zero or more arbitrary characters and [code]"?"[/code] matches any single character except a period ([code]"."[/code]). + Does a simple case-insensitive expression match, where [code]"*"[/code] matches zero or more arbitrary characters and [code]"?"[/code] matches any single character except a period ([code]"."[/code]). An empty string or empty expression always evaluates to [code]false[/code]. </description> </method> <method name="md5_buffer" qualifiers="const"> @@ -485,12 +528,30 @@ [/codeblock] </description> </method> + <method name="num_int64" qualifiers="static"> + <return type="String" /> + <argument index="0" name="number" type="int" /> + <argument index="1" name="base" type="int" default="10" /> + <argument index="2" name="capitalize_hex" type="bool" default="false" /> + <description> + Converts a signed [int] to a string representation of a number. + </description> + </method> <method name="num_scientific" qualifiers="static"> <return type="String" /> <argument index="0" name="number" type="float" /> <description> </description> </method> + <method name="num_uint64" qualifiers="static"> + <return type="String" /> + <argument index="0" name="number" type="int" /> + <argument index="1" name="base" type="int" default="10" /> + <argument index="2" name="capitalize_hex" type="bool" default="false" /> + <description> + Converts a unsigned [int] to a string representation of a number. + </description> + </method> <method name="pad_decimals" qualifiers="const"> <return type="String" /> <argument index="0" name="digits" type="int" /> @@ -553,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" @@ -586,8 +647,8 @@ var some_string = "One,Two,Three,Four" var some_array = some_string.rsplit(",", true, 1) print(some_array.size()) # Prints 2 - print(some_array[0]) # Prints "Four" - print(some_array[1]) # Prints "Three,Two,One" + print(some_array[0]) # Prints "One,Two,Three" + print(some_array[1]) # Prints "Four" [/gdscript] [csharp] // There is no Rsplit. @@ -631,7 +692,13 @@ <return type="float" /> <argument index="0" name="text" type="String" /> <description> - Returns the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar. + Returns the similarity index ([url=https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient]Sorensen-Dice coefficient[/url]) of this string compared to another. A result of 1.0 means totally similar, while 0.0 means totally dissimilar. + [codeblock] + print("ABC123".similarity("ABC123")) # Prints "1" + print("ABC123".similarity("XYZ456")) # Prints "0" + print("ABC123".similarity("123ABC")) # Prints "0.8" + print("ABC123".similarity("abc123")) # Prints "0.4" + [/codeblock] </description> </method> <method name="simplify_path" qualifiers="const"> @@ -830,11 +897,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="String" /> <description> </description> @@ -857,20 +919,21 @@ <description> </description> </operator> - <operator name="operator <"> - <return type="bool" /> - <argument index="0" name="right" type="String" /> + <operator name="operator +"> + <return type="String" /> + <argument index="0" name="right" type="int" /> <description> </description> </operator> - <operator name="operator <="> + <operator name="operator <"> <return type="bool" /> <argument index="0" name="right" type="String" /> <description> </description> </operator> - <operator name="operator =="> + <operator name="operator <="> <return type="bool" /> + <argument index="0" name="right" type="String" /> <description> </description> </operator> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index c19fce9944..a2bcac9788 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -4,7 +4,9 @@ An optimized string type for unique names. </brief_description> <description> - [StringName]s are immutable strings designed for general-purpose representation of unique names. [StringName] ensures that only one instance of a given name exists (so two [StringName]s with the same value are the same object). Comparing them is much faster than with regular [String]s, because only the pointers are compared, not the whole strings. + [StringName]s are immutable strings designed for general-purpose representation of unique names (also called "string interning"). [StringName] ensures that only one instance of a given name exists (so two [StringName]s with the same value are the same object). Comparing them is much faster than with regular [String]s, because only the pointers are compared, not the whole strings. + You will usually just pass a [String] to methods expecting a [StringName] and it will be automatically converted, but you may occasionally want to construct a [StringName] ahead of time with [StringName] or the literal syntax [code]&"example"[/code]. + See also [NodePath], which is a similar concept specifically designed to store pre-parsed node paths. </description> <tutorials> </tutorials> @@ -26,16 +28,19 @@ <return type="StringName" /> <argument index="0" name="from" type="String" /> <description> - Creates a new [StringName] from the given [String]. + Creates a new [StringName] from the given [String]. [code]StringName("example")[/code] is equivalent to [code]&"example"[/code]. </description> </constructor> </constructors> - <operators> - <operator name="operator !="> - <return type="bool" /> + <methods> + <method name="hash" qualifiers="const"> + <return type="int" /> <description> + Returns the 32-bit hash value representing the [StringName]'s contents. </description> - </operator> + </method> + </methods> + <operators> <operator name="operator !="> <return type="bool" /> <argument index="0" name="right" type="String" /> @@ -62,11 +67,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="String" /> <description> </description> diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index f805692f4d..d863e3c652 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -10,13 +10,44 @@ <tutorials> </tutorials> <methods> + <method name="_draw" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="to_canvas_item" type="RID" /> + <argument index="1" name="rect" type="Rect2" /> + <description> + </description> + </method> + <method name="_get_center_size" qualifiers="virtual const"> + <return type="Vector2" /> + <description> + </description> + </method> + <method name="_get_draw_rect" qualifiers="virtual const"> + <return type="Rect2" /> + <argument index="0" name="rect" type="Rect2" /> + <description> + </description> + </method> + <method name="_get_style_margin" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="side" type="int" enum="Side" /> + <description> + </description> + </method> + <method name="_test_mask" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="point" type="Vector2" /> + <argument index="1" name="rect" type="Rect2" /> + <description> + </description> + </method> <method name="draw" qualifiers="const"> <return type="void" /> <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"> @@ -76,21 +107,21 @@ </method> </methods> <members> - <member name="content_margin_bottom" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_bottom" type="float" setter="set_default_margin" getter="get_default_margin"> The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. If this value is negative, it is ignored and a child-specific margin is used instead. For example for [StyleBoxFlat] the border thickness (if any) is used instead. It is up to the code using this style box to decide what these contents are: for example, a [Button] respects this content margin for the textual contents of the button. [method get_margin] should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. </member> - <member name="content_margin_left" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_left" type="float" setter="set_default_margin" getter="get_default_margin"> The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. Refer to [member content_margin_bottom] for extra considerations. </member> - <member name="content_margin_right" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_right" type="float" setter="set_default_margin" getter="get_default_margin"> The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. Refer to [member content_margin_bottom] for extra considerations. </member> - <member name="content_margin_top" type="float" setter="set_default_margin" getter="get_default_margin" default="-1.0"> + <member name="content_margin_top" type="float" setter="set_default_margin" getter="get_default_margin"> The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. Refer to [member content_margin_bottom] for extra considerations. </member> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 20430f3205..c80f8dcbb1 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -119,7 +119,7 @@ </methods> <members> <member name="anti_aliasing" type="bool" setter="set_anti_aliased" getter="is_anti_aliased" default="true"> - Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners. + Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners or [member skew]. [b]Note:[/b] When using beveled corners with 45-degree angles ([member corner_detail] = 1), it is recommended to set [member anti_aliasing] to [code]false[/code] to ensure crisp visuals and avoid possible visual glitches. </member> <member name="anti_aliasing_size" type="float" setter="set_aa_size" getter="get_aa_size" default="0.625"> @@ -168,15 +168,19 @@ </member> <member name="expand_margin_bottom" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with [member border_width_bottom] to draw a border outside the control rect. + [b]Note:[/b] Unlike [member StyleBox.content_margin_bottom], [member expand_margin_bottom] does [i]not[/i] affect the size of the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. </member> <member name="expand_margin_left" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the stylebox outside of the control rect on the left edge. Useful in combination with [member border_width_left] to draw a border outside the control rect. + [b]Note:[/b] Unlike [member StyleBox.content_margin_left], [member expand_margin_left] does [i]not[/i] affect the size of the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. </member> <member name="expand_margin_right" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the stylebox outside of the control rect on the right edge. Useful in combination with [member border_width_right] to draw a border outside the control rect. + [b]Note:[/b] Unlike [member StyleBox.content_margin_right], [member expand_margin_right] does [i]not[/i] affect the size of the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. </member> <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin" default="0.0"> Expands the stylebox outside of the control rect on the top edge. Useful in combination with [member border_width_top] to draw a border outside the control rect. + [b]Note:[/b] Unlike [member StyleBox.content_margin_top], [member expand_margin_top] does [i]not[/i] affect the size of the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color(0, 0, 0, 0.6)"> The color of the shadow. This has no effect if [member shadow_size] is lower than 1. @@ -187,5 +191,9 @@ <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" default="0"> The shadow size in pixels. </member> + <member name="skew" type="Vector2" setter="set_skew" getter="get_skew" default="Vector2(0, 0)"> + If set to a non-zero value on either axis, [member skew] distorts the StyleBox horizontally and/or vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left (X axis) and downwards (Y axis). + [b]Note:[/b] To ensure text does not touch the StyleBox's edges, consider increasing the [StyleBox]'s content margin (see [member StyleBox.content_margin_bottom]). It is preferable to increase the content margin instead of the expand margin (see [member expand_margin_bottom]), as increasing the expand margin does not increase the size of the clickable area for [Control]s. + </member> </members> </class> diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml index c439c1d016..b62c294f2c 100644 --- a/doc/classes/SubViewport.xml +++ b/doc/classes/SubViewport.xml @@ -4,6 +4,7 @@ Creates a sub-view into the screen. </brief_description> <description> + [SubViewport] is a [Viewport] that isn't a [Window], i.e. it doesn't draw anything by itself. To display something, [SubViewport]'s [member size] must be non-zero and it should be either put inside a [SubViewportContainer] or assigned to a [ViewportTexture]. </description> <tutorials> <link title="Using Viewports">$DOCS_URL/tutorials/rendering/viewports.html</link> diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml index 050186a883..77aa7e3ff4 100644 --- a/doc/classes/SubViewportContainer.xml +++ b/doc/classes/SubViewportContainer.xml @@ -4,15 +4,15 @@ Control for holding [SubViewport]s. </brief_description> <description> - A [Container] node that holds a [SubViewport], automatically setting its size. - [b]Note:[/b] Changing a SubViewportContainer's [member Control.rect_scale] will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). + A [Container] node that holds a [SubViewport]. It uses the [SubViewport]'s size as minimum size, unless [member stretch] is enabled. + [b]Note:[/b] Changing a SubViewportContainer's [member Control.scale] will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). [b]Note:[/b] The SubViewportContainer forwards mouse-enter and mouse-exit notifications to its sub-viewports. </description> <tutorials> </tutorials> <members> <member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled" default="false"> - If [code]true[/code], the sub-viewport will be scaled to the control's size. + If [code]true[/code], the sub-viewport will be automatically resized to the control's size. </member> <member name="stretch_shrink" type="int" setter="set_stretch_shrink" getter="get_stretch_shrink" default="1"> Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 9d0962f337..ad638a680b 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -11,14 +11,14 @@ st.begin(Mesh.PRIMITIVE_TRIANGLES) st.set_color(Color(1, 0, 0)) st.set_uv(Vector2(0, 0)) - st.set_vertex(Vector3(0, 0, 0)) + st.add_vertex(Vector3(0, 0, 0)) [/gdscript] [csharp] var st = new SurfaceTool(); st.Begin(Mesh.PrimitiveType.Triangles); st.SetColor(new Color(1, 0, 0)); st.SetUv(new Vector2(0, 0)); - st.SetVertex(new Vector3(0, 0, 0)); + st.AddVertex(new Vector3(0, 0, 0)); [/csharp] [/codeblocks] The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method set_uv] or [method set_color], then the last values would be used. @@ -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/SystemFont.xml b/doc/classes/SystemFont.xml new file mode 100644 index 0000000000..b1b78f1705 --- /dev/null +++ b/doc/classes/SystemFont.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SystemFont" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Font loaded from a system font. + [b]Note:[/b] This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font. + </brief_description> + <description> + [SystemFont] loads a font from a system font with the first matching name from [member font_names]. + It will attempt to match font style, but it's not guaranteed. + The returned font might be part of a font collection or be a variable font with OpenType "weight" and/or "italic" features set. + You can create [FontVariation] of the system font for fine control over its features. + </description> + <tutorials> + </tutorials> + <members> + <member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true"> + If set to [code]true[/code], font 8-bit anitialiased glyph rendering is supported and enabled. + </member> + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. + </member> + <member name="font_names" type="PackedStringArray" setter="set_font_names" getter="get_font_names" default="PackedStringArray()"> + Array of font family names to search, first matching font found is used. + </member> + <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"> + If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. + </member> + <member name="generate_mipmaps" type="bool" setter="set_generate_mipmaps" getter="get_generate_mipmaps" default="false"> + If set to [code]true[/code], generate mipmaps for the font textures. + </member> + <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="1"> + Font hinting mode. + </member> + <member name="oversampling" type="float" setter="set_oversampling" getter="get_oversampling" default="0.0"> + Font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. + </member> + <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> + </members> +</class> diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index 40d6e9f26c..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" /> @@ -57,6 +50,13 @@ Returns the [Texture2D] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture2D]. </description> </method> + <method name="get_tab_idx_at_point" qualifiers="const"> + <return type="int" /> + <argument index="0" name="point" type="Vector2" /> + <description> + Returns the index of the tab at local coordinates [code]point[/code]. Returns [code]-1[/code] if the point is outside the control boundaries or if there's no tab at the queried position. + </description> + </method> <method name="get_tab_language" qualifiers="const"> <return type="String" /> <argument index="0" name="tab_idx" type="int" /> @@ -70,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" /> @@ -99,12 +91,6 @@ Returns the title of the tab at index [code]tab_idx[/code]. </description> </method> - <method name="get_tabs_rearrange_group" qualifiers="const"> - <return type="int" /> - <description> - Returns the [TabBar]'s rearrange group ID. - </description> - </method> <method name="is_tab_disabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="tab_idx" type="int" /> @@ -174,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" /> @@ -199,13 +176,6 @@ Sets a [code]title[/code] for the tab at index [code]tab_idx[/code]. </description> </method> - <method name="set_tabs_rearrange_group"> - <return type="void" /> - <argument index="0" name="group_id" type="int" /> - <description> - Defines the rearrange group ID. Choose for each [TabBar] the same value to dragging tabs between [TabBar]. Enable drag with [member drag_to_rearrange_enabled]. - </description> - </method> </methods> <members> <member name="clip_tabs" type="bool" setter="set_clip_tabs" getter="get_clip_tabs" default="true"> @@ -217,6 +187,9 @@ <member name="drag_to_rearrange_enabled" type="bool" setter="set_drag_to_rearrange_enabled" getter="get_drag_to_rearrange_enabled" default="false"> If [code]true[/code], tabs can be rearranged with mouse drag. </member> + <member name="max_tab_width" type="int" setter="set_max_tab_width" getter="get_max_tab_width" default="0"> + Sets the maximum width which all tabs should be limited to. Unlimited if set to [code]0[/code]. + </member> <member name="scroll_to_selected" type="bool" setter="set_scroll_to_selected" getter="get_scroll_to_selected" default="true"> If [code]true[/code], the tab offset will be changed to keep the the currently selected tab visible. </member> @@ -226,7 +199,7 @@ <member name="select_with_rmb" type="bool" setter="set_select_with_rmb" getter="get_select_with_rmb" default="false"> If [code]true[/code], enables selecting a tab with the right mouse button. </member> - <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabBar.AlignmentMode" default="1"> + <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabBar.AlignmentMode" default="0"> Sets the position at which tabs will be placed. See [enum AlignmentMode] for details. </member> <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="TabBar.CloseButtonDisplayPolicy" default="0"> @@ -235,6 +208,10 @@ <member name="tab_count" type="int" setter="set_tab_count" getter="get_tab_count" default="0"> The number of tabs currently in the bar. </member> + <member name="tabs_rearrange_group" type="int" setter="set_tabs_rearrange_group" getter="get_tabs_rearrange_group" default="-1"> + [TabBar]s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with [member drag_to_rearrange_enabled]. + Setting this to [code]-1[/code] will disable rearranging between [TabBar]s. + </member> </members> <signals> <signal name="active_tab_rearranged"> @@ -322,6 +299,9 @@ </constant> </constants> <theme_items> + <theme_item name="drop_mark_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + Modulation color for the [theme_item drop_mark] icon. + </theme_item> <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Font color of disabled tabs. </theme_item> @@ -334,7 +314,7 @@ <theme_item name="font_unselected_color" data_type="color" type="Color" default="Color(0.7, 0.7, 0.7, 1)"> Font color of the other, unselected tabs. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal separation between the elements inside tabs. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> @@ -355,6 +335,9 @@ <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. </theme_item> + <theme_item name="drop_mark" data_type="icon" type="Texture2D"> + Icon shown to indicate where a dragged tab is gonna be dropped (see [member drag_to_rearrange_enabled]). + </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. </theme_item> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 3986983155..10b5f730ad 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -9,6 +9,7 @@ [b]Note:[/b] The drawing of the clickable tabs themselves is handled by this node. Adding [TabBar]s as children is not needed. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="get_current_tab_control" qualifiers="const"> @@ -30,6 +31,13 @@ Returns the previously active tab index. </description> </method> + <method name="get_tab_button_icon" qualifiers="const"> + <return type="Texture2D" /> + <argument index="0" name="tab_idx" type="int" /> + <description> + Returns the button icon from the tab at index [code]tab_idx[/code]. + </description> + </method> <method name="get_tab_control" qualifiers="const"> <return type="Control" /> <argument index="0" name="tab_idx" type="int" /> @@ -43,20 +51,6 @@ Returns the number of tabs. </description> </method> - <method name="get_tab_disabled" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="tab_idx" type="int" /> - <description> - Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled. - </description> - </method> - <method name="get_tab_hidden" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="tab_idx" type="int" /> - <description> - Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is hidden. - </description> - </method> <method name="get_tab_icon" qualifiers="const"> <return type="Texture2D" /> <argument index="0" name="tab_idx" type="int" /> @@ -71,6 +65,13 @@ Returns the index of the tab at local coordinates [code]point[/code]. Returns [code]-1[/code] if the point is outside the control boundaries or if there's no tab at the queried position. </description> </method> + <method name="get_tab_idx_from_control" qualifiers="const"> + <return type="int" /> + <argument index="0" name="control" type="Control" /> + <description> + Returns the index of the tab tied to the given [code]control[/code]. The control must be a child of the [TabContainer]. + </description> + </method> <method name="get_tab_title" qualifiers="const"> <return type="String" /> <argument index="0" name="tab_idx" type="int" /> @@ -78,17 +79,33 @@ Returns the title of the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title]. </description> </method> - <method name="get_tabs_rearrange_group" qualifiers="const"> - <return type="int" /> + <method name="is_tab_disabled" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="tab_idx" type="int" /> <description> - Returns the [TabContainer] rearrange group id. + Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled. + </description> + </method> + <method name="is_tab_hidden" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="tab_idx" type="int" /> + <description> + Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is hidden. </description> </method> <method name="set_popup"> <return type="void" /> <argument index="0" name="popup" type="Node" /> <description> - If set on a [Popup] node instance, a popup menu icon appears in the top-right corner of the [TabContainer]. Clicking it will expand the [Popup] node. + If set on a [Popup] node instance, a popup menu icon appears in the top-right corner of the [TabContainer] (setting it to [code]null[/code] will make it go away). Clicking it will expand the [Popup] node. + </description> + </method> + <method name="set_tab_button_icon"> + <return type="void" /> + <argument index="0" name="tab_idx" type="int" /> + <argument index="1" name="icon" type="Texture2D" /> + <description> + Sets the button icon from the tab at index [code]tab_idx[/code]. </description> </method> <method name="set_tab_disabled"> @@ -120,14 +137,7 @@ <argument index="0" name="tab_idx" type="int" /> <argument index="1" name="title" type="String" /> <description> - Sets a title for the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node. - </description> - </method> - <method name="set_tabs_rearrange_group"> - <return type="void" /> - <argument index="0" name="group_id" type="int" /> - <description> - Defines rearrange group id, choose for each [TabContainer] the same value to enable tab drag between [TabContainer]. Enable drag with [member drag_to_rearrange_enabled]. + Sets a custom title for the tab at index [code]tab_idx[/code] (tab titles default to the name of the indexed child node). Set it back to the child's name to make the tab default to it again. </description> </method> </methods> @@ -135,13 +145,21 @@ <member name="all_tabs_in_front" type="bool" setter="set_all_tabs_in_front" getter="is_all_tabs_in_front" default="false"> If [code]true[/code], all tabs are drawn in front of the panel. If [code]false[/code], inactive tabs are drawn behind the panel. </member> + <member name="clip_tabs" type="bool" setter="set_clip_tabs" getter="get_clip_tabs" default="true"> + If [code]true[/code], tabs overflowing this node's width will be hidden, displaying two navigation buttons instead. Otherwise, this node's minimum size is updated so that all tabs are visible. + </member> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" default="0"> The current tab index. When set, this index's [Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code]. </member> <member name="drag_to_rearrange_enabled" type="bool" setter="set_drag_to_rearrange_enabled" getter="get_drag_to_rearrange_enabled" default="false"> If [code]true[/code], tabs can be rearranged with mouse drag. </member> - <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabContainer.AlignmentMode" default="1"> + <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabBar.AlignmentMode" default="0"> + Sets the position at which tabs will be placed. See [enum TabBar.AlignmentMode] for details. + </member> + <member name="tabs_rearrange_group" type="int" setter="set_tabs_rearrange_group" getter="get_tabs_rearrange_group" default="-1"> + [TabContainer]s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with [member drag_to_rearrange_enabled]. + Setting this to [code]-1[/code] will disable rearranging between [TabContainer]s. </member> <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" default="true"> If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden. @@ -156,6 +174,12 @@ Emitted when the [TabContainer]'s [Popup] button is clicked. See [method set_popup] for details. </description> </signal> + <signal name="tab_button_pressed"> + <argument index="0" name="tab" type="int" /> + <description> + Emitted when the user clicks on the button icon on this tab. + </description> + </signal> <signal name="tab_changed"> <argument index="0" name="tab" type="int" /> <description> @@ -169,15 +193,10 @@ </description> </signal> </signals> - <constants> - <constant name="ALIGNMENT_LEFT" value="0" enum="AlignmentMode"> - </constant> - <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode"> - </constant> - <constant name="ALIGNMENT_RIGHT" value="2" enum="AlignmentMode"> - </constant> - </constants> <theme_items> + <theme_item name="drop_mark_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + Modulation color for the [theme_item drop_mark] icon. + </theme_item> <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Font color of disabled tabs. </theme_item> @@ -197,7 +216,8 @@ The size of the tab text outline. </theme_item> <theme_item name="side_margin" data_type="constant" type="int" default="8"> - The space at the left and right edges of the tab bar. + The space at the left or right edges of the tab bar, accordingly with the current [member tab_alignment]. + The margin is ignored with [code]ALIGNMENT_RIGHT[/code] if the tabs are clipped (see [member clip_tabs]) or a popup has been set (see [method set_popup]). The margin is always ignored with [code]ALIGNMENT_CENTER[/code]. </theme_item> <theme_item name="font" data_type="font" type="Font"> The font used to draw tab names. @@ -211,6 +231,9 @@ <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. </theme_item> + <theme_item name="drop_mark" data_type="icon" type="Texture2D"> + Icon shown to indicate where a dragged tab is gonna be dropped (see [member drag_to_rearrange_enabled]). + </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. </theme_item> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index a4edaa79c7..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"> @@ -1017,7 +1002,7 @@ <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled. </member> - <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> + <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="[]"> 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 3157eea436..e1b676427b 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -57,7 +57,7 @@ <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <description> - Removes all font sizes from the cache entry + Removes all font sizes from the cache entry. </description> </method> <method name="font_clear_textures"> @@ -80,6 +80,7 @@ <description> Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index]. + [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. </description> </method> <method name="font_draw_glyph_outline" qualifiers="const"> @@ -94,6 +95,7 @@ <description> Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index]. + [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. </description> </method> <method name="font_get_ascent" qualifiers="const"> @@ -112,6 +114,27 @@ Returns the font descent (number of pixels below the baseline). </description> </method> + <method name="font_get_embolden" qualifiers="const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + 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" /> @@ -119,6 +142,13 @@ Returns bitmap font fixed size. </description> </method> + <method name="font_get_generate_mipmaps" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns [code]true[/code] if font texture mipmap generation is enabled. + </description> + </method> <method name="font_get_global_oversampling" qualifiers="const"> <return type="float" /> <description> @@ -192,6 +222,26 @@ Returns index of the cache texture containing the glyph. </description> </method> + <method name="font_get_glyph_texture_rid" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns resource id of the cache texture containing the glyph. + [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. + </description> + </method> + <method name="font_get_glyph_texture_size" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns size of the cache texture containing the glyph. + [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. + </description> + </method> <method name="font_get_glyph_uv_rect" qualifiers="const"> <return type="Rect2" /> <argument index="0" name="font_rid" type="RID" /> @@ -305,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]. @@ -368,6 +409,13 @@ Returns 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="font_get_transform" qualifiers="const"> + <return type="Transform2D" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns 2D transform applied to the font outlines. + </description> + </method> <method name="font_get_underline_position" qualifiers="const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> @@ -485,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> @@ -495,7 +543,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="font_render_range"> @@ -542,6 +590,22 @@ Sets the font descent (number of pixels below the baseline). </description> </method> + <method name="font_set_embolden"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="strength" type="float" /> + <description> + 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" /> @@ -558,6 +622,14 @@ If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> + <method name="font_set_generate_mipmaps"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="generate_mipmaps" type="bool" /> + <description> + If set to [code]true[/code] font texture mipmap generation is enabled. + </description> + </method> <method name="font_set_global_oversampling"> <return type="void" /> <argument index="0" name="oversampling" type="float" /> @@ -711,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> @@ -765,6 +827,15 @@ Sets 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="font_set_transform"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="transform" type="Transform2D" /> + <description> + Sets 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]. + </description> + </method> <method name="font_set_underline_position"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -896,6 +967,15 @@ Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9). </description> </method> + <method name="parse_structured_text" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" /> + <argument index="1" name="args" type="Array" /> + <argument index="2" name="text" type="String" /> + <description> + Default implementation of the BiDi algorithm override function. See [enum StructuredTextParser] for more info. + </description> + </method> <method name="percent_sign" qualifiers="const"> <return type="String" /> <argument index="0" name="language" type="String" default="""" /> @@ -997,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> @@ -1081,7 +1161,7 @@ <return type="Array" /> <argument index="0" name="shaped" type="RID" /> <description> - Returns text glyphs in the visual order. + Returns an array of glyphs in the visual order. </description> </method> <method name="shaped_text_get_grapheme_bounds" qualifiers="const"> @@ -1104,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> @@ -1115,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> @@ -1146,7 +1226,7 @@ <return type="RID" /> <argument index="0" name="shaped" type="RID" /> <description> - Sets text orientation. + Returns the parent buffer from which the substring originates. </description> </method> <method name="shaped_text_get_preserve_control" qualifiers="const"> @@ -1187,11 +1267,19 @@ 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" /> <description> - Returns position of the trim. + Returns the position of the overrun trim. </description> </method> <method name="shaped_text_get_underline_position" qualifiers="const"> @@ -1218,9 +1306,9 @@ <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" /> + <argument index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" default="264" /> <description> - Breaks text into words and returns array of character ranges. + 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> </method> <method name="shaped_text_hit_test_grapheme" qualifiers="const"> @@ -1258,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> @@ -1332,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" /> @@ -1364,6 +1461,14 @@ Aligns shaped text to the given tab-stops. </description> </method> + <method name="string_get_word_breaks" qualifiers="const"> + <return type="PackedInt32Array" /> + <argument index="0" name="string" type="String" /> + <argument index="1" name="language" type="String" default="""" /> + <description> + Returns array of the word break character offsets. + </description> + </method> <method name="string_to_lower" qualifiers="const"> <return type="String" /> <argument index="0" name="string" type="String" /> @@ -1389,6 +1494,7 @@ <argument index="0" name="string" type="String" /> <description> Strips diacritics from the string. + [b]Note:[/b] The result may be longer or shorter than the original. </description> </method> <method name="tag_to_name" qualifiers="const"> @@ -1416,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="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_NO_TRIMMING" value="0" enum="TextOverrunFlag"> + <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"> @@ -1513,8 +1660,8 @@ </constant> <constant name="SUBPIXEL_POSITIONING_AUTO" value="1" enum="SubpixelPositioning"> Glyph horizontal position is rounded based on font size. - - To one quarter of the pixel size if font size is smaller or equal to [code]16[/code]. - - To one half of the pixel size if font size is smaller or equal to [code]20[/code]. + - To one quarter of the pixel size if font size is smaller or equal to [constant SUBPIXEL_POSITIONING_ONE_QUARTER_MAX_SIZE]. + - To one half of the pixel size if font size is smaller or equal to [constant SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE]. - To the whole pixel size for larger fonts. </constant> <constant name="SUBPIXEL_POSITIONING_ONE_HALF" value="2" enum="SubpixelPositioning"> @@ -1523,31 +1670,49 @@ <constant name="SUBPIXEL_POSITIONING_ONE_QUARTER" value="3" enum="SubpixelPositioning"> Glyph horizontal position is rounded to one quarter of the pixel size, each glyph is rasterized up to four times. </constant> - <constant name="FEATURE_BIDI_LAYOUT" value="1" enum="Feature"> - TextServer supports bidirectional layouts. + <constant name="SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE" value="20" enum="SubpixelPositioning"> + Maximum font size which will use one half of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode. + </constant> + <constant name="SUBPIXEL_POSITIONING_ONE_QUARTER_MAX_SIZE" value="16" enum="SubpixelPositioning"> + Maximum font size which will use one quarter of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode. + </constant> + <constant name="FEATURE_SIMPLE_LAYOUT" value="1" enum="Feature"> + TextServer supports simple text layouts. + </constant> + <constant name="FEATURE_BIDI_LAYOUT" value="2" enum="Feature"> + TextServer supports bidirectional text layouts. </constant> - <constant name="FEATURE_VERTICAL_LAYOUT" value="2" enum="Feature"> + <constant name="FEATURE_VERTICAL_LAYOUT" value="4" enum="Feature"> TextServer supports vertical layouts. </constant> - <constant name="FEATURE_SHAPING" value="4" enum="Feature"> + <constant name="FEATURE_SHAPING" value="8" enum="Feature"> TextServer supports complex text shaping. </constant> - <constant name="FEATURE_KASHIDA_JUSTIFICATION" value="8" enum="Feature"> + <constant name="FEATURE_KASHIDA_JUSTIFICATION" value="16" enum="Feature"> TextServer supports justification using kashidas. </constant> - <constant name="FEATURE_BREAK_ITERATORS" value="16" enum="Feature"> + <constant name="FEATURE_BREAK_ITERATORS" value="32" enum="Feature"> TextServer supports complex line/word breaking rules (e.g. dictionary based). </constant> - <constant name="FEATURE_FONT_SYSTEM" value="32" enum="Feature"> + <constant name="FEATURE_FONT_BITMAP" value="64" enum="Feature"> + TextServer supports loading bitmap fonts. + </constant> + <constant name="FEATURE_FONT_DYNAMIC" value="128" enum="Feature"> + TextServer supports loading dynamic (TrueType, OpeType, etc.) fonts. + </constant> + <constant name="FEATURE_FONT_MSDF" value="256" enum="Feature"> + TextServer supports multichannel signed distance field dynamic font rendering. + </constant> + <constant name="FEATURE_FONT_SYSTEM" value="512" enum="Feature"> TextServer supports loading system fonts. </constant> - <constant name="FEATURE_FONT_VARIABLE" value="64" enum="Feature"> + <constant name="FEATURE_FONT_VARIABLE" value="1024" enum="Feature"> TextServer supports variable fonts. </constant> - <constant name="FEATURE_CONTEXT_SENSITIVE_CASE_CONVERSION" value="128" enum="Feature"> + <constant name="FEATURE_CONTEXT_SENSITIVE_CASE_CONVERSION" value="2048" enum="Feature"> TextServer supports locale dependent and context sensitive case conversion. </constant> - <constant name="FEATURE_USE_SUPPORT_DATA" value="256" enum="Feature"> + <constant name="FEATURE_USE_SUPPORT_DATA" value="4096" enum="Feature"> TextServer require external data file for some features. </constant> <constant name="CONTOUR_CURVE_TAG_ON" value="1" enum="ContourPointTag"> @@ -1571,14 +1736,38 @@ <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"> + Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description. + </constant> + <constant name="STRUCTURED_TEXT_URI" value="1" enum="StructuredTextParser"> + BiDi override for URI. + </constant> + <constant name="STRUCTURED_TEXT_FILE" value="2" enum="StructuredTextParser"> + BiDi override for file path. + </constant> + <constant name="STRUCTURED_TEXT_EMAIL" value="3" enum="StructuredTextParser"> + BiDi override for email. + </constant> + <constant name="STRUCTURED_TEXT_LIST" value="4" enum="StructuredTextParser"> + BiDi override for lists. + Structured text options: list separator [code]String[/code]. + </constant> + <constant name="STRUCTURED_TEXT_NONE" value="5" enum="StructuredTextParser"> + Use default Unicode BiDi algorithm. + </constant> + <constant name="STRUCTURED_TEXT_CUSTOM" value="6" enum="StructuredTextParser"> + User defined structured text BiDi override function. + </constant> </constants> </class> diff --git a/doc/classes/TextServerDummy.xml b/doc/classes/TextServerDummy.xml new file mode 100644 index 0000000000..b872e93fd6 --- /dev/null +++ b/doc/classes/TextServerDummy.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="TextServerDummy" inherits="TextServerExtension" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index f730f28e79..4501ec744a 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -9,23 +9,21 @@ <tutorials> </tutorials> <methods> - <method name="_create_font" qualifiers="virtual"> + <method name="create_font" qualifiers="virtual"> <return type="RID" /> <description> - Creates new, empty font cache entry resource. To free the resulting resourec, use [method _free] method. + Creates new, empty font cache entry resource. To free the resulting resourec, use [method free_rid] method. </description> </method> - <method name="_create_shaped_text" qualifiers="virtual"> + <method name="create_shaped_text" qualifiers="virtual"> <return type="RID" /> <argument index="0" name="direction" type="int" enum="TextServer.Direction" /> <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" /> <description> - Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method _free] method. - [b]Note:[/b] Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature. - [b]Note:[/b] Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature. + Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method free_rid] method. </description> </method> - <method name="_draw_hex_code_box" qualifiers="virtual const"> + <method name="draw_hex_code_box" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="canvas" type="RID" /> <argument index="1" name="size" type="int" /> @@ -34,18 +32,18 @@ <argument index="4" name="color" type="Color" /> <description> Draws box displaying character hexadecimal code. Used for replacing missing characters. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_font_clear_glyphs" qualifiers="virtual"> + <method name="font_clear_glyphs" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> <description> Removes all rendered glyphs information from the cache entry. - [b]Note:[/b] This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually. </description> </method> - <method name="_font_clear_kerning_map" qualifiers="virtual"> + <method name="font_clear_kerning_map" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -53,23 +51,22 @@ Removes all kerning overrides. </description> </method> - <method name="_font_clear_size_cache" qualifiers="virtual"> + <method name="font_clear_size_cache" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <description> - Removes all font sizes from the cache entry + Removes all font sizes from the cache entry. </description> </method> - <method name="_font_clear_textures" qualifiers="virtual"> + <method name="font_clear_textures" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> <description> Removes all textures from font cache entry. - [b]Note:[/b] This function will not remove glyphs associated with the texture, use [method _font_remove_glyph] to remove them manually. </description> </method> - <method name="_font_draw_glyph" qualifiers="virtual const"> + <method name="font_draw_glyph" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="canvas" type="RID" /> @@ -79,10 +76,9 @@ <argument index="5" name="color" type="Color" /> <description> Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. - [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index]. </description> </method> - <method name="_font_draw_glyph_outline" qualifiers="virtual const"> + <method name="font_draw_glyph_outline" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="canvas" type="RID" /> @@ -93,10 +89,9 @@ <argument index="6" name="color" type="Color" /> <description> Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. - [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index]. </description> </method> - <method name="_font_get_ascent" qualifiers="virtual const"> + <method name="font_get_ascent" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -104,7 +99,7 @@ Returns the font ascent (number of pixels above the baseline). </description> </method> - <method name="_font_get_descent" qualifiers="virtual const"> + <method name="font_get_descent" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -112,30 +107,57 @@ Returns the font descent (number of pixels below the baseline). </description> </method> - <method name="_font_get_fixed_size" qualifiers="virtual const"> + <method name="font_get_embolden" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + 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" /> <description> Returns bitmap font fixed size. </description> </method> - <method name="_font_get_global_oversampling" qualifiers="virtual const"> + <method name="font_get_generate_mipmaps" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns [code]true[/code] if font texture mipmap generation is enabled. + </description> + </method> + <method name="font_get_global_oversampling" qualifiers="virtual const"> <return type="float" /> <description> Returns the font oversampling factor, shared by all fonts in the TextServer. </description> </method> - <method name="_font_get_glyph_advance" qualifiers="virtual const"> + <method name="font_get_glyph_advance" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> <argument index="2" name="glyph" type="int" /> <description> Returns glyph advance (offset of the next glyph). - [b]Note:[/b] Advance for glyphs outlines is the same as the base glyph advance and is not saved. </description> </method> - <method name="_font_get_glyph_contours" qualifiers="virtual const"> + <method name="font_get_glyph_contours" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -147,7 +169,7 @@ [code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled. </description> </method> - <method name="_font_get_glyph_index" qualifiers="virtual const"> + <method name="font_get_glyph_index" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -157,7 +179,7 @@ Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code]. </description> </method> - <method name="_font_get_glyph_list" qualifiers="virtual const"> + <method name="font_get_glyph_list" qualifiers="virtual const"> <return type="Array" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -165,7 +187,7 @@ Returns list of rendered glyphs in the cache entry. </description> </method> - <method name="_font_get_glyph_offset" qualifiers="virtual const"> + <method name="font_get_glyph_offset" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -174,7 +196,7 @@ Returns glyph offset from the baseline. </description> </method> - <method name="_font_get_glyph_size" qualifiers="virtual const"> + <method name="font_get_glyph_size" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -183,7 +205,7 @@ Returns size of the glyph. </description> </method> - <method name="_font_get_glyph_texture_idx" qualifiers="virtual const"> + <method name="font_get_glyph_texture_idx" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -192,7 +214,25 @@ Returns index of the cache texture containing the glyph. </description> </method> - <method name="_font_get_glyph_uv_rect" qualifiers="virtual const"> + <method name="font_get_glyph_texture_rid" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns resource id of the cache texture containing the glyph. + </description> + </method> + <method name="font_get_glyph_texture_size" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns size of the cache texture containing the glyph. + </description> + </method> + <method name="font_get_glyph_uv_rect" qualifiers="virtual const"> <return type="Rect2" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -201,14 +241,14 @@ Returns rectangle in the cache texture containing the glyph. </description> </method> - <method name="_font_get_hinting" qualifiers="virtual const"> + <method name="font_get_hinting" qualifiers="virtual const"> <return type="int" enum="TextServer.Hinting" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns the font hinting mode. Used by dynamic fonts only. </description> </method> - <method name="_font_get_kerning" qualifiers="virtual const"> + <method name="font_get_kerning" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -217,7 +257,7 @@ Returns kerning for the pair of glyphs. </description> </method> - <method name="_font_get_kerning_list" qualifiers="virtual const"> + <method name="font_get_kerning_list" qualifiers="virtual const"> <return type="Array" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -225,7 +265,7 @@ Returns list of the kerning overrides. </description> </method> - <method name="_font_get_language_support_override" qualifiers="virtual"> + <method name="font_get_language_support_override" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="language" type="String" /> @@ -233,49 +273,49 @@ Returns [code]true[/code] if support override is enabled for the [code]language[/code]. </description> </method> - <method name="_font_get_language_support_overrides" qualifiers="virtual"> + <method name="font_get_language_support_overrides" qualifiers="virtual"> <return type="PackedStringArray" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns list of language support overrides. </description> </method> - <method name="_font_get_msdf_pixel_range" qualifiers="virtual const"> + <method name="font_get_msdf_pixel_range" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <description> - Return the width of the range around the shape between the minimum and maximum representable signed distance. + Returns the width of the range around the shape between the minimum and maximum representable signed distance. </description> </method> - <method name="_font_get_msdf_size" qualifiers="virtual const"> + <method name="font_get_msdf_size" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns source font size used to generate MSDF textures. </description> </method> - <method name="_font_get_name" qualifiers="virtual const"> + <method name="font_get_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font family name. </description> </method> - <method name="_font_get_opentype_feature_overrides" qualifiers="virtual const"> + <method name="font_get_opentype_feature_overrides" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font OpenType feature set override. </description> </method> - <method name="_font_get_oversampling" qualifiers="virtual const"> + <method name="font_get_oversampling" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. </description> </method> - <method name="_font_get_scale" qualifiers="virtual const"> + <method name="font_get_scale" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -283,7 +323,7 @@ Returns scaling factor of the color bitmap font. </description> </method> - <method name="_font_get_script_support_override" qualifiers="virtual"> + <method name="font_get_script_support_override" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="script" type="String" /> @@ -291,58 +331,49 @@ Returns [code]true[/code] if support override is enabled for the [code]script[/code]. </description> </method> - <method name="_font_get_script_support_overrides" qualifiers="virtual"> + <method name="font_get_script_support_overrides" qualifiers="virtual"> <return type="PackedStringArray" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns list of script support overrides. </description> </method> - <method name="_font_get_size_cache_list" qualifiers="virtual const"> + <method name="font_get_size_cache_list" qualifiers="virtual const"> <return type="Array" /> <argument index="0" name="font_rid" type="RID" /> <description> - Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. + 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" /> + <method name="font_get_style" qualifiers="virtual const"> + <return type="int" enum="TextServer.FontStyle" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font style flags, see [enum TextServer.FontStyle]. </description> </method> - <method name="_font_get_style_name" qualifiers="virtual const"> + <method name="font_get_style_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font style name. </description> </method> - <method name="_font_get_subpixel_positioning" qualifiers="virtual const"> + <method name="font_get_subpixel_positioning" qualifiers="virtual const"> <return type="int" enum="TextServer.SubpixelPositioning" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns font sub-pixel glyph positioning mode. </description> </method> - <method name="_font_get_supported_chars" qualifiers="virtual const"> + <method name="font_get_supported_chars" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns a string containing all the characters available in the font. </description> </method> - <method name="_font_get_texture_count" qualifiers="virtual const"> + <method name="font_get_texture_count" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -350,7 +381,7 @@ Returns number of textures used by font cache entry. </description> </method> - <method name="_font_get_texture_image" qualifiers="virtual const"> + <method name="font_get_texture_image" qualifiers="virtual const"> <return type="Image" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -359,7 +390,7 @@ Returns font cache texture image data. </description> </method> - <method name="_font_get_texture_offsets" qualifiers="virtual const"> + <method name="font_get_texture_offsets" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -368,7 +399,14 @@ Returns 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="_font_get_underline_position" qualifiers="virtual const"> + <method name="font_get_transform" qualifiers="virtual const"> + <return type="Transform2D" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns 2D transform applied to the font outlines. + </description> + </method> + <method name="font_get_underline_position" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -376,7 +414,7 @@ Returns pixel offset of the underline below the baseline. </description> </method> - <method name="_font_get_underline_thickness" qualifiers="virtual const"> + <method name="font_get_underline_thickness" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -384,36 +422,36 @@ Returns thickness of the underline in pixels. </description> </method> - <method name="_font_get_variation_coordinates" qualifiers="virtual const"> + <method name="font_get_variation_coordinates" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> - Returns variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info. + Returns variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info. </description> </method> - <method name="_font_has_char" qualifiers="virtual const"> + <method name="font_has_char" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="char" type="int" /> <description> - Return [code]true[/code] if a Unicode [code]char[/code] is available in the font. + Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> - <method name="_font_is_antialiased" qualifiers="virtual const"> + <method name="font_is_antialiased" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled. </description> </method> - <method name="_font_is_force_autohinter" qualifiers="virtual const"> + <method name="font_is_force_autohinter" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </description> </method> - <method name="_font_is_language_supported" qualifiers="virtual const"> + <method name="font_is_language_supported" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="language" type="String" /> @@ -421,14 +459,14 @@ 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="_font_is_multichannel_signed_distance_field" qualifiers="virtual const"> + <method name="font_is_multichannel_signed_distance_field" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. </description> </method> - <method name="_font_is_script_supported" qualifiers="virtual const"> + <method name="font_is_script_supported" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="script" type="String" /> @@ -436,17 +474,16 @@ Returns [code]true[/code], if font supports given script (ISO 15924 code). </description> </method> - <method name="_font_remove_glyph" qualifiers="virtual"> + <method name="font_remove_glyph" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="glyph" type="int" /> <description> Removes specified rendered glyph information from the cache entry. - [b]Note:[/b] This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually. </description> </method> - <method name="_font_remove_kerning" qualifiers="virtual"> + <method name="font_remove_kerning" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -455,7 +492,7 @@ Removes kerning override for the pair of glyphs. </description> </method> - <method name="_font_remove_language_support_override" qualifiers="virtual"> + <method name="font_remove_language_support_override" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="language" type="String" /> @@ -463,7 +500,7 @@ Remove language support override. </description> </method> - <method name="_font_remove_script_support_override" qualifiers="virtual"> + <method name="font_remove_script_support_override" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="script" type="String" /> @@ -471,7 +508,7 @@ Removes script support override. </description> </method> - <method name="_font_remove_size_cache" qualifiers="virtual"> + <method name="font_remove_size_cache" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -479,26 +516,25 @@ Removes specified font size from the cache entry. </description> </method> - <method name="_font_remove_texture" qualifiers="virtual"> + <method name="font_remove_texture" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <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 _font_remove_glyph]. + Removes specified texture from the cache entry. </description> </method> - <method name="_font_render_glyph" qualifiers="virtual"> + <method name="font_render_glyph" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <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="_font_render_range" qualifiers="virtual"> + <method name="font_render_range" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -508,7 +544,7 @@ Renders the range of characters to the font cache texture. </description> </method> - <method name="_font_set_antialiased" qualifiers="virtual"> + <method name="font_set_antialiased" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="antialiased" type="bool" /> @@ -516,7 +552,7 @@ If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only. </description> </method> - <method name="_font_set_ascent" qualifiers="virtual"> + <method name="font_set_ascent" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -525,7 +561,7 @@ Sets the font ascent (number of pixels above the baseline). </description> </method> - <method name="_font_set_data" qualifiers="virtual"> + <method name="font_set_data" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="data" type="PackedByteArray" /> @@ -533,33 +569,49 @@ Sets font source data, e.g contents of the dynamic font source file. </description> </method> - <method name="_font_set_data_ptr" qualifiers="virtual"> + <method name="font_set_data_ptr" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="data_ptr" type="const uint8_t*" /> <argument index="2" name="data_size" type="int" /> <description> - Sets the font descent (number of pixels below the baseline). + Sets font source data, e.g contents of the dynamic font source file. [code]data_ptr[/code] memory buffer must remain accessible during font lifetime. </description> </method> - <method name="_font_set_descent" qualifiers="virtual"> + <method name="font_set_descent" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> <argument index="2" name="descent" type="float" /> <description> - Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes. + Sets the font descent (number of pixels below the baseline). </description> </method> - <method name="_font_set_fixed_size" qualifiers="virtual"> + <method name="font_set_embolden" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="strength" type="float" /> + <description> + 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" /> <argument index="1" name="fixed_size" type="int" /> <description> - If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. + Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes. </description> </method> - <method name="_font_set_force_autohinter" qualifiers="virtual"> + <method name="font_set_force_autohinter" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="force_autohinter" type="bool" /> @@ -567,7 +619,15 @@ If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> - <method name="_font_set_global_oversampling" qualifiers="virtual"> + <method name="font_set_generate_mipmaps" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="generate_mipmaps" type="bool" /> + <description> + If set to [code]true[/code] font texture mipmap generation is enabled. + </description> + </method> + <method name="font_set_global_oversampling" qualifiers="virtual"> <return type="void" /> <argument index="0" name="oversampling" type="float" /> <description> @@ -575,7 +635,7 @@ [b]Note:[/b] This value can be automatically changed by display server. </description> </method> - <method name="_font_set_glyph_advance" qualifiers="virtual"> + <method name="font_set_glyph_advance" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -583,10 +643,9 @@ <argument index="3" name="advance" type="Vector2" /> <description> Sets glyph advance (offset of the next glyph). - [b]Note:[/b] Advance for glyphs outlines is the same as the base glyph advance and is not saved. </description> </method> - <method name="_font_set_glyph_offset" qualifiers="virtual"> + <method name="font_set_glyph_offset" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -596,7 +655,7 @@ Sets glyph offset from the baseline. </description> </method> - <method name="_font_set_glyph_size" qualifiers="virtual"> + <method name="font_set_glyph_size" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -606,7 +665,7 @@ Sets size of the glyph. </description> </method> - <method name="_font_set_glyph_texture_idx" qualifiers="virtual"> + <method name="font_set_glyph_texture_idx" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -616,7 +675,7 @@ Sets index of the cache texture containing the glyph. </description> </method> - <method name="_font_set_glyph_uv_rect" qualifiers="virtual"> + <method name="font_set_glyph_uv_rect" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -626,7 +685,7 @@ Sets rectangle in the cache texture containing the glyph. </description> </method> - <method name="_font_set_hinting" qualifiers="virtual"> + <method name="font_set_hinting" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="hinting" type="int" enum="TextServer.Hinting" /> @@ -634,7 +693,7 @@ Sets font hinting mode. Used by dynamic fonts only. </description> </method> - <method name="_font_set_kerning" qualifiers="virtual"> + <method name="font_set_kerning" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -644,16 +703,16 @@ Sets kerning for the pair of glyphs. </description> </method> - <method name="_font_set_language_support_override" qualifiers="virtual"> + <method name="font_set_language_support_override" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="language" type="String" /> <argument index="2" name="supported" type="bool" /> <description> - Adds override for [method _font_is_language_supported]. + Adds override for [method font_is_language_supported]. </description> </method> - <method name="_font_set_msdf_pixel_range" qualifiers="virtual"> + <method name="font_set_msdf_pixel_range" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="msdf_pixel_range" type="int" /> @@ -661,7 +720,7 @@ Sets the width of the range around the shape between the minimum and maximum representable signed distance. </description> </method> - <method name="_font_set_msdf_size" qualifiers="virtual"> + <method name="font_set_msdf_size" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="msdf_size" type="int" /> @@ -669,15 +728,16 @@ Sets source font size used to generate MSDF textures. </description> </method> - <method name="_font_set_multichannel_signed_distance_field" qualifiers="virtual"> + <method name="font_set_multichannel_signed_distance_field" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="msdf" type="bool" /> <description> - If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. + If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes. + [b]Note:[/b] MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts. </description> </method> - <method name="_font_set_name" qualifiers="virtual"> + <method name="font_set_name" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="name" type="String" /> @@ -685,7 +745,7 @@ Sets the font family name. </description> </method> - <method name="_font_set_opentype_feature_overrides" qualifiers="virtual"> + <method name="font_set_opentype_feature_overrides" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="overrides" type="Dictionary" /> @@ -693,7 +753,7 @@ Sets font OpenType feature set override. </description> </method> - <method name="_font_set_oversampling" qualifiers="virtual"> + <method name="font_set_oversampling" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="oversampling" type="float" /> @@ -701,7 +761,7 @@ Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. </description> </method> - <method name="_font_set_scale" qualifiers="virtual"> + <method name="font_set_scale" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -710,34 +770,24 @@ Sets scaling factor of the color bitmap font. </description> </method> - <method name="_font_set_script_support_override" qualifiers="virtual"> + <method name="font_set_script_support_override" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="script" type="String" /> <argument index="2" name="supported" type="bool" /> <description> - 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. + Adds override for [method font_is_script_supported]. </description> </method> - <method name="_font_set_style" qualifiers="virtual"> + <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> </method> - <method name="_font_set_style_name" qualifiers="virtual"> + <method name="font_set_style_name" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="name_style" type="String" /> @@ -745,7 +795,7 @@ Sets the font style name. </description> </method> - <method name="_font_set_subpixel_positioning" qualifiers="virtual"> + <method name="font_set_subpixel_positioning" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="subpixel_positioning" type="int" enum="TextServer.SubpixelPositioning" /> @@ -753,7 +803,7 @@ Sets font sub-pixel glyph positioning mode. </description> </method> - <method name="_font_set_texture_image" qualifiers="virtual"> + <method name="font_set_texture_image" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -763,7 +813,7 @@ Sets font cache texture image data. </description> </method> - <method name="_font_set_texture_offsets" qualifiers="virtual"> + <method name="font_set_texture_offsets" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="Vector2i" /> @@ -773,7 +823,16 @@ Sets 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="_font_set_underline_position" qualifiers="virtual"> + <method name="font_set_transform" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="transform" type="Transform2D" /> + <description> + Sets 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]. + </description> + </method> + <method name="font_set_underline_position" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -782,7 +841,7 @@ Sets pixel offset of the underline below the baseline. </description> </method> - <method name="_font_set_underline_thickness" qualifiers="virtual"> + <method name="font_set_underline_thickness" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="size" type="int" /> @@ -791,29 +850,29 @@ Sets thickness of the underline in pixels. </description> </method> - <method name="_font_set_variation_coordinates" qualifiers="virtual"> + <method name="font_set_variation_coordinates" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="variation_coordinates" type="Dictionary" /> <description> - Sets variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info. + Sets variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info. </description> </method> - <method name="_font_supported_feature_list" qualifiers="virtual const"> + <method name="font_supported_feature_list" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns the dictionary of the supported OpenType features. </description> </method> - <method name="_font_supported_variation_list" qualifiers="virtual const"> + <method name="font_supported_variation_list" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> Returns the dictionary of the supported OpenType variation coordinates. </description> </method> - <method name="_format_number" qualifiers="virtual const"> + <method name="format_number" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="string" type="String" /> <argument index="1" name="language" type="String" /> @@ -821,82 +880,82 @@ Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code]. </description> </method> - <method name="_free" qualifiers="virtual"> + <method name="free_rid" qualifiers="virtual"> <return type="void" /> <argument index="0" name="rid" type="RID" /> <description> Frees an object created by this [TextServer]. </description> </method> - <method name="_get_features" qualifiers="virtual const"> + <method name="get_features" qualifiers="virtual const"> <return type="int" /> <description> Returns text server features, see [enum TextServer.Feature]. </description> </method> - <method name="_get_hex_code_box_size" qualifiers="virtual const"> + <method name="get_hex_code_box_size" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="size" type="int" /> <argument index="1" name="index" type="int" /> <description> Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters). + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_get_name" qualifiers="virtual const"> + <method name="get_name" qualifiers="virtual const"> <return type="String" /> <description> Returns the name of the server interface. </description> </method> - <method name="_get_support_data_filename" qualifiers="virtual const"> + <method name="get_support_data_filename" qualifiers="virtual const"> <return type="String" /> <description> Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename. </description> </method> - <method name="_get_support_data_info" qualifiers="virtual const"> + <method name="get_support_data_info" qualifiers="virtual const"> <return type="String" /> <description> Returns TextServer database (e.g. ICU break iterators and dictionaries) description. </description> </method> - <method name="_has" qualifiers="virtual"> + <method name="has" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="rid" type="RID" /> <description> Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server. </description> </method> - <method name="_has_feature" qualifiers="virtual const"> + <method name="has_feature" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="feature" type="int" enum="TextServer.Feature" /> <description> Returns [code]true[/code] if the server supports a feature. </description> </method> - <method name="_is_locale_right_to_left" qualifiers="virtual const"> + <method name="is_locale_right_to_left" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="locale" type="String" /> <description> Returns [code]true[/code] if locale is right-to-left. </description> </method> - <method name="_load_support_data" qualifiers="virtual"> + <method name="load_support_data" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="filename" type="String" /> <description> Loads optional TextServer database (e.g. ICU break iterators and dictionaries). - [b]Note:[/b] This function should be called before any other TextServer functions used, otherwise it won't have any effect. </description> </method> - <method name="_name_to_tag" qualifiers="virtual const"> + <method name="name_to_tag" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="name" type="String" /> <description> Converts readable feature, variation, script or language name to OpenType tag. </description> </method> - <method name="_parse_number" qualifiers="virtual const"> + <method name="parse_number" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="string" type="String" /> <argument index="1" name="language" type="String" /> @@ -904,14 +963,22 @@ Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9). </description> </method> - <method name="_percent_sign" qualifiers="virtual const"> + <method name="parse_structured_text" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" /> + <argument index="1" name="args" type="Array" /> + <argument index="2" name="text" type="String" /> + <description> + </description> + </method> + <method name="percent_sign" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="language" type="String" /> <description> Returns percent sign used in the [code]language[/code]. </description> </method> - <method name="_save_support_data" qualifiers="virtual const"> + <method name="save_support_data" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="filename" type="String" /> <description> @@ -919,14 +986,14 @@ [b]Note:[/b] This function is used by during project export, to include TextServer database. </description> </method> - <method name="_shaped_get_span_count" qualifiers="virtual const"> + <method name="shaped_get_span_count" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <description> - Returns number of text spans added using [method _shaped_text_add_string] or [method _shaped_text_add_object]. + Returns number of text spans added using [method shaped_text_add_string] or [method shaped_text_add_object]. </description> </method> - <method name="_shaped_get_span_meta" qualifiers="virtual const"> + <method name="shaped_get_span_meta" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="index" type="int" /> @@ -934,7 +1001,7 @@ Returns text span metadata. </description> </method> - <method name="_shaped_set_span_update_font" qualifiers="virtual"> + <method name="shaped_set_span_update_font" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="index" type="int" /> @@ -945,7 +1012,7 @@ Changes text span font, font size and OpenType features, without changing the text. </description> </method> - <method name="_shaped_text_add_object" qualifiers="virtual"> + <method name="shaped_text_add_object" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> @@ -956,7 +1023,7 @@ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. </description> </method> - <method name="_shaped_text_add_string" qualifiers="virtual"> + <method name="shaped_text_add_string" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="text" type="String" /> @@ -969,14 +1036,14 @@ Adds text span and font to draw it to the text buffer. </description> </method> - <method name="_shaped_text_clear" qualifiers="virtual"> + <method name="shaped_text_clear" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <description> Clears text buffer (removes text and inline objects). </description> </method> - <method name="_shaped_text_draw" qualifiers="virtual const"> + <method name="shaped_text_draw" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="canvas" type="RID" /> @@ -986,9 +1053,10 @@ <argument index="5" name="color" type="Color" /> <description> Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_draw_outline" qualifiers="virtual const"> + <method name="shaped_text_draw_outline" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="canvas" type="RID" /> @@ -999,137 +1067,141 @@ <argument index="6" name="color" type="Color" /> <description> Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_fit_to_width" qualifiers="virtual"> + <method name="shaped_text_fit_to_width" qualifiers="virtual"> <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 + Adjusts text with to fit to specified width, returns new text width. </description> </method> - <method name="_shaped_text_get_ascent" qualifiers="virtual const"> + <method name="shaped_text_get_ascent" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <description> Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). - [b]Note:[/b] Overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline. </description> </method> - <method name="_shaped_text_get_carets" qualifiers="virtual const"> + <method name="shaped_text_get_carets" qualifiers="virtual const"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="position" type="int" /> <argument index="2" name="caret" type="CaretInfo*" /> <description> Returns shapes of the carets corresponding to the character offset [code]position[/code] in the text. Returned caret shape is 1 pixel wide rectangle. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_get_custom_punctuation" qualifiers="virtual const"> + <method name="shaped_text_get_custom_punctuation" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="shaped" type="RID" /> <description> Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. </description> </method> - <method name="_shaped_text_get_descent" qualifiers="virtual const"> + <method name="shaped_text_get_descent" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <description> Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). - [b]Note:[/b] Overall descent can be higher than font descent, if some glyphs are displaced from the baseline. </description> </method> - <method name="_shaped_text_get_direction" qualifiers="virtual const"> + <method name="shaped_text_get_direction" qualifiers="virtual const"> <return type="int" enum="TextServer.Direction" /> <argument index="0" name="shaped" type="RID" /> <description> Returns direction of the text. </description> </method> - <method name="_shaped_text_get_dominant_direction_in_range" qualifiers="virtual const"> + <method name="shaped_text_get_dominant_direction_in_range" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="start" type="int" /> <argument index="2" name="end" type="int" /> <description> Returns dominant direction of in the range of text. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_get_ellipsis_glyph_count" qualifiers="virtual const"> + <method name="shaped_text_get_ellipsis_glyph_count" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <description> Returns number of glyphs in the ellipsis. </description> </method> - <method name="_shaped_text_get_ellipsis_glyphs" qualifiers="virtual const"> - <return type="Glyph*" /> + <method name="shaped_text_get_ellipsis_glyphs" qualifiers="virtual const"> + <return type="const Glyph*" /> <argument index="0" name="shaped" type="RID" /> <description> Returns array of the glyphs in the ellipsis. </description> </method> - <method name="_shaped_text_get_ellipsis_pos" qualifiers="virtual const"> + <method name="shaped_text_get_ellipsis_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <description> Returns position of the ellipsis. </description> </method> - <method name="_shaped_text_get_glyph_count" qualifiers="virtual const"> + <method name="shaped_text_get_glyph_count" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <description> - Returns text glyphs count. + Returns number of glyphs in the buffer. </description> </method> - <method name="_shaped_text_get_glyphs" qualifiers="virtual const"> - <return type="Glyph*" /> + <method name="shaped_text_get_glyphs" qualifiers="virtual const"> + <return type="const Glyph*" /> <argument index="0" name="shaped" type="RID" /> <description> - Copies text glyphs in the visual order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count]. + Returns an array of glyphs in the visual order. </description> </method> - <method name="_shaped_text_get_grapheme_bounds" qualifiers="virtual const"> + <method name="shaped_text_get_grapheme_bounds" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="pos" type="int" /> <description> Returns composite character's bounds as offsets from the start of the line. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_get_inferred_direction" qualifiers="virtual const"> + <method name="shaped_text_get_inferred_direction" qualifiers="virtual const"> <return type="int" enum="TextServer.Direction" /> <argument index="0" name="shaped" type="RID" /> <description> Returns direction of the text, inferred by the BiDi algorithm. </description> </method> - <method name="_shaped_text_get_line_breaks" qualifiers="virtual const"> + <method name="shaped_text_get_line_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <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. </description> </method> - <method name="_shaped_text_get_line_breaks_adv" qualifiers="virtual const"> + <method name="shaped_text_get_line_breaks_adv" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> <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. </description> </method> - <method name="_shaped_text_get_object_rect" qualifiers="virtual const"> + <method name="shaped_text_get_object_rect" qualifiers="virtual const"> <return type="Rect2" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> @@ -1137,35 +1209,35 @@ Returns bounding rectangle of the inline object. </description> </method> - <method name="_shaped_text_get_objects" qualifiers="virtual const"> + <method name="shaped_text_get_objects" qualifiers="virtual const"> <return type="Array" /> <argument index="0" name="shaped" type="RID" /> <description> Returns array of inline objects. </description> </method> - <method name="_shaped_text_get_orientation" qualifiers="virtual const"> + <method name="shaped_text_get_orientation" qualifiers="virtual const"> <return type="int" enum="TextServer.Orientation" /> <argument index="0" name="shaped" type="RID" /> <description> - Returns text orientation. + eturns text orientation. </description> </method> - <method name="_shaped_text_get_parent" qualifiers="virtual const"> + <method name="shaped_text_get_parent" qualifiers="virtual const"> <return type="RID" /> <argument index="0" name="shaped" type="RID" /> <description> - Sets text orientation. + Returns the parent buffer from which the substring originates. </description> </method> - <method name="_shaped_text_get_preserve_control" qualifiers="virtual const"> + <method name="shaped_text_get_preserve_control" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <description> Returns [code]true[/code] if text buffer is configured to display control characters. </description> </method> - <method name="_shaped_text_get_preserve_invalid" qualifiers="virtual const"> + <method name="shaped_text_get_preserve_invalid" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <description> @@ -1173,114 +1245,128 @@ [b]Note:[/b] If set to [code]false[/code], nothing is displayed in place of invalid characters. </description> </method> - <method name="_shaped_text_get_range" qualifiers="virtual const"> + <method name="shaped_text_get_range" qualifiers="virtual const"> <return type="Vector2i" /> <argument index="0" name="shaped" type="RID" /> <description> Returns substring buffer character range in the parent buffer. </description> </method> - <method name="_shaped_text_get_selection" qualifiers="virtual const"> + <method name="shaped_text_get_selection" qualifiers="virtual const"> <return type="PackedVector2Array" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="start" type="int" /> <argument index="2" name="end" type="int" /> <description> Returns selection rectangles for the specified character range. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_get_size" qualifiers="virtual const"> + <method name="shaped_text_get_size" qualifiers="virtual const"> <return type="Vector2" /> <argument index="0" name="shaped" type="RID" /> <description> Returns size of the text. </description> </method> - <method name="_shaped_text_get_trim_pos" qualifiers="virtual const"> + <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 ellipsis and trim positions. + Returns extra spacing added between glyphs or lines in pixels. </description> </method> - <method name="_shaped_text_get_underline_position" qualifiers="virtual const"> + <method name="shaped_text_get_trim_pos" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns the position of the overrun trim. + </description> + </method> + <method name="shaped_text_get_underline_position" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <description> Returns pixel offset of the underline below the baseline. </description> </method> - <method name="_shaped_text_get_underline_thickness" qualifiers="virtual const"> + <method name="shaped_text_get_underline_thickness" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <description> Returns thickness of the underline. </description> </method> - <method name="_shaped_text_get_width" qualifiers="virtual const"> + <method name="shaped_text_get_width" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <description> Returns width (for horizontal layout) or height (for vertical) of the text. </description> </method> - <method name="_shaped_text_get_word_breaks" qualifiers="virtual const"> + <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. </description> </method> - <method name="_shaped_text_hit_test_grapheme" qualifiers="virtual const"> + <method name="shaped_text_hit_test_grapheme" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="coord" type="float" /> <description> Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_hit_test_position" qualifiers="virtual const"> + <method name="shaped_text_hit_test_position" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="coord" type="float" /> <description> Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_is_ready" qualifiers="virtual const"> + <method name="shaped_text_is_ready" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <description> Returns [code]true[/code] if buffer is successfully shaped. </description> </method> - <method name="_shaped_text_next_grapheme_pos" qualifiers="virtual const"> + <method name="shaped_text_next_grapheme_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="pos" type="int" /> <description> Returns composite character end position closest to the [code]pos[/code]. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_overrun_trim_to_width" qualifiers="virtual"> + <method name="shaped_text_overrun_trim_to_width" qualifiers="virtual"> <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> </method> - <method name="_shaped_text_prev_grapheme_pos" qualifiers="virtual const"> + <method name="shaped_text_prev_grapheme_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="pos" type="int" /> <description> Returns composite character start position closest to the [code]pos[/code]. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_shaped_text_resize_object" qualifiers="virtual"> + <method name="shaped_text_resize_object" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> @@ -1290,7 +1376,7 @@ Sets new size and alignment of embedded object. </description> </method> - <method name="_shaped_text_set_bidi_override" qualifiers="virtual"> + <method name="shaped_text_set_bidi_override" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="override" type="Array" /> @@ -1299,7 +1385,7 @@ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. </description> </method> - <method name="_shaped_text_set_custom_punctuation" qualifiers="virtual"> + <method name="shaped_text_set_custom_punctuation" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="punct" type="String" /> @@ -1307,25 +1393,23 @@ Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. </description> </method> - <method name="_shaped_text_set_direction" qualifiers="virtual"> + <method name="shaped_text_set_direction" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="direction" type="int" enum="TextServer.Direction" /> <description> Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale. - [b]Note:[/b] Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature. </description> </method> - <method name="_shaped_text_set_orientation" qualifiers="virtual"> + <method name="shaped_text_set_orientation" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" /> <description> Sets desired text orientation. - [b]Note:[/b] Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature. </description> </method> - <method name="_shaped_text_set_preserve_control" qualifiers="virtual"> + <method name="shaped_text_set_preserve_control" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="enabled" type="bool" /> @@ -1333,7 +1417,7 @@ If set to [code]true[/code] text buffer will display control characters. </description> </method> - <method name="_shaped_text_set_preserve_invalid" qualifiers="virtual"> + <method name="shaped_text_set_preserve_invalid" qualifiers="virtual"> <return type="void" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="enabled" type="bool" /> @@ -1341,22 +1425,30 @@ 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_shape" qualifiers="virtual"> + <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" /> <description> Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully. - [b]Note:[/b] It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested. </description> </method> - <method name="_shaped_text_sort_logical" qualifiers="virtual"> - <return type="Glyph*" /> + <method name="shaped_text_sort_logical" qualifiers="virtual"> + <return type="const Glyph*" /> <argument index="0" name="shaped" type="RID" /> <description> - Copies text glyphs in the logical order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count]. + Returns text glyphs in the logical order. </description> </method> - <method name="_shaped_text_substr" qualifiers="virtual const"> + <method name="shaped_text_substr" qualifiers="virtual const"> <return type="RID" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="start" type="int" /> @@ -1365,7 +1457,7 @@ Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects). </description> </method> - <method name="_shaped_text_tab_align" qualifiers="virtual"> + <method name="shaped_text_tab_align" qualifiers="virtual"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="tab_stops" type="PackedFloat32Array" /> @@ -1373,37 +1465,55 @@ Aligns shaped text to the given tab-stops. </description> </method> - <method name="_shaped_text_update_breaks" qualifiers="virtual"> + <method name="shaped_text_update_breaks" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <description> - Updates line and word breaks. + Updates line breaking positions in the text buffer. + [b]Note:[/b] This method is used by default line/word breaking methods, and its implementation might be omitted if custom line breaking in implemented. </description> </method> - <method name="_shaped_text_update_justification_ops" qualifiers="virtual"> + <method name="shaped_text_update_justification_ops" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> <description> - Updates justification opportunities (spaces, kashidas, etc.). + Updates line justification positions (word breaks and elongations) in the text buffer. + [b]Note:[/b] This method is used by default line/word breaking methods, and its implementation might be omitted if custom line breaking in implemented. + </description> + </method> + <method name="string_get_word_breaks" qualifiers="virtual const"> + <return type="PackedInt32Array" /> + <argument index="0" name="string" type="String" /> + <argument index="1" name="language" type="String" /> + <description> + Returns array of the word break character offsets. </description> </method> - <method name="_string_to_lower" qualifiers="virtual const"> + <method name="string_to_lower" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="string" type="String" /> <argument index="1" name="language" type="String" /> <description> - Returns the string converted to lowercase. Casing is locale dependent and context sensitive. The result may be longer or shorter than the original. + Returns the string converted to lowercase. </description> </method> - <method name="_string_to_upper" qualifiers="virtual const"> + <method name="string_to_upper" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="string" type="String" /> <argument index="1" name="language" type="String" /> <description> - Returns the string converted to uppercase. Casing is locale dependent and context sensitive. The result may be longer or shorter than the original. + Returns the string converted to uppercase. + </description> + </method> + <method name="strip_diacritics" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="string" type="String" /> + <description> + Strips diacritics from the string. + [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="_tag_to_name" qualifiers="virtual const"> + <method name="tag_to_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="tag" type="int" /> <description> diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index de9bbb4b3d..3721058d25 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -12,6 +12,58 @@ <tutorials> </tutorials> <methods> + <method name="_draw" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="to_canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="modulate" type="Color" /> + <argument index="3" name="transpose" type="bool" /> + <description> + </description> + </method> + <method name="_draw_rect" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="to_canvas_item" type="RID" /> + <argument index="1" name="rect" type="Rect2" /> + <argument index="2" name="tile" type="bool" /> + <argument index="3" name="modulate" type="Color" /> + <argument index="4" name="transpose" type="bool" /> + <description> + </description> + </method> + <method name="_draw_rect_region" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="tp_canvas_item" type="RID" /> + <argument index="1" name="rect" type="Rect2" /> + <argument index="2" name="src_rect" type="Rect2" /> + <argument index="3" name="modulate" type="Color" /> + <argument index="4" name="transpose" type="bool" /> + <argument index="5" name="clip_uv" type="bool" /> + <description> + </description> + </method> + <method name="_get_height" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_width" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_has_alpha" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> + <method name="_is_pixel_opaque" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="x" type="int" /> + <argument index="1" name="y" type="int" /> + <description> + </description> + </method> <method name="draw" qualifiers="const"> <return type="void" /> <argument index="0" name="canvas_item" type="RID" /> @@ -54,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/Texture3D.xml b/doc/classes/Texture3D.xml index bdfa428328..4968f46fe8 100644 --- a/doc/classes/Texture3D.xml +++ b/doc/classes/Texture3D.xml @@ -7,6 +7,36 @@ <tutorials> </tutorials> <methods> + <method name="_get_data" qualifiers="virtual const"> + <return type="Image[]" /> + <description> + </description> + </method> + <method name="_get_depth" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_format" qualifiers="virtual const"> + <return type="int" enum="Image.Format" /> + <description> + </description> + </method> + <method name="_get_height" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_width" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_has_mipmaps" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> <method name="get_data" qualifiers="const"> <return type="Image[]" /> <description> diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index 13679908d7..3445329f32 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -9,6 +9,42 @@ <tutorials> </tutorials> <methods> + <method name="_get_format" qualifiers="virtual const"> + <return type="int" enum="Image.Format" /> + <description> + </description> + </method> + <method name="_get_height" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_layer_data" qualifiers="virtual const"> + <return type="Image" /> + <argument index="0" name="layer_index" type="int" /> + <description> + </description> + </method> + <method name="_get_layered_type" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_layers" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_get_width" qualifiers="virtual const"> + <return type="int" /> + <description> + </description> + </method> + <method name="_has_mipmaps" qualifiers="virtual const"> + <return type="bool" /> + <description> + </description> + </method> <method name="get_format" qualifiers="const"> <return type="int" enum="Image.Format" /> <description> diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index a97e3a0cdc..4ea072a25f 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -27,7 +27,6 @@ <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode" default="0"> The fill direction. See [enum FillMode] for possible values. </member> - <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="1" /> <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" default="false"> If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. When using a radial [member fill_mode], this setting will enable stretching. </member> 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 e5ecff178b..d532f583e6 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -57,6 +57,14 @@ Clears all cells on the given layer. </description> </method> + <method name="erase_cell"> + <return type="void" /> + <argument index="0" name="layer" type="int" /> + <argument index="1" name="coords" type="Vector2i" /> + <description> + Erases the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. + </description> + </method> <method name="fix_invalid_tiles"> <return type="void" /> <description> @@ -227,7 +235,7 @@ <argument index="1" name="coords" type="Vector2i" /> <argument index="2" name="source_id" type="int" default="-1" /> <argument index="3" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> - <argument index="4" name="alternative_tile" type="int" default="-1" /> + <argument index="4" name="alternative_tile" type="int" default="0" /> <description> Sets the tile indentifiers for the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. Each tile of the [TileSet] is identified using three parts: - The source identifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id], @@ -235,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> + 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> - 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]. 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"> @@ -322,10 +345,10 @@ [b]Note:[/b] Enabling [code]collision_animatable[/code] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles. </member> <member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0"> - Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings. + Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings. </member> <member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0"> - Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show navigation debug settings. + Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings. </member> <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> The assigned [TileSet]. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 809992b58f..ad52b2f2f1 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -113,7 +113,7 @@ <argument index="0" name="source_from" type="int" /> <argument index="1" name="coords_from" type="Vector2i" /> <description> - Returns the coodinate-level proxy for the given identifiers. The returned array contains the two proxie's target identifiers (source ID and atlas coords ID). + Returns the coordinate-level proxy for the given identifiers. The returned array contains the two target identifiers of the proxy (source ID and atlas coordinates ID). If the TileSet has no proxy for the given identifiers, returns an empty Array. </description> </method> @@ -591,7 +591,7 @@ Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis. </constant> <constant name="TILE_LAYOUT_STACKED_OFFSET" value="1" enum="TileLayout"> - Same as [code]TILE_LAYOUT_STAKED[/code], but the first half-offset is negative instead of positive. + Same as [constant TILE_LAYOUT_STACKED], but the first half-offset is negative instead of positive. </constant> <constant name="TILE_LAYOUT_STAIRS_RIGHT" value="2" enum="TileLayout"> Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right. diff --git a/doc/classes/Time.xml b/doc/classes/Time.xml index bb59881db9..5fc85c869b 100644 --- a/doc/classes/Time.xml +++ b/doc/classes/Time.xml @@ -43,13 +43,14 @@ Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD). </description> </method> - <method name="get_datetime_dict_from_string" qualifiers="const"> + <method name="get_datetime_dict_from_datetime_string" qualifiers="const"> <return type="Dictionary" /> <argument index="0" name="datetime" type="String" /> <argument index="1" name="weekday" type="bool" /> <description> Converts the given ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS) to a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/code], [code]minute[/code], and [code]second[/code]. If [code]weekday[/code] is false, then the [code]weekday[/code] entry is excluded (the calculation is relatively expensive). + [b]Note:[/b] Any decimal fraction in the time string will be ignored silently. </description> </method> <method name="get_datetime_dict_from_system" qualifiers="const"> @@ -67,7 +68,7 @@ The returned Dictionary's values will be the same as the [method get_datetime_dict_from_system] if the Unix timestamp is the current time, with the exception of Daylight Savings Time as it cannot be determined from the epoch. </description> </method> - <method name="get_datetime_string_from_dict" qualifiers="const"> + <method name="get_datetime_string_from_datetime_dict" qualifiers="const"> <return type="String" /> <argument index="0" name="datetime" type="Dictionary" /> <argument index="1" name="use_space" type="bool" /> @@ -97,6 +98,13 @@ If [code]use_space[/code] is true, use a space instead of the letter T in the middle. </description> </method> + <method name="get_offset_string_from_offset_minutes" qualifiers="const"> + <return type="String" /> + <argument index="0" name="offset_minutes" type="int" /> + <description> + Converts the given timezone offset in minutes to a timezone offset string. For example, -480 returns "-08:00", 345 returns "+05:45", and 0 returns "+00:00". + </description> + </method> <method name="get_ticks_msec" qualifiers="const"> <return type="int" /> <description> @@ -164,12 +172,14 @@ <description> Converts the given ISO 8601 date and/or time string to a Unix timestamp. The string can contain a date only, a time only, or both. [b]Note:[/b] Unix timestamps are often in UTC. This method does not do any timezone conversion, so the timestamp will be in the same timezone as the given datetime string. + [b]Note:[/b] Any decimal fraction in the time string will be ignored silently. </description> </method> <method name="get_unix_time_from_system" qualifiers="const"> <return type="float" /> <description> Returns the current Unix timestamp in seconds based on the system time in UTC. This method is implemented by the operating system and always returns the time in UTC. + [b]Note:[/b] Unlike other methods that use integer timestamps, this method returns the timestamp as a [float] for sub-second precision. </description> </method> </methods> diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index 975be428d8..ebe25ed55e 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -21,7 +21,7 @@ <return type="void" /> <argument index="0" name="time_sec" type="float" default="-1" /> <description> - Starts the timer. Sets [code]wait_time[/code] to [code]time_sec[/code] if [code]time_sec > 0[/code]. This also resets the remaining time to [code]wait_time[/code]. + Starts the timer. Sets [member wait_time] to [code]time_sec[/code] if [code]time_sec > 0[/code]. This also resets the remaining time to [member wait_time]. [b]Note:[/b] This method will not resume a paused timer. See [member paused]. </description> </method> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 6c0c3032ec..924b4cd8e4 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -139,16 +139,16 @@ </method> <method name="rotated" qualifiers="const"> <return type="Transform2D" /> - <argument index="0" name="phi" type="float" /> + <argument index="0" name="angle" type="float" /> <description> - Rotates the transform by the given angle (in radians), using matrix multiplication. + Returns a copy of the transform rotated by the given [code]angle[/code] (in radians), using matrix multiplication. </description> </method> <method name="scaled" qualifiers="const"> <return type="Transform2D" /> <argument index="0" name="scale" type="Vector2" /> <description> - Scales the transform by the given scale factor, using matrix multiplication. + Returns a copy of the transform scaled by the given [code]scale[/code] factor, using matrix multiplication. </description> </method> <method name="set_rotation"> @@ -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"> @@ -172,11 +173,11 @@ Sets the transform's skew (in radians). </description> </method> - <method name="translated" qualifiers="const"> + <method name="translated_local" qualifiers="const"> <return type="Transform2D" /> <argument index="0" name="offset" type="Vector2" /> <description> - Translates the transform by the given offset, relative to the transform's basis vectors. + Returns a copy of the transform translated by the given [code]offset[/code], relative to the transform's basis vectors. Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> @@ -206,11 +207,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Transform2D" /> <description> Returns [code]true[/code] if the transforms are not equal. @@ -261,11 +257,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Transform2D" /> <description> Returns [code]true[/code] if the transforms are exactly equal. diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 67e70f30e4..de1db718c2 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -39,6 +39,12 @@ </constructor> <constructor name="Transform3D"> <return type="Transform3D" /> + <argument index="0" name="from" type="Projection" /> + <description> + </description> + </constructor> + <constructor name="Transform3D"> + <return type="Transform3D" /> <argument index="0" name="x_axis" type="Vector3" /> <argument index="1" name="y_axis" type="Vector3" /> <argument index="2" name="z_axis" type="Vector3" /> @@ -94,19 +100,19 @@ <method name="rotated" qualifiers="const"> <return type="Transform3D" /> <argument index="0" name="axis" type="Vector3" /> - <argument index="1" name="phi" type="float" /> + <argument index="1" name="angle" type="float" /> <description> - Rotates the transform around the given axis by the given angle (in radians), using matrix multiplication. The axis must be a normalized vector. + Returns a copy of the transform rotated around the given [code]axis[/code] by the given [code]angle[/code] (in radians), using matrix multiplication. The [code]axis[/code] must be a normalized vector. </description> </method> <method name="scaled" qualifiers="const"> <return type="Transform3D" /> <argument index="0" name="scale" type="Vector3" /> <description> - Scales basis and origin of the transform by the given scale factor, using matrix multiplication. + Returns a copy of the transform with its basis and origin scaled by the given [code]scale[/code] factor, using matrix multiplication. </description> </method> - <method name="sphere_interpolate_with" qualifiers="const"> + <method name="spherical_interpolate_with" qualifiers="const"> <return type="Transform3D" /> <argument index="0" name="xform" type="Transform3D" /> <argument index="1" name="weight" type="float" /> @@ -114,11 +120,11 @@ Returns a transform spherically interpolated between this transform and another by a given [code]weight[/code] (on the range of 0.0 to 1.0). </description> </method> - <method name="translated" qualifiers="const"> + <method name="translated_local" qualifiers="const"> <return type="Transform3D" /> <argument index="0" name="offset" type="Vector3" /> <description> - Translates the transform by the given offset, relative to the transform's basis vectors. + Returns a copy of the transform translated by the given [code]offset[/code], relative to the transform's basis vectors. Unlike [method rotated] and [method scaled], this does not use matrix multiplication. </description> </method> @@ -148,11 +154,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Transform3D" /> <description> Returns [code]true[/code] if the transforms are not equal. @@ -203,11 +204,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Transform3D" /> <description> Returns [code]true[/code] if the transforms are exactly equal. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 25e6f553ca..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" /> @@ -179,8 +165,9 @@ <return type="Rect2" /> <argument index="0" name="item" type="TreeItem" /> <argument index="1" name="column" type="int" default="-1" /> + <argument index="2" name="button_index" type="int" default="-1" /> <description> - Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. + Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned. </description> </method> <method name="get_item_at_position" qualifiers="const"> @@ -306,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"> @@ -323,6 +301,7 @@ <member name="allow_rmb_select" type="bool" setter="set_allow_rmb_select" getter="get_allow_rmb_select" default="false"> If [code]true[/code], a right mouse button click can select items. </member> + <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="column_titles_visible" type="bool" setter="set_column_titles_visible" getter="are_column_titles_visible" default="false"> If [code]true[/code], column titles are visible. </member> @@ -340,7 +319,6 @@ <member name="hide_root" type="bool" setter="set_hide_root" getter="is_root_hidden" default="false"> If [code]true[/code], the tree's root is hidden. </member> - <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="scroll_horizontal_enabled" type="bool" setter="set_h_scroll_enabled" getter="is_h_scroll_enabled" default="true"> If [code]true[/code], enables horizontal scrolling. </member> @@ -352,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> @@ -378,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"> @@ -422,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"> @@ -521,7 +497,7 @@ <theme_item name="draw_relationship_lines" data_type="constant" type="int" default="0"> Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. </theme_item> <theme_item name="item_margin" data_type="constant" type="int" default="16"> @@ -545,7 +521,7 @@ <theme_item name="scroll_speed" data_type="constant" type="int" default="12"> The speed of border scrolling. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> + <theme_item name="v_separation" data_type="constant" type="int" default="4"> The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. </theme_item> <theme_item name="font" data_type="font" type="Font"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index c909a35ab5..fbba1147a2 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -22,7 +22,7 @@ </description> </method> <method name="call_recursive" qualifiers="vararg"> - <return type="Variant" /> + <return type="void" /> <argument index="0" name="method" type="StringName" /> <description> Calls the [code]method[/code] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. @@ -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> @@ -284,7 +269,7 @@ </description> </method> <method name="get_structured_text_bidi_override" qualifiers="const"> - <return type="int" enum="Control.StructuredTextParser" /> + <return type="int" enum="TextServer.StructuredTextParser" /> <argument index="0" name="column" type="int" /> <description> </description> @@ -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" /> @@ -620,7 +596,7 @@ <method name="set_structured_text_bidi_override"> <return type="void" /> <argument index="0" name="column" type="int" /> - <argument index="1" name="parser" type="int" enum="Control.StructuredTextParser" /> + <argument index="1" name="parser" type="int" enum="TextServer.StructuredTextParser" /> <description> </description> </method> @@ -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/TubeTrailMesh.xml b/doc/classes/TubeTrailMesh.xml index 05fcbe967a..ddc544dc97 100644 --- a/doc/classes/TubeTrailMesh.xml +++ b/doc/classes/TubeTrailMesh.xml @@ -11,7 +11,7 @@ </member> <member name="radial_steps" type="int" setter="set_radial_steps" getter="get_radial_steps" default="8"> </member> - <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"> </member> <member name="section_length" type="float" setter="set_section_length" getter="get_section_length" default="0.2"> </member> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 2c152410ce..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. They can't be used for tweening values, but you can do manual interpolation with [method interpolate_value]. - 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] 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 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,12 +67,19 @@ <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="interpolate_value"> + <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. 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> + <method name="interpolate_value" qualifiers="static"> <return type="Variant" /> <argument index="0" name="initial_value" type="Variant" /> <argument index="1" name="delta_value" type="Variant" /> @@ -98,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. You can however still use [method interpolate_value]. + 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"> @@ -145,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"> @@ -214,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 @@ -224,10 +231,10 @@ Example: creating an object that moves back and forth and jumps every few seconds. [codeblock] var tween = create_tween().set_loops() - tween.tween_property("position:x", 200, 1).as_relative() + tween.tween_property($Sprite, "position:x", 200.0, 1).as_relative() tween.tween_callback(jump) tween.tween_interval(2) - tween.tween_property("position:x", -200, 1).as_relative() + tween.tween_property($Sprite, "position:x", -200.0, 1).as_relative() tween.tween_callback(jump) tween.tween_interval(2) [/codeblock] @@ -264,19 +271,19 @@ <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) - tween.tween_property($Sprite, "position", Vector2(200, 300) + tween.tween_property($Sprite, "position", Vector2(100, 200), 1) + tween.tween_property($Sprite, "position", Vector2(200, 300), 1) [/codeblock] will move the sprite to position (100, 200) and then to (200, 300). If you use [method PropertyTweener.from] or [method PropertyTweener.from_current], the starting position will be overwritten by the given value instead. See other methods in [PropertyTweener] to see how the tweening can be tweaked further. [b]Note:[/b] You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using [code]"property:component"[/code] (eg. [code]position:x[/code]), where it would only apply to that particular component. Example: moving object twice from the same position, with different transition types. [codeblock] var tween = create_tween() - tween.tween_property($Sprite, "position", Vector2.RIGHT * 300).as_relative().set_trans(Tween.TRANS_SINE) - tween.tween_property($Sprite, "position", Vector2.RIGHT * 300).as_relative().from_current().set_trans(Tween.TRANS_EXPO) + tween.tween_property($Sprite, "position", Vector2.RIGHT * 300, 1).as_relative().set_trans(Tween.TRANS_SINE) + tween.tween_property($Sprite, "position", Vector2.RIGHT * 300, 1).as_relative().from_current().set_trans(Tween.TRANS_EXPO) [/codeblock] </description> </method> @@ -285,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/Tweener.xml b/doc/classes/Tweener.xml index 3392f9ee23..721ed4e13e 100644 --- a/doc/classes/Tweener.xml +++ b/doc/classes/Tweener.xml @@ -4,7 +4,7 @@ Abstract class for all Tweeners used by [Tween]. </brief_description> <description> - Tweeners are objects that perform a specific animating task, e.g. interpolating a property or calling a method at a given time. A [Tweener] can't be created manually, you need to use a dedicated method from [Tween] or [Node]. + Tweeners are objects that perform a specific animating task, e.g. interpolating a property or calling a method at a given time. A [Tweener] can't be created manually, you need to use a dedicated method from [Tween]. </description> <tutorials> </tutorials> diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml index 4821791f50..a345668f91 100644 --- a/doc/classes/VBoxContainer.xml +++ b/doc/classes/VBoxContainer.xml @@ -7,6 +7,7 @@ Vertical box container. See [BoxContainer]. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> </tutorials> <theme_items> diff --git a/doc/classes/VFlowContainer.xml b/doc/classes/VFlowContainer.xml index d047f4142e..f427276117 100644 --- a/doc/classes/VFlowContainer.xml +++ b/doc/classes/VFlowContainer.xml @@ -9,10 +9,10 @@ <tutorials> </tutorials> <theme_items> - <theme_item name="hseparation" data_type="constant" type="int" default="4"> + <theme_item name="h_separation" data_type="constant" type="int" default="4"> The horizontal separation of children nodes. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> + <theme_item name="v_separation" data_type="constant" type="int" default="4"> The vertical separation of children nodes. </theme_item> </theme_items> diff --git a/doc/classes/VSplitContainer.xml b/doc/classes/VSplitContainer.xml index 32b7637c7e..b933fb2805 100644 --- a/doc/classes/VSplitContainer.xml +++ b/doc/classes/VSplitContainer.xml @@ -7,6 +7,7 @@ Vertical split container. See [SplitContainer]. This goes from top to bottom. </description> <tutorials> + <link title="GUI containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <theme_items> <theme_item name="autohide" data_type="constant" type="int" default="1"> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index f2104d77ab..0d6fcd0ef5 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -25,7 +25,6 @@ - GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. - VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. - C# is statically typed, but uses the Mono [code]object[/code] type in place of Godot's Variant class when it needs to represent a dynamic value. [code]object[/code] is the Mono runtime's equivalent of the same concept. - - The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. The global [method @GlobalScope.typeof] function returns the enumerated value of the Variant type stored in the current variable (see [enum Variant.Type]). [codeblocks] [gdscript] diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index a39ddb8187..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" /> @@ -278,9 +288,9 @@ </method> <method name="rotated" qualifiers="const"> <return type="Vector2" /> - <argument index="0" name="phi" type="float" /> + <argument index="0" name="angle" type="float" /> <description> - Returns the vector rotated by [code]phi[/code] radians. See also [method @GlobalScope.deg2rad]. + Returns the vector rotated by [code]angle[/code] (in radians). See also [method @GlobalScope.deg2rad]. </description> </method> <method name="round" qualifiers="const"> @@ -359,11 +369,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Vector2" /> <description> Returns [code]true[/code] if the vectors are not equal. @@ -461,11 +466,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Vector2" /> <description> Returns [code]true[/code] if the vectors are exactly equal. diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 9b41e01c25..28d68b6e44 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -133,11 +133,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Vector2i" /> <description> Returns [code]true[/code] if the vectors are not equal. @@ -253,11 +248,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Vector2i" /> <description> Returns [code]true[/code] if the vectors are equal. diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index ec695f41c1..c181720a66 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -4,7 +4,7 @@ Vector used for 3D math using floating point coordinates. </brief_description> <description> - 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. + 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. It uses floating-point coordinates. See [Vector3i] for its integer counterpart. [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code]. </description> @@ -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" /> @@ -258,10 +268,10 @@ </method> <method name="rotated" qualifiers="const"> <return type="Vector3" /> - <argument index="0" name="by_axis" type="Vector3" /> - <argument index="1" name="phi" type="float" /> + <argument index="0" name="axis" type="Vector3" /> + <argument index="1" name="angle" type="float" /> <description> - Rotates this vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector. + Rotates this vector around a given axis by [code]angle[/code] (in radians). The axis must be a normalized vector. </description> </method> <method name="round" qualifiers="const"> @@ -360,11 +370,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> Returns [code]true[/code] if the vectors are not equal. @@ -476,11 +481,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> Returns [code]true[/code] if the vectors are exactly equal. diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index e486d7cfec..ebb518792f 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -4,7 +4,7 @@ Vector used for 3D math using integer coordinates. </brief_description> <description> - 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. + 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required. [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code]. </description> @@ -140,11 +140,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="Vector3i" /> <description> Returns [code]true[/code] if the vectors are not equal. @@ -166,7 +161,7 @@ <description> Gets the remainder of each component of the [Vector3i] with the the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. [codeblock] - print(Vector2i(10, -20, 30) % 7) # Prints "(3, -6, 2)" + print(Vector3i(10, -20, 30) % 7) # Prints "(3, -6, 2)" [/codeblock] </description> </operator> @@ -260,11 +255,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="Vector3i" /> <description> Returns [code]true[/code] if the vectors are equal. diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml new file mode 100644 index 0000000000..4df3bbb80e --- /dev/null +++ b/doc/classes/Vector4.xml @@ -0,0 +1,332 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Vector4" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Vector used for 4D math using floating point coordinates. + </brief_description> + <description> + 4-element structure that can be used to represent any quadruplet of numeric values. + It uses floating-point coordinates. See [Vector4i] for its integer counterpart. + [b]Note:[/b] In a boolean context, a Vector4 will evaluate to [code]false[/code] if it's equal to [code]Vector4(0, 0, 0, 0)[/code]. Otherwise, a Vector4 will always evaluate to [code]true[/code]. + </description> + <tutorials> + </tutorials> + <constructors> + <constructor name="Vector4"> + <return type="Vector4" /> + <description> + Constructs a default-initialized [Vector4] with all components set to [code]0[/code]. + </description> + </constructor> + <constructor name="Vector4"> + <return type="Vector4" /> + <argument index="0" name="from" type="Vector4" /> + <description> + Constructs a [Vector4] as a copy of the given [Vector4]. + </description> + </constructor> + <constructor name="Vector4"> + <return type="Vector4" /> + <argument index="0" name="from" type="Vector4i" /> + <description> + Constructs a new [Vector4] from [Vector4i]. + </description> + </constructor> + <constructor name="Vector4"> + <return type="Vector4" /> + <argument index="0" name="x" type="float" /> + <argument index="1" name="y" type="float" /> + <argument index="2" name="z" type="float" /> + <argument index="3" name="w" type="float" /> + <description> + Returns a [Vector4] with the given components. + </description> + </constructor> + </constructors> + <methods> + <method name="abs" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns a new vector with all components in absolute values (i.e. positive). + </description> + </method> + <method name="ceil" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns a new vector with all components rounded up (towards positive infinity). + </description> + </method> + <method name="clamp" qualifiers="const"> + <return type="Vector4" /> + <argument index="0" name="min" type="Vector4" /> + <argument index="1" name="max" type="Vector4" /> + <description> + Returns a new vector with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component. + </description> + </method> + <method name="dot" qualifiers="const"> + <return type="float" /> + <argument index="0" name="with" type="Vector4" /> + <description> + Returns the dot product of this vector and [code]with[/code]. + </description> + </method> + <method name="floor" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns a new vector with all components rounded down (towards negative infinity). + </description> + </method> + <method name="inverse" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns the inverse of the vector. This is the same as [code]Vector4(1.0 / v.x, 1.0 / v.y, 1.0 / v.z, 1.0 / v.w)[/code]. + </description> + </method> + <method name="is_equal_approx" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="with" type="Vector4" /> + <description> + Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. + </description> + </method> + <method name="is_normalized" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the vector is normalized, i.e. its length is equal to 1. + </description> + </method> + <method name="length" qualifiers="const"> + <return type="float" /> + <description> + Returns the length (magnitude) of this vector. + </description> + </method> + <method name="length_squared" qualifiers="const"> + <return type="float" /> + <description> + Returns the squared length (squared magnitude) of this vector. This method runs faster than [method length]. + </description> + </method> + <method name="lerp" qualifiers="const"> + <return type="Vector4" /> + <argument index="0" name="to" type="Vector4" /> + <argument index="1" name="weight" type="float" /> + <description> + Returns the result of the linear interpolation between this vector and [code]to[/code] by amount [code]weight[/code]. [code]weight[/code] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation. + </description> + </method> + <method name="max_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. + </description> + </method> + <method name="min_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_W]. + </description> + </method> + <method name="normalized" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. + </description> + </method> + <method name="round" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero. + </description> + </method> + <method name="sign" qualifiers="const"> + <return type="Vector4" /> + <description> + Returns a new vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component. + </description> + </method> + </methods> + <members> + <member name="w" type="float" setter="" getter="" default="0.0"> + The vector's W component. Also accessible by using the index position [code][3][/code]. + </member> + <member name="x" type="float" setter="" getter="" default="0.0"> + The vector's X component. Also accessible by using the index position [code][0][/code]. + </member> + <member name="y" type="float" setter="" getter="" default="0.0"> + The vector's Y component. Also accessible by using the index position [code][1][/code]. + </member> + <member name="z" type="float" setter="" getter="" default="0.0"> + The vector's Z component. Also accessible by using the index position [code][2][/code]. + </member> + </members> + <constants> + <constant name="AXIS_X" value="0"> + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. + </constant> + <constant name="AXIS_Y" value="1"> + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. + </constant> + <constant name="AXIS_Z" value="2"> + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. + </constant> + <constant name="AXIS_W" value="3"> + Enumerated value for the W axis. Returned by [method max_axis_index] and [method min_axis_index]. + </constant> + <constant name="ZERO" value="Vector4(0, 0, 0)"> + Zero vector, a vector with all components set to [code]0[/code]. + </constant> + <constant name="ONE" value="Vector4(1, 1, 1)"> + One vector, a vector with all components set to [code]1[/code]. + </constant> + <constant name="INF" value="Vector4(inf, inf, inf)"> + Infinity vector, a vector with all components set to [constant @GDScript.INF]. + </constant> + </constants> + <operators> + <operator name="operator !="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Returns [code]true[/code] if the vectors are not equal. + [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Projection" /> + <description> + Inversely transforms (multiplies) the [Vector4] by the given [Projection] matrix. + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Multiplies each component of the [Vector4] by the components of the given [Vector4]. + [codeblock] + print(Vector4(10, 20, 30, 40) * Vector4(3, 4, 5, 6)) # Prints "(30, 80, 150, 240)" + [/codeblock] + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="float" /> + <description> + Multiplies each component of the [Vector4] by the given [float]. + [codeblock] + print(Vector4(10, 20, 30, 40) * 2) # Prints "(20, 40, 60, 80)" + [/codeblock] + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="int" /> + <description> + Multiplies each component of the [Vector4] by the given [int]. + </description> + </operator> + <operator name="operator +"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Adds each component of the [Vector4] by the components of the given [Vector4]. + [codeblock] + print(Vector4(10, 20, 30, 40) + Vector4(3, 4, 5, 6)) # Prints "(13, 24, 35, 46)" + [/codeblock] + </description> + </operator> + <operator name="operator -"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Subtracts each component of the [Vector4] by the components of the given [Vector4]. + [codeblock] + print(Vector4(10, 20, 30, 40) - Vector4(3, 4, 5, 6)) # Prints "(7, 16, 25, 34)" + [/codeblock] + </description> + </operator> + <operator name="operator /"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Divides each component of the [Vector4] by the components of the given [Vector4]. + [codeblock] + print(Vector4(10, 20, 30, 40) / Vector4(2, 5, 3, 4)) # Prints "(5, 4, 10, 10)" + [/codeblock] + </description> + </operator> + <operator name="operator /"> + <return type="Vector4" /> + <argument index="0" name="right" type="float" /> + <description> + Divides each component of the [Vector4] by the given [float]. + [codeblock] + print(Vector4(10, 20, 30, 40) / 2 # Prints "(5, 10, 15, 20)" + [/codeblock] + </description> + </operator> + <operator name="operator /"> + <return type="Vector4" /> + <argument index="0" name="right" type="int" /> + <description> + Divides each component of the [Vector4] by the given [int]. + </description> + </operator> + <operator name="operator <"> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Compares two [Vector4] vectors by first checking if the X value of the left vector is less than the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors. + </description> + </operator> + <operator name="operator <="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Compares two [Vector4] vectors by first checking if the X value of the left vector is less than or equal to the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors. + </description> + </operator> + <operator name="operator =="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Returns [code]true[/code] if the vectors are exactly equal. + [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. + </description> + </operator> + <operator name="operator >"> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Compares two [Vector4] vectors by first checking if the X value of the left vector is greater than the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors. + </description> + </operator> + <operator name="operator >="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4" /> + <description> + Access vector components using their index. [code]v[0][/code] is equivalent to [code]v.x[/code], [code]v[1][/code] is equivalent to [code]v.y[/code], and [code]v[2][/code] is equivalent to [code]v.z[/code]. + </description> + </operator> + <operator name="operator []"> + <return type="float" /> + <argument index="0" name="index" type="int" /> + <description> + Access vector components using their index. [code]v[0][/code] is equivalent to [code]v.x[/code], [code]v[1][/code] is equivalent to [code]v.y[/code], [code]v[2][/code] is equivalent to [code]v.z[/code], and [code]v[3][/code] is equivalent to [code]v.w[/code]. + </description> + </operator> + <operator name="operator unary+"> + <return type="Vector4" /> + <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. + </description> + </operator> + <operator name="operator unary-"> + <return type="Vector4" /> + <description> + Returns the negative value of the [Vector4]. This is the same as writing [code]Vector4(-v.x, -v.y, -v.z, -v.w)[/code]. This operation flips the direction of the vector while keeping the same magnitude. With floats, the number zero can be either positive or negative. + </description> + </operator> + </operators> +</class> diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml new file mode 100644 index 0000000000..3611b17757 --- /dev/null +++ b/doc/classes/Vector4i.xml @@ -0,0 +1,214 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Vector4i" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <constructors> + <constructor name="Vector4i"> + <return type="Vector4i" /> + <description> + </description> + </constructor> + <constructor name="Vector4i"> + <return type="Vector4i" /> + <argument index="0" name="from" type="Vector4i" /> + <description> + </description> + </constructor> + <constructor name="Vector4i"> + <return type="Vector4i" /> + <argument index="0" name="from" type="Vector4" /> + <description> + </description> + </constructor> + <constructor name="Vector4i"> + <return type="Vector4i" /> + <argument index="0" name="x" type="int" /> + <argument index="1" name="y" type="int" /> + <argument index="2" name="z" type="int" /> + <argument index="3" name="w" type="int" /> + <description> + </description> + </constructor> + </constructors> + <methods> + <method name="abs" qualifiers="const"> + <return type="Vector4i" /> + <description> + </description> + </method> + <method name="clamp" qualifiers="const"> + <return type="Vector4i" /> + <argument index="0" name="min" type="Vector4i" /> + <argument index="1" name="max" type="Vector4i" /> + <description> + </description> + </method> + <method name="length" qualifiers="const"> + <return type="float" /> + <description> + </description> + </method> + <method name="length_squared" qualifiers="const"> + <return type="int" /> + <description> + </description> + </method> + <method name="max_axis_index" qualifiers="const"> + <return type="int" /> + <description> + </description> + </method> + <method name="min_axis_index" qualifiers="const"> + <return type="int" /> + <description> + </description> + </method> + <method name="sign" qualifiers="const"> + <return type="Vector4i" /> + <description> + </description> + </method> + </methods> + <members> + <member name="w" type="int" setter="" getter="" default="0"> + </member> + <member name="x" type="int" setter="" getter="" default="0"> + </member> + <member name="y" type="int" setter="" getter="" default="0"> + </member> + <member name="z" type="int" setter="" getter="" default="0"> + </member> + </members> + <constants> + <constant name="AXIS_X" value="0"> + </constant> + <constant name="AXIS_Y" value="1"> + </constant> + <constant name="AXIS_Z" value="2"> + </constant> + <constant name="AXIS_W" value="3"> + </constant> + <constant name="ZERO" value="Vector4i(0, 0, 0)"> + </constant> + <constant name="ONE" value="Vector4i(1, 1, 1)"> + </constant> + </constants> + <operators> + <operator name="operator !="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator %"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator %"> + <return type="Vector4i" /> + <argument index="0" name="right" type="int" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="float" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4i" /> + <argument index="0" name="right" type="int" /> + <description> + </description> + </operator> + <operator name="operator +"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator -"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator /"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator /"> + <return type="Vector4" /> + <argument index="0" name="right" type="float" /> + <description> + </description> + </operator> + <operator name="operator /"> + <return type="Vector4i" /> + <argument index="0" name="right" type="int" /> + <description> + </description> + </operator> + <operator name="operator <"> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator <="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator =="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator >"> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator >="> + <return type="bool" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator []"> + <return type="int" /> + <argument index="0" name="index" type="int" /> + <description> + </description> + </operator> + <operator name="operator unary+"> + <return type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator unary-"> + <return type="Vector4i" /> + <description> + </description> + </operator> + </operators> +</class> 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 033e1ecd29..f6594ff9e7 100644 --- a/doc/classes/VideoStreamPlayer.xml +++ b/doc/classes/VideoStreamPlayer.xml @@ -5,7 +5,7 @@ </brief_description> <description> Control node for playing video streams using [VideoStream] resources. - Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a GDNative plugin using [VideoStreamGDNative]. + Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a GDExtension plugin. [b]Note:[/b] Due to a bug, VideoStreamPlayer does not support localization remapping yet. [b]Warning:[/b] On HTML5, video playback [i]will[/i] perform poorly due to missing architecture-specific assembly optimizations. </description> @@ -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"> @@ -69,7 +69,7 @@ </member> <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position"> The current position of the stream, in seconds. - [b]Note:[/b] Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDNative add-on. + [b]Note:[/b] Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDExtension add-on. </member> <member name="volume" type="float" setter="set_volume" getter="get_volume"> Audio volume as a linear value. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 531b09c6a0..53603b5356 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -1,12 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Viewport" inherits="Node" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Creates a sub-view into the screen. + Base class for viewports. </brief_description> <description> A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera3D 3D nodes will render on it too. Optionally, a viewport can have its own 2D or 3D world, so they don't share what they draw with other viewports. - If a viewport is a child of a [SubViewportContainer], it will automatically take up its size, otherwise it must be set manually. Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it. Also, viewports can be assigned to different screens in case the devices have multiple screens. Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. @@ -58,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" /> @@ -65,28 +71,16 @@ <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> Returns the viewport's texture. - [b]Note:[/b] Due to the way OpenGL works, the resulting [ViewportTexture] is flipped vertically. You can use [method Image.flip_y] on the result of [method Texture2D.get_image] to flip it back, for example: - [codeblocks] - [gdscript] - var img = get_viewport().get_texture().get_image() - img.flip_y() - [/gdscript] - [csharp] - Image img = GetViewport().GetTexture().GetImage(); - img.FlipY(); - [/csharp] - [/codeblocks] + [b]Note:[/b] When trying to store the current texture (e.g. in a file), it might be completely black or outdated if used too early, especially when used in e.g. [method Node._ready]. To make sure the texture you get is correct, you can await [signal RenderingServer.frame_post_draw] signal. + [codeblock] + func _ready(): + await RenderingServer.frame_post_draw + $Viewport.get_texture().get_image().save_png("user://Screenshot.png") + [/codeblock] </description> </method> <method name="get_viewport_rid" qualifiers="const"> @@ -123,6 +117,7 @@ <return type="bool" /> <description> Returns [code]true[/code] if the viewport is currently performing a drag operation. + Alternative to [constant Node.NOTIFICATION_DRAG_BEGIN] and [constant Node.NOTIFICATION_DRAG_END] when you prefer polling the value. </description> </method> <method name="gui_release_focus"> @@ -131,11 +126,6 @@ Removes the focus from the currently focused [Control] within this viewport. If no [Control] has the focus, does nothing. </description> </method> - <method name="is_embedding_subwindows" qualifiers="const"> - <return type="bool" /> - <description> - </description> - </method> <method name="is_input_handled" qualifiers="const"> <return type="bool" /> <description> @@ -168,17 +158,17 @@ 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> </method> <method name="warp_mouse"> <return type="void" /> - <argument index="0" name="to_position" type="Vector2" /> + <argument index="0" name="position" type="Vector2" /> <description> Moves the mouse pointer to the specified position in this [Viewport] using the coordinate system of this [Viewport]. </description> @@ -220,7 +210,8 @@ <member name="gui_disable_input" type="bool" setter="set_disable_input" getter="is_input_disabled" default="false"> If [code]true[/code], the viewport will not receive input events. </member> - <member name="gui_embed_subwindows" type="bool" setter="set_embed_subwindows_hint" getter="get_embed_subwindows_hint" default="false"> + <member name="gui_embed_subwindows" type="bool" setter="set_embedding_subwindows" getter="is_embedding_subwindows" default="false"> + If [code]true[/code], sub-windows (popups and dialogs) will be embedded inside application window as control-like nodes. If [code]false[/code], they will appear as separate windows handled by the operating system. </member> <member name="gui_snap_controls_to_pixels" type="bool" setter="set_snap_controls_to_pixels" getter="is_snap_controls_to_pixels_enabled" default="true"> If [code]true[/code], the GUI controls on the viewport will lay pixel perfectly. @@ -236,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. @@ -257,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"> @@ -288,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> @@ -312,35 +313,35 @@ </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"> - Enables bilinear scaling on 3D viewports. 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. + 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. </constant> <constant name="SCALING_3D_MODE_FSR" value="1" enum="Scaling3DMode"> - Enables FSR upscaling on 3D viewports. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling 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 be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. </constant> <constant name="SCALING_3D_MODE_MAX" value="2" enum="Scaling3DMode"> Represents the size of the [enum Scaling3DMode] enum. @@ -450,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> @@ -495,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/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index e5b7a68a51..87de664aad 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -14,7 +14,6 @@ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link> </tutorials> <members> - <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="true" /> <member name="viewport_path" type="NodePath" setter="set_viewport_path_in_scene" getter="get_viewport_path_in_scene" default="NodePath("")"> The path to the [Viewport] node to display. This is relative to the scene root, not to the node which uses the texture. </member> diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index 1aae85c7e1..2468042850 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -9,6 +9,11 @@ <tutorials> </tutorials> <methods> + <method name="_get_aabb" qualifiers="virtual const"> + <return type="AABB" /> + <description> + </description> + </method> <method name="get_aabb" qualifiers="const"> <return type="AABB" /> <description> @@ -58,9 +63,10 @@ </method> </methods> <members> - <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask" default="1"> + <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 3c5a6f3a33..64d901cd79 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -20,6 +20,14 @@ Adds the specified node to the shader. </description> </method> + <method name="add_varying"> + <return type="void" /> + <argument index="0" name="name" type="String" /> + <argument index="1" name="mode" type="int" enum="VisualShader.VaryingMode" /> + <argument index="2" name="type" type="int" enum="VisualShader.VaryingType" /> + <description> + </description> + </method> <method name="can_connect_nodes" qualifiers="const"> <return type="bool" /> <argument index="0" name="type" type="int" enum="VisualShader.Type" /> @@ -100,6 +108,12 @@ <description> </description> </method> + <method name="has_varying" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="String" /> + <description> + </description> + </method> <method name="is_node_connection" qualifiers="const"> <return type="bool" /> <argument index="0" name="type" type="int" enum="VisualShader.Type" /> @@ -119,6 +133,12 @@ Removes the specified node from the shader. </description> </method> + <method name="remove_varying"> + <return type="void" /> + <argument index="0" name="name" type="String" /> + <description> + </description> + </method> <method name="replace_node"> <return type="void" /> <argument index="0" name="type" type="int" enum="VisualShader.Type" /> @@ -146,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> @@ -182,6 +198,26 @@ <constant name="TYPE_MAX" value="10" enum="Type"> Represents the size of the [enum Type] enum. </constant> + <constant name="VARYING_MODE_VERTEX_TO_FRAG_LIGHT" value="0" enum="VaryingMode"> + </constant> + <constant name="VARYING_MODE_FRAG_TO_LIGHT" value="1" enum="VaryingMode"> + </constant> + <constant name="VARYING_MODE_MAX" value="2" enum="VaryingMode"> + </constant> + <constant name="VARYING_TYPE_FLOAT" value="0" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_VECTOR_2D" value="1" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_VECTOR_3D" value="2" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_VECTOR_4D" value="3" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_COLOR" value="4" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_TRANSFORM" value="5" enum="VaryingType"> + </constant> + <constant name="VARYING_TYPE_MAX" value="6" enum="VaryingType"> + </constant> <constant name="NODE_ID_INVALID" value="-1"> </constant> <constant name="NODE_ID_OUTPUT" value="0"> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index b4a9c85625..7220731a8a 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -78,16 +78,19 @@ <constant name="PORT_TYPE_VECTOR_3D" value="3" enum="PortType"> 3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code. </constant> - <constant name="PORT_TYPE_BOOLEAN" value="4" enum="PortType"> + <constant name="PORT_TYPE_VECTOR_4D" value="4" enum="PortType"> + 4D vector of floating-point values. Translated to [code]vec4[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_BOOLEAN" value="5" enum="PortType"> Boolean type. Translated to [code]bool[/code] type in shader code. </constant> - <constant name="PORT_TYPE_TRANSFORM" value="5" enum="PortType"> + <constant name="PORT_TYPE_TRANSFORM" value="6" enum="PortType"> Transform type. Translated to [code]mat4[/code] type in shader code. </constant> - <constant name="PORT_TYPE_SAMPLER" value="6" enum="PortType"> + <constant name="PORT_TYPE_SAMPLER" value="7" enum="PortType"> Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. </constant> - <constant name="PORT_TYPE_MAX" value="7" enum="PortType"> + <constant name="PORT_TYPE_MAX" value="8" enum="PortType"> Represents the size of the [enum PortType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeClamp.xml b/doc/classes/VisualShaderNodeClamp.xml index fd24b9cfc2..35f50a37c3 100644 --- a/doc/classes/VisualShaderNodeClamp.xml +++ b/doc/classes/VisualShaderNodeClamp.xml @@ -26,7 +26,10 @@ <constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType"> A 3D vector type. </constant> - <constant name="OP_TYPE_MAX" value="4" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="4" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_MAX" value="5" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeColorFunc.xml b/doc/classes/VisualShaderNodeColorFunc.xml index 4a73b1662e..6116e0df68 100644 --- a/doc/classes/VisualShaderNodeColorFunc.xml +++ b/doc/classes/VisualShaderNodeColorFunc.xml @@ -24,7 +24,13 @@ return vec3(max3, max3, max3); [/codeblock] </constant> - <constant name="FUNC_SEPIA" value="1" enum="Function"> + <constant name="FUNC_HSV2RGB" value="1" enum="Function"> + Converts HSV vector to RGB equivalent. + </constant> + <constant name="FUNC_RGB2HSV" value="2" enum="Function"> + Converts RGB vector to HSV equivalent. + </constant> + <constant name="FUNC_SEPIA" value="3" enum="Function"> Applies sepia tone effect using the following formula: [codeblock] vec3 c = input; @@ -34,7 +40,7 @@ return vec3(r, g, b); [/codeblock] </constant> - <constant name="FUNC_MAX" value="2" enum="Function"> + <constant name="FUNC_MAX" value="4" enum="Function"> Represents the size of the [enum Function] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml index d703181e2d..942ced2ebd 100644 --- a/doc/classes/VisualShaderNodeCompare.xml +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -32,13 +32,16 @@ <constant name="CTYPE_VECTOR_3D" value="3" enum="ComparisonType"> A 3D vector type. </constant> - <constant name="CTYPE_BOOLEAN" value="4" enum="ComparisonType"> + <constant name="CTYPE_VECTOR_4D" value="4" enum="ComparisonType"> + A 4D vector type. + </constant> + <constant name="CTYPE_BOOLEAN" value="5" enum="ComparisonType"> A boolean type. </constant> - <constant name="CTYPE_TRANSFORM" value="5" enum="ComparisonType"> + <constant name="CTYPE_TRANSFORM" value="6" enum="ComparisonType"> A transform ([code]mat4[/code]) type. </constant> - <constant name="CTYPE_MAX" value="6" enum="ComparisonType"> + <constant name="CTYPE_MAX" value="7" enum="ComparisonType"> Represents the size of the [enum ComparisonType] enum. </constant> <constant name="FUNC_EQUAL" value="0" enum="Function"> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 7b992abe24..0a962a4aa4 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -44,6 +44,17 @@ Defining this method is [b]optional[/b]. </description> </method> + <method name="_get_func_code" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="mode" type="int" enum="Shader.Mode" /> + <argument index="1" name="type" type="int" enum="VisualShader.Type" /> + <description> + Override this method to add a shader code to the beginning of each shader function (once). The shader code should be returned as a string, which can have multiple lines (the [code]"""[/code] multiline string construct can be used for convenience). + If there are multiple custom nodes of different types which use this feature the order of each insertion is undefined. + You can customize the generated code based on the shader [code]mode[/code] (see [enum Shader.Mode]) and/or [code]type[/code] (see [enum VisualShader.Type]). + Defining this method is [b]optional[/b]. + </description> + </method> <method name="_get_global_code" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="mode" type="int" enum="Shader.Mode" /> @@ -114,11 +125,20 @@ Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. </description> </method> + <method name="_is_available" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="mode" type="int" enum="Shader.Mode" /> + <argument index="1" name="type" type="int" enum="VisualShader.Type" /> + <description> + Override this method to prevent the node to be visible in the member dialog for the certain [code]mode[/code] (see [enum Shader.Mode]) and/or [code]type[/code] (see [enum VisualShader.Type]). + Defining this method is [b]optional[/b]. If not overridden, it's [code]true[/code]. + </description> + </method> <method name="_is_highend" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to enable high-end mark in the Visual Shader Editor's members dialog. - Defining this method is [b]optional[/b]. If not overridden, it's false. + Defining this method is [b]optional[/b]. If not overridden, it's [code]false[/code]. </description> </method> </methods> diff --git a/doc/classes/VisualShaderNodeDerivativeFunc.xml b/doc/classes/VisualShaderNodeDerivativeFunc.xml index ea1153ca25..9a1ad53394 100644 --- a/doc/classes/VisualShaderNodeDerivativeFunc.xml +++ b/doc/classes/VisualShaderNodeDerivativeFunc.xml @@ -26,7 +26,10 @@ <constant name="OP_TYPE_VECTOR_3D" value="2" enum="OpType"> A 3D vector type. </constant> - <constant name="OP_TYPE_MAX" value="3" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="3" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_MAX" value="4" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> <constant name="FUNC_SUM" value="0" enum="Function"> 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/VisualShaderNodeMix.xml b/doc/classes/VisualShaderNodeMix.xml index c8ca545183..3470e47726 100644 --- a/doc/classes/VisualShaderNodeMix.xml +++ b/doc/classes/VisualShaderNodeMix.xml @@ -29,7 +29,13 @@ <constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType"> The [code]a[/code] and [code]b[/code] ports use a 3D vector type. The [code]weight[/code] port uses a scalar type. </constant> - <constant name="OP_TYPE_MAX" value="5" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="5" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_VECTOR_4D_SCALAR" value="6" enum="OpType"> + The [code]a[/code] and [code]b[/code] ports use a 4D vector type. The [code]weight[/code] port uses a scalar type. + </constant> + <constant name="OP_TYPE_MAX" value="7" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeMultiplyAdd.xml b/doc/classes/VisualShaderNodeMultiplyAdd.xml index 811f01fc28..15d0d113e9 100644 --- a/doc/classes/VisualShaderNodeMultiplyAdd.xml +++ b/doc/classes/VisualShaderNodeMultiplyAdd.xml @@ -23,7 +23,10 @@ <constant name="OP_TYPE_VECTOR_3D" value="2" enum="OpType"> A 3D vector type. </constant> - <constant name="OP_TYPE_MAX" value="3" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="3" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_MAX" value="4" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeSmoothStep.xml b/doc/classes/VisualShaderNodeSmoothStep.xml index b10e8b4433..e25fb72921 100644 --- a/doc/classes/VisualShaderNodeSmoothStep.xml +++ b/doc/classes/VisualShaderNodeSmoothStep.xml @@ -30,7 +30,13 @@ <constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType"> The [code]x[/code] port uses a 3D vector type. The first two ports use a floating-point scalar type. </constant> - <constant name="OP_TYPE_MAX" value="5" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="5" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_VECTOR_4D_SCALAR" value="6" enum="OpType"> + The [code]a[/code] and [code]b[/code] ports use a 4D vector type. The [code]weight[/code] port uses a scalar type. + </constant> + <constant name="OP_TYPE_MAX" value="7" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeStep.xml b/doc/classes/VisualShaderNodeStep.xml index 2d9e87e56c..497b86c85f 100644 --- a/doc/classes/VisualShaderNodeStep.xml +++ b/doc/classes/VisualShaderNodeStep.xml @@ -30,7 +30,13 @@ <constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType"> The [code]x[/code] port uses a 3D vector type, while the [code]edge[/code] port uses a floating-point scalar type. </constant> - <constant name="OP_TYPE_MAX" value="5" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="5" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_VECTOR_4D_SCALAR" value="6" enum="OpType"> + The [code]a[/code] and [code]b[/code] ports use a 4D vector type. The [code]weight[/code] port uses a scalar type. + </constant> + <constant name="OP_TYPE_MAX" value="7" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeSwitch.xml b/doc/classes/VisualShaderNodeSwitch.xml index 4cadf79b8e..e74ff6e162 100644 --- a/doc/classes/VisualShaderNodeSwitch.xml +++ b/doc/classes/VisualShaderNodeSwitch.xml @@ -26,13 +26,16 @@ <constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType"> A 3D vector type. </constant> - <constant name="OP_TYPE_BOOLEAN" value="4" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="4" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_BOOLEAN" value="5" enum="OpType"> A boolean type. </constant> - <constant name="OP_TYPE_TRANSFORM" value="5" enum="OpType"> + <constant name="OP_TYPE_TRANSFORM" value="6" enum="OpType"> A transform type. </constant> - <constant name="OP_TYPE_MAX" value="6" enum="OpType"> + <constant name="OP_TYPE_MAX" value="7" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> 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/VisualShaderNodeVarying.xml b/doc/classes/VisualShaderNodeVarying.xml new file mode 100644 index 0000000000..0dbbd61f3a --- /dev/null +++ b/doc/classes/VisualShaderNodeVarying.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVarying" inherits="VisualShaderNode" 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="varying_name" type="String" setter="set_varying_name" getter="get_varying_name" default=""[None]""> + </member> + <member name="varying_type" type="int" setter="set_varying_type" getter="get_varying_type" enum="VisualShader.VaryingType" default="0"> + </member> + </members> +</class> diff --git a/doc/classes/VisualShaderNodeVaryingGetter.xml b/doc/classes/VisualShaderNodeVaryingGetter.xml new file mode 100644 index 0000000000..de30b18d67 --- /dev/null +++ b/doc/classes/VisualShaderNodeVaryingGetter.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVaryingGetter" inherits="VisualShaderNodeVarying" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/VisualShaderNodeVaryingSetter.xml b/doc/classes/VisualShaderNodeVaryingSetter.xml new file mode 100644 index 0000000000..57ead3d82b --- /dev/null +++ b/doc/classes/VisualShaderNodeVaryingSetter.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVaryingSetter" inherits="VisualShaderNodeVarying" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> +</class> diff --git a/doc/classes/VisualShaderNodeVec4Constant.xml b/doc/classes/VisualShaderNodeVec4Constant.xml new file mode 100644 index 0000000000..ed3d8a673d --- /dev/null +++ b/doc/classes/VisualShaderNodeVec4Constant.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVec4Constant" inherits="VisualShaderNodeConstant" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A 4D vector (represented as a [Quaternion]) constant to be used within the visual shader graph. + </brief_description> + <description> + A constant 4D vector (represented as a [Quaternion]), which can be used as an input node. + </description> + <tutorials> + </tutorials> + <members> + <member name="constant" type="Quaternion" setter="set_constant" getter="get_constant" default="Quaternion(0, 0, 0, 1)"> + A 4D vector (represented as a [Quaternion]) constant which represents the state of this node. + </member> + </members> +</class> diff --git a/doc/classes/VisualShaderNodeVec4Uniform.xml b/doc/classes/VisualShaderNodeVec4Uniform.xml new file mode 100644 index 0000000000..5bd13a440b --- /dev/null +++ b/doc/classes/VisualShaderNodeVec4Uniform.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVec4Uniform" inherits="VisualShaderNodeUniform" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A 4D vector (represented as a [Quaternion]) uniform to be used within the visual shader graph. + </brief_description> + <description> + Translated to [code]uniform vec4[/code] in the shader language. + </description> + <tutorials> + </tutorials> + <members> + <member name="default_value" type="Quaternion" setter="set_default_value" getter="get_default_value" default="Quaternion(0, 0, 0, 1)"> + A default value to be assigned within the shader. + </member> + <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false"> + Enables usage of the [member default_value]. + </member> + </members> +</class> diff --git a/doc/classes/VisualShaderNodeVectorBase.xml b/doc/classes/VisualShaderNodeVectorBase.xml index 21f70960ab..d9c9f2d79c 100644 --- a/doc/classes/VisualShaderNodeVectorBase.xml +++ b/doc/classes/VisualShaderNodeVectorBase.xml @@ -19,7 +19,10 @@ <constant name="OP_TYPE_VECTOR_3D" value="1" enum="OpType"> A 3D vector type. </constant> - <constant name="OP_TYPE_MAX" value="2" enum="OpType"> + <constant name="OP_TYPE_VECTOR_4D" value="2" enum="OpType"> + A 4D vector type. + </constant> + <constant name="OP_TYPE_MAX" value="3" enum="OpType"> Represents the size of the [enum OpType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeVectorCompose.xml b/doc/classes/VisualShaderNodeVectorCompose.xml index 87947c088e..b7447894b7 100644 --- a/doc/classes/VisualShaderNodeVectorCompose.xml +++ b/doc/classes/VisualShaderNodeVectorCompose.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeVectorCompose" inherits="VisualShaderNodeVectorBase" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Composes a [Vector3] from three scalars within the visual shader graph. + Composes a [Vector2], [Vector3] or 4D vector (represented as a [Quaternion]) from scalars within the visual shader graph. </brief_description> <description> - Creates a [code]vec3[/code] using three scalar values that can be provided from separate inputs. + Creates a [code]vec2[/code], [code]vec3[/code] or [code]vec4[/code] using scalar values that can be provided from separate inputs. </description> <tutorials> </tutorials> diff --git a/doc/classes/VisualShaderNodeVectorDecompose.xml b/doc/classes/VisualShaderNodeVectorDecompose.xml index f5cff2a9f7..fa18e6b0b9 100644 --- a/doc/classes/VisualShaderNodeVectorDecompose.xml +++ b/doc/classes/VisualShaderNodeVectorDecompose.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeVectorDecompose" inherits="VisualShaderNodeVectorBase" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Decomposes a [Vector3] into three scalars within the visual shader graph. + Decomposes a [Vector2], [Vector3] or 4D vector (represented as a [Quaternion]) into scalars within the visual shader graph. </brief_description> <description> - Takes a [code]vec3[/code] and decomposes it into three scalar values that can be used as separate inputs. + Takes a [code]vec2[/code], [code]vec3[/code] or [code]vec4[/code] and decomposes it into scalar values that can be used as separate outputs. </description> <tutorials> </tutorials> diff --git a/doc/classes/VisualShaderNodeVectorFunc.xml b/doc/classes/VisualShaderNodeVectorFunc.xml index dc6628a9af..7524025f21 100644 --- a/doc/classes/VisualShaderNodeVectorFunc.xml +++ b/doc/classes/VisualShaderNodeVectorFunc.xml @@ -26,100 +26,94 @@ <constant name="FUNC_RECIPROCAL" value="3" enum="Function"> Returns [code]1/vector[/code]. </constant> - <constant name="FUNC_RGB2HSV" value="4" enum="Function"> - Converts RGB vector to HSV equivalent. - </constant> - <constant name="FUNC_HSV2RGB" value="5" enum="Function"> - Converts HSV vector to RGB equivalent. - </constant> - <constant name="FUNC_ABS" value="6" enum="Function"> + <constant name="FUNC_ABS" value="4" enum="Function"> Returns the absolute value of the parameter. </constant> - <constant name="FUNC_ACOS" value="7" enum="Function"> + <constant name="FUNC_ACOS" value="5" enum="Function"> Returns the arc-cosine of the parameter. </constant> - <constant name="FUNC_ACOSH" value="8" enum="Function"> + <constant name="FUNC_ACOSH" value="6" enum="Function"> Returns the inverse hyperbolic cosine of the parameter. </constant> - <constant name="FUNC_ASIN" value="9" enum="Function"> + <constant name="FUNC_ASIN" value="7" enum="Function"> Returns the arc-sine of the parameter. </constant> - <constant name="FUNC_ASINH" value="10" enum="Function"> + <constant name="FUNC_ASINH" value="8" enum="Function"> Returns the inverse hyperbolic sine of the parameter. </constant> - <constant name="FUNC_ATAN" value="11" enum="Function"> + <constant name="FUNC_ATAN" value="9" enum="Function"> Returns the arc-tangent of the parameter. </constant> - <constant name="FUNC_ATANH" value="12" enum="Function"> + <constant name="FUNC_ATANH" value="10" enum="Function"> Returns the inverse hyperbolic tangent of the parameter. </constant> - <constant name="FUNC_CEIL" value="13" enum="Function"> + <constant name="FUNC_CEIL" value="11" enum="Function"> Finds the nearest integer that is greater than or equal to the parameter. </constant> - <constant name="FUNC_COS" value="14" enum="Function"> + <constant name="FUNC_COS" value="12" enum="Function"> Returns the cosine of the parameter. </constant> - <constant name="FUNC_COSH" value="15" enum="Function"> + <constant name="FUNC_COSH" value="13" enum="Function"> Returns the hyperbolic cosine of the parameter. </constant> - <constant name="FUNC_DEGREES" value="16" enum="Function"> + <constant name="FUNC_DEGREES" value="14" enum="Function"> Converts a quantity in radians to degrees. </constant> - <constant name="FUNC_EXP" value="17" enum="Function"> + <constant name="FUNC_EXP" value="15" enum="Function"> Base-e Exponential. </constant> - <constant name="FUNC_EXP2" value="18" enum="Function"> + <constant name="FUNC_EXP2" value="16" enum="Function"> Base-2 Exponential. </constant> - <constant name="FUNC_FLOOR" value="19" enum="Function"> + <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="20" enum="Function"> + <constant name="FUNC_FRACT" value="18" enum="Function"> Computes the fractional part of the argument. </constant> - <constant name="FUNC_INVERSE_SQRT" value="21" enum="Function"> + <constant name="FUNC_INVERSE_SQRT" value="19" enum="Function"> Returns the inverse of the square root of the parameter. </constant> - <constant name="FUNC_LOG" value="22" enum="Function"> + <constant name="FUNC_LOG" value="20" enum="Function"> Natural logarithm. </constant> - <constant name="FUNC_LOG2" value="23" enum="Function"> + <constant name="FUNC_LOG2" value="21" enum="Function"> Base-2 logarithm. </constant> - <constant name="FUNC_RADIANS" value="24" enum="Function"> + <constant name="FUNC_RADIANS" value="22" enum="Function"> Converts a quantity in degrees to radians. </constant> - <constant name="FUNC_ROUND" value="25" enum="Function"> + <constant name="FUNC_ROUND" value="23" enum="Function"> Finds the nearest integer to the parameter. </constant> - <constant name="FUNC_ROUNDEVEN" value="26" enum="Function"> + <constant name="FUNC_ROUNDEVEN" value="24" enum="Function"> Finds the nearest even integer to the parameter. </constant> - <constant name="FUNC_SIGN" value="27" enum="Function"> + <constant name="FUNC_SIGN" value="25" enum="Function"> Extracts the sign of the parameter, i.e. returns [code]-1[/code] if the parameter is negative, [code]1[/code] if it's positive and [code]0[/code] otherwise. </constant> - <constant name="FUNC_SIN" value="28" enum="Function"> + <constant name="FUNC_SIN" value="26" enum="Function"> Returns the sine of the parameter. </constant> - <constant name="FUNC_SINH" value="29" enum="Function"> + <constant name="FUNC_SINH" value="27" enum="Function"> Returns the hyperbolic sine of the parameter. </constant> - <constant name="FUNC_SQRT" value="30" enum="Function"> + <constant name="FUNC_SQRT" value="28" enum="Function"> Returns the square root of the parameter. </constant> - <constant name="FUNC_TAN" value="31" enum="Function"> + <constant name="FUNC_TAN" value="29" enum="Function"> Returns the tangent of the parameter. </constant> - <constant name="FUNC_TANH" value="32" enum="Function"> + <constant name="FUNC_TANH" value="30" enum="Function"> Returns the hyperbolic tangent of the parameter. </constant> - <constant name="FUNC_TRUNC" value="33" enum="Function"> + <constant name="FUNC_TRUNC" value="31" enum="Function"> Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. </constant> - <constant name="FUNC_ONEMINUS" value="34" enum="Function"> + <constant name="FUNC_ONEMINUS" value="32" enum="Function"> Returns [code]1.0 - vector[/code]. </constant> - <constant name="FUNC_MAX" value="35" enum="Function"> + <constant name="FUNC_MAX" value="33" enum="Function"> Represents the size of the [enum Function] enum. </constant> </constants> 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 912d3cb16c..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,26 +324,37 @@ 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. </member> @@ -313,86 +362,117 @@ 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"> <argument index="0" name="files" type="PackedStringArray" /> <description> + Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths. + Note that this method only works with non-embedded windows, i.e. the main window and [Window]-derived nodes when [member Viewport.gui_embed_subwindows] is disabled in the main viewport. + Example usage: + [codeblock] + func _ready(): + get_viewport().files_dropped.connect(on_files_dropped) + + func on_files_dropped(files): + print(files) + [/codeblock] </description> </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. @@ -404,35 +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="5" enum="Flags"> + <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. @@ -449,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_ofs" data_type="constant" type="int" default="18"> + <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_ofs" data_type="constant" type="int" default="24"> + <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/WorkerThreadPool.xml b/doc/classes/WorkerThreadPool.xml new file mode 100644 index 0000000000..4f614bdadb --- /dev/null +++ b/doc/classes/WorkerThreadPool.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="WorkerThreadPool" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_group_task"> + <return type="int" /> + <argument index="0" name="action" type="Callable" /> + <argument index="1" name="elements" type="int" /> + <argument index="2" name="tasks_needed" type="int" default="-1" /> + <argument index="3" name="high_priority" type="bool" default="false" /> + <argument index="4" name="description" type="String" default="""" /> + <description> + </description> + </method> + <method name="add_task"> + <return type="int" /> + <argument index="0" name="action" type="Callable" /> + <argument index="1" name="high_priority" type="bool" default="false" /> + <argument index="2" name="description" type="String" default="""" /> + <description> + </description> + </method> + <method name="get_group_processed_element_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="group_id" type="int" /> + <description> + </description> + </method> + <method name="is_group_task_completed" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="group_id" type="int" /> + <description> + </description> + </method> + <method name="is_task_completed" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="task_id" type="int" /> + <description> + </description> + </method> + <method name="wait_for_group_task_completion"> + <return type="void" /> + <argument index="0" name="group_id" type="int" /> + <description> + </description> + </method> + <method name="wait_for_task_completion"> + <return type="void" /> + <argument index="0" name="task_id" type="int" /> + <description> + </description> + </method> + </methods> +</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/WorldBoundaryShape2D.xml b/doc/classes/WorldBoundaryShape2D.xml index cfcaede4a6..5a655520c3 100644 --- a/doc/classes/WorldBoundaryShape2D.xml +++ b/doc/classes/WorldBoundaryShape2D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="WorldBoundaryShape2D" inherits="Shape2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - World boundary shape for 2D collisions. + World boundary (infinite plane) shape resource for 2D physics. </brief_description> <description> - World boundary shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. + 2D world boundary shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. [WorldBoundaryShape2D] works like an infinite plane and will not allow any physics body to go to the negative side. Note that the [member normal] matters; anything "below" the plane will collide with it. If the [WorldBoundaryShape2D] is used in a [PhysicsBody2D], it will cause colliding objects placed "below" it to teleport "above" the plane. + [b]Performance:[/b] Being a primitive collision shape, [WorldBoundaryShape2D] is fast to check collisions against. </description> <tutorials> </tutorials> diff --git a/doc/classes/WorldBoundaryShape3D.xml b/doc/classes/WorldBoundaryShape3D.xml index a05c404125..4f6b987a8e 100644 --- a/doc/classes/WorldBoundaryShape3D.xml +++ b/doc/classes/WorldBoundaryShape3D.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="WorldBoundaryShape3D" inherits="Shape3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - World boundary shape for 3D collisions. + World boundary (infinite plane) shape resource for 3D physics. </brief_description> <description> - World boundary shape for 3D collisions. It works like an infinite plane and will not allow any physics body to go to the negative side. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [WorldBoundaryShape3D] is used in a [PhysicsBody3D], it will cause colliding objects placed "below" it to teleport "above" the plane. + 3D world boundary shape to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. [WorldBoundaryShape3D] works like an infinite plane and will not allow any physics body to go to the negative side. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [WorldBoundaryShape3D] is used in a [PhysicsBody3D], it will cause colliding objects placed "below" it to teleport "above" the plane. + [b]Performance:[/b] Being a primitive collision shape, [WorldBoundaryShape3D] is fast to check collisions against. </description> <tutorials> </tutorials> 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/XRCamera3D.xml b/doc/classes/XRCamera3D.xml index e0fc016a7d..4d6baa327b 100644 --- a/doc/classes/XRCamera3D.xml +++ b/doc/classes/XRCamera3D.xml @@ -8,6 +8,6 @@ The position and orientation of this node is automatically updated by the XR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for rendering as a result. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> </class> diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml index a77f8cf9ca..ff4aec46e1 100644 --- a/doc/classes/XRController3D.xml +++ b/doc/classes/XRController3D.xml @@ -10,7 +10,7 @@ As many XR runtimes now use a configurable action map all inputs are named. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> <method name="get_axis" qualifiers="const"> @@ -41,12 +41,6 @@ </description> </method> </methods> - <members> - <member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0"> - The degree to which the controller vibrates. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member XRPositionalTracker.rumble] accordingly. - This is a useful property to animate if you want the controller to vibrate for a limited duration. - </member> - </members> <signals> <signal name="button_pressed"> <argument index="0" name="name" type="String" /> diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index 623e4f5fbc..26b7699af2 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -4,11 +4,11 @@ Base class for an XR interface implementation. </brief_description> <description> - This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass XRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. + This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDExtension modules. Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through [XRServer]. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> <method name="get_camera_feed_id"> 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> diff --git a/doc/classes/XROrigin3D.xml b/doc/classes/XROrigin3D.xml index b7811f4d53..7acee097e7 100644 --- a/doc/classes/XROrigin3D.xml +++ b/doc/classes/XROrigin3D.xml @@ -10,7 +10,7 @@ For example, if your character is driving a car, the XROrigin3D node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <members> <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0"> diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml index c544ef3cfa..c146b27fcb 100644 --- a/doc/classes/XRPositionalTracker.xml +++ b/doc/classes/XRPositionalTracker.xml @@ -9,7 +9,7 @@ The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> <method name="get_input" qualifiers="const"> @@ -72,8 +72,8 @@ - [code]left_hand[/code] identifies the controller held in the players left hand - [code]right_hand[/code] identifies the controller held in the players right hand </member> - <member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0"> - The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. + <member name="profile" type="String" setter="set_tracker_profile" getter="get_tracker_profile" default=""""> + The profile associated with this tracker, interface dependent but will indicate the type of controller being tracked. </member> <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" enum="XRServer.TrackerType" default="128"> The type of tracker. @@ -112,6 +112,12 @@ Emitted when the state of a pose tracked by this tracker changes. </description> </signal> + <signal name="profile_changed"> + <argument index="0" name="role" type="String" /> + <description> + Emitted when the profile of our tracker changes. + </description> + </signal> </signals> <constants> <constant name="TRACKER_HAND_UNKNOWN" value="0" enum="TrackerHand"> diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index a322a3c5c9..d3cb958cbc 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -7,7 +7,7 @@ The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. </description> <tutorials> - <link title="VR documentation index">$DOCS_URL/tutorials/vr/index.html</link> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> <method name="add_interface"> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index 6b1243b8c0..374b703636 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -123,11 +123,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="bool" /> <description> Returns [code]true[/code] if two bools are different, i.e. one is [code]true[/code] and the other is [code]false[/code]. @@ -142,12 +137,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - Returns [code]true[/code] if two bools are equal, i.e. both are [code]true[/code] or both are [code]false[/code]. - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="bool" /> <description> Returns [code]true[/code] if two bools are equal, i.e. both are [code]true[/code] or both are [code]false[/code]. diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 1fe234c567..a7c6533ef5 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -44,11 +44,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="float" /> <description> Returns [code]true[/code] if two floats are different from each other. @@ -116,6 +111,18 @@ </description> </operator> <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator *"> <return type="float" /> <argument index="0" name="right" type="float" /> <description> @@ -129,6 +136,18 @@ Multiplies a [float] and an [int]. The result is a [float]. </description> </operator> + <operator name="operator **"> + <return type="float" /> + <argument index="0" name="right" type="float" /> + <description> + </description> + </operator> + <operator name="operator **"> + <return type="float" /> + <argument index="0" name="right" type="int" /> + <description> + </description> + </operator> <operator name="operator +"> <return type="float" /> <argument index="0" name="right" type="float" /> @@ -201,11 +220,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="float" /> <description> Returns [code]true[/code] if both floats are exactly equal. diff --git a/doc/classes/int.xml b/doc/classes/int.xml index eac7ee8dfd..6b492ca923 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -70,11 +70,6 @@ <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="float" /> <description> Returns [code]true[/code] if operands are different from each other. @@ -163,6 +158,18 @@ </description> </operator> <operator name="operator *"> + <return type="Vector4" /> + <argument index="0" name="right" type="Vector4" /> + <description> + </description> + </operator> + <operator name="operator *"> + <return type="Vector4i" /> + <argument index="0" name="right" type="Vector4i" /> + <description> + </description> + </operator> + <operator name="operator *"> <return type="float" /> <argument index="0" name="right" type="float" /> <description> @@ -176,6 +183,18 @@ Multiplies two [int]s. </description> </operator> + <operator name="operator **"> + <return type="float" /> + <argument index="0" name="right" type="float" /> + <description> + </description> + </operator> + <operator name="operator **"> + <return type="int" /> + <argument index="0" name="right" type="int" /> + <description> + </description> + </operator> <operator name="operator +"> <return type="String" /> <argument index="0" name="right" type="String" /> @@ -273,11 +292,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="float" /> <description> Returns [code]true[/code] if the integer is equal to the given [float]. |