diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index c4b1bba0d..85a5330a7 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -76,11 +76,11 @@ Constants - **INF** = **inf** --- Positive floating-point infinity. This is the result of floating-point division when the divisor is ``0.0``. For negative infinity, use ``-INF``. Dividing by ``-0.0`` will result in negative infinity if the numerator is positive, so dividing by ``0.0`` is not the same as dividing by ``-0.0`` (despite ``0.0 == -0.0`` returning ``true``). -\ **Note:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by ``0`` will not result in :ref:`INF` and will result in a run-time error instead. +\ **Warning:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by ``0`` will not result in :ref:`INF` and will result in a run-time error instead. - **NAN** = **nan** --- "Not a Number", an invalid floating-point value. :ref:`NAN` has special properties, including that it is not equal to itself (``NAN == NAN`` returns ``false``). It is output by some invalid operations, such as dividing floating-point ``0.0`` by ``0.0``. -\ **Note:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer ``0`` by ``0`` will not result in :ref:`NAN` and will result in a run-time error instead. +\ **Warning:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer ``0`` by ``0`` will not result in :ref:`NAN` and will result in a run-time error instead. Annotations ----------- @@ -120,7 +120,7 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_CATEGORY` property without an alpha (fixed as ``1.0``). +Export a :ref:`Color` property without transparency (its alpha fixed as ``1.0``). See also :ref:`@GlobalScope.PROPERTY_HINT_COLOR_NO_ALPHA`. @@ -156,7 +156,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_ENUM` to add subgroups to your groups. +Groups cannot be nested, use :ref:`@export_subgroup` to add subgroups within groups. See also :ref:`@GlobalScope.PROPERTY_USAGE_GROUP`. @@ -359,7 +359,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_MULTILINE_TEXT` icon_path **)** -Add a custom icon to the current script. The icon is displayed in the Scene dock for every node that the script is attached to. For named classes the icon is also displayed in various editor dialogs. +Add a custom icon to the current script. After loading an icon at ``icon_path``, the icon is displayed in the Scene dock for every node that the script is attached to. For named classes, the icon is also displayed in various editor dialogs. :: @icon("res://path/to/class/icon.svg") -\ **Note:** Only the script can have a custom icon. Inner classes are not supported yet. +\ **Note:** Only the script can have a custom icon. Inner classes are not supported. ---- @@ -495,7 +495,7 @@ Mark the current script as a tool script, allowing it to be loaded and executed - **@warning_ignore** **(** :ref:`String` warning, ... **)** |vararg| -Mark the following statement to ignore the specified warning. See :doc:`GDScript warning system <../tutorials/scripting/gdscript/warning_system>`. +Mark the following statement to ignore the specified ``warning``. See :doc:`GDScript warning system <../tutorials/scripting/gdscript/warning_system>`. :: @@ -512,19 +512,13 @@ Method Descriptions - :ref:`Color` **Color8** **(** :ref:`int` r8, :ref:`int` g8, :ref:`int` b8, :ref:`int` a8=255 **)** -Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. - -\ ``r8`` red channel - -\ ``g8`` green channel - -\ ``b8`` blue channel - -\ ``a8`` alpha channel +Returns a :ref:`Color` constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value. :: - red = Color8(255, 0, 0) + var red = Color8(255, 0, 0) # Same as Color(1, 0, 0) + var dark_blue = Color8(0, 0, 51) # Same as Color(0, 0, 0.2). + var my_color = Color8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4). ---- @@ -534,9 +528,9 @@ Returns a color constructed from integer red, green, blue, and alpha channels. E Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`@GlobalScope.push_error` for reporting errors to project developers or add-on users. -\ **Note:** For performance reasons, the code inside :ref:`assert` is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an :ref:`assert` call. Otherwise, the project will behave differently when exported in release mode. +An optional ``message`` can be shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. -The optional ``message`` argument, if given, is shown in addition to the generic "Assertion failed" message. It must be a static string, so format strings can't be used. You can use this to provide additional details about why the assertion failed. +\ **Warning:** For performance reasons, the code inside :ref:`assert` is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an :ref:`assert` call. Otherwise, the project will behave differently when exported in release mode. :: @@ -553,7 +547,7 @@ The optional ``message`` argument, if given, is shown in addition to the generic - :ref:`String` **char** **(** :ref:`int` char **)** -Returns a character as a String of the given Unicode code point (which is compatible with ASCII code). +Returns a single character (as a :ref:`String`) of the given Unicode code point (which is compatible with ASCII code). :: @@ -567,16 +561,16 @@ Returns a character as a String of the given Unicode code point (which is compat - :ref:`Variant` **convert** **(** :ref:`Variant` what, :ref:`int` type **)** -Converts from a type to another in the best way possible. The ``type`` parameter uses the :ref:`Variant.Type` values. +Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :ref:`Variant.Type` values. :: - a = Vector2(1, 0) - # Prints 1 - print(a.length()) - a = convert(a, TYPE_STRING) - # Prints 6 as "(1, 0)" is 6 characters - print(a.length()) + var a = [4, 2.5, 1.2] + print(a is Array) # Prints true + + var b = convert(a, TYPE_PACKED_BYTE_ARRAY) + print(b) # Prints [4, 2, 1] + print(b is Array) # Prints false ---- @@ -584,7 +578,7 @@ Converts from a type to another in the best way possible. The ``type`` parameter - :ref:`Object` **dict_to_inst** **(** :ref:`Dictionary` dictionary **)** -Converts a ``dictionary`` (previously created with :ref:`inst_to_dict`) back to an Object instance. Useful for deserializing. +Converts a ``dictionary`` (created with :ref:`inst_to_dict`) back to an Object instance. Can be useful for deserializing. ---- @@ -605,15 +599,15 @@ Returns an array of dictionaries representing the current call stack. See also : func bar(): print(get_stack()) -would print +Starting from ``_ready()``, ``bar()`` would print: :: [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] -\ **Note:** :ref:`get_stack` only works if the running instance is connected to a debugging server (i.e. an editor instance). :ref:`get_stack` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server. +\ **Note:** This function only works if the running instance is connected to a debugging server (i.e. an editor instance). :ref:`get_stack` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server. -\ **Note:** Not supported for calling from threads. Instead, this will return an empty array. +\ **Note:** Calling this function from a :ref:`Thread` is not supported. Doing so will return an empty array. ---- @@ -621,7 +615,7 @@ would print - :ref:`Dictionary` **inst_to_dict** **(** :ref:`Object` instance **)** -Returns the passed ``instance`` converted to a Dictionary (useful for serializing). +Returns the passed ``instance`` converted to a Dictionary. Can be useful for serializing. :: @@ -644,14 +638,15 @@ Prints out: - :ref:`int` **len** **(** :ref:`Variant` var **)** -Returns length of Variant ``var``. Length is the character count of String, element count of Array, size of Dictionary, etc. - -\ **Note:** Generates a fatal error if Variant can not provide a length. +Returns the length of the given Variant ``var``. The length can be the character count of a :ref:`String`, the element count of any array type or the size of a :ref:`Dictionary`. For every other Variant type, a run-time error is generated and execution is stopped. :: a = [1, 2, 3, 4] len(a) # Returns 4 + + b = "Hello!" + len(b) # Returns 6 ---- @@ -659,20 +654,20 @@ Returns length of Variant ``var``. Length is the character count of String, elem - :ref:`Resource` **load** **(** :ref:`String` path **)** -Loads a resource from the filesystem located at ``path``. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. +Returns a :ref:`Resource` from the filesystem located at the absolute ``path``. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. \ **Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. :: - # Load a scene called main located in the root of the project directory and cache it in a variable. + # Load a scene called "main" located in the root of the project directory and cache it in a variable. var main = load("res://main.tscn") # main will contain a PackedScene resource. -\ **Important:** The path must be absolute, a local path will just return ``null``. +\ **Important:** The path must be absolute. A relative path will always return ``null``. -This method is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. +This function is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. -\ **Note:** You have to import the files into the engine first to load them using :ref:`load`. If you want to load :ref:`Image`\ s at run-time, you may use :ref:`Image.load`. If you want to import audio files, you can use the snippet described in :ref:`AudioStreamMP3.data`. +\ **Note:** Files have to be imported into the engine first to load them using this function. If you want to load :ref:`Image`\ s at run-time, you may use :ref:`Image.load`. If you want to import audio files, you can use the snippet described in :ref:`AudioStreamMP3.data`. ---- @@ -680,13 +675,13 @@ This method is a simplified version of :ref:`ResourceLoader.load` **preload** **(** :ref:`String` path **)** -Returns a :ref:`Resource` from the filesystem located at ``path``. The resource is loaded during script parsing, i.e. is loaded with the script and :ref:`preload` effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use :ref:`load`. +Returns a :ref:`Resource` from the filesystem located at ``path``. During run-time, the resource is loaded when the script is being parsed. This function effectively acts as a reference to that resource. Note that this function requires ``path`` to be a constant :ref:`String`. If you want to load a resource from a dynamic/variable path, use :ref:`load`. \ **Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. :: - # Instance a scene. + # Create instance of a scene. var diamond = preload("res://diamond.tscn").instantiate() ---- @@ -697,14 +692,14 @@ Returns a :ref:`Resource` from the filesystem located at ``path` Like :ref:`@GlobalScope.print`, but includes the current stack frame when running with the debugger turned on. -Output in the console would look something like this: +The output in the console may look like the following: :: Test print - At: res://test.gd:15:_process() + At: res://test.gd:15:_process() -\ **Note:** Not supported for calling from threads. Instead of the stack frame, this will print the thread ID. +\ **Note:** Calling this function from a :ref:`Thread` is not supported. Doing so will instead print the thread ID. ---- @@ -714,15 +709,15 @@ Output in the console would look something like this: Prints a stack trace at the current code location. See also :ref:`get_stack`. -Output in the console would look something like this: +The output in the console may look like the following: :: Frame 0 - res://test.gd:16 in function '_process' -\ **Note:** :ref:`print_stack` only works if the running instance is connected to a debugging server (i.e. an editor instance). :ref:`print_stack` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server. +\ **Note:** This function only works if the running instance is connected to a debugging server (i.e. an editor instance). :ref:`print_stack` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server. -\ **Note:** Not supported for calling from threads. Instead of the stack trace, this will print the thread ID. +\ **Note:** Calling this function from a :ref:`Thread` is not supported. Doing so will instead print the thread ID. ---- @@ -788,7 +783,7 @@ Output: - :ref:`String` **str** **(** ... **)** |vararg| -Converts one or more arguments to string in the best way possible. +Converts one or more arguments to a :ref:`String` in the best way possible. :: @@ -803,7 +798,7 @@ Converts one or more arguments to string in the best way possible. - :ref:`bool` **type_exists** **(** :ref:`StringName` type **)** -Returns whether the given :ref:`Object`-derived class exists in :ref:`ClassDB`. Note that :ref:`Variant` data types are not registered in :ref:`ClassDB`. +Returns ``true`` if the given :ref:`Object`-derived class exists in :ref:`ClassDB`. Note that :ref:`Variant` data types are not registered in :ref:`ClassDB`. :: diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 74e7ac228..9a1dbdc9f 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -179,6 +179,8 @@ Methods +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`float` a, :ref:`float` b **)** | +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** :ref:`float` x **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_inf` **(** :ref:`float` x **)** | +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_instance_id_valid` **(** :ref:`int` id **)** | @@ -381,9 +383,9 @@ enum **Orientation**: enum **ClockDirection**: -- **CLOCKWISE** = **0** +- **CLOCKWISE** = **0** --- Clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90`). -- **COUNTERCLOCKWISE** = **1** +- **COUNTERCLOCKWISE** = **1** --- Counter-clockwise rotation. Used by some methods (e.g. :ref:`Image.rotate_90`). ---- @@ -485,6 +487,36 @@ enum **InlineAlignment**: ---- +.. _enum_@GlobalScope_EulerOrder: + +.. _class_@GlobalScope_constant_EULER_ORDER_XYZ: + +.. _class_@GlobalScope_constant_EULER_ORDER_XZY: + +.. _class_@GlobalScope_constant_EULER_ORDER_YXZ: + +.. _class_@GlobalScope_constant_EULER_ORDER_YZX: + +.. _class_@GlobalScope_constant_EULER_ORDER_ZXY: + +.. _class_@GlobalScope_constant_EULER_ORDER_ZYX: + +enum **EulerOrder**: + +- **EULER_ORDER_XYZ** = **0** --- Specifies that Euler angles should be in XYZ order. When composing, the order is X, Y, Z. When decomposing, the order is reversed, first Z, then Y, and X last. + +- **EULER_ORDER_XZY** = **1** --- Specifies that Euler angles should be in XZY order. When composing, the order is X, Z, Y. When decomposing, the order is reversed, first Y, then Z, and X last. + +- **EULER_ORDER_YXZ** = **2** --- Specifies that Euler angles should be in YXZ order. When composing, the order is Y, X, Z. When decomposing, the order is reversed, first Z, then X, and Y last. + +- **EULER_ORDER_YZX** = **3** --- Specifies that Euler angles should be in YZX order. When composing, the order is Y, Z, X. When decomposing, the order is reversed, first X, then Z, and Y last. + +- **EULER_ORDER_ZXY** = **4** --- Specifies that Euler angles should be in ZXY order. When composing, the order is Z, X, Y. When decomposing, the order is reversed, first Y, then X, and Z last. + +- **EULER_ORDER_ZYX** = **5** --- Specifies that Euler angles should be in ZYX order. When composing, the order is Z, Y, X. When decomposing, the order is reversed, first X, then Y, and Z last. + +---- + .. _enum_@GlobalScope_Key: .. _class_@GlobalScope_constant_KEY_NONE: @@ -1303,25 +1335,25 @@ enum **Key**: - **KEY_SLASH** = **47** --- / key. -- **KEY_0** = **48** --- Number 0. +- **KEY_0** = **48** --- Number 0 key. -- **KEY_1** = **49** --- Number 1. +- **KEY_1** = **49** --- Number 1 key. -- **KEY_2** = **50** --- Number 2. +- **KEY_2** = **50** --- Number 2 key. -- **KEY_3** = **51** --- Number 3. +- **KEY_3** = **51** --- Number 3 key. -- **KEY_4** = **52** --- Number 4. +- **KEY_4** = **52** --- Number 4 key. -- **KEY_5** = **53** --- Number 5. +- **KEY_5** = **53** --- Number 5 key. -- **KEY_6** = **54** --- Number 6. +- **KEY_6** = **54** --- Number 6 key. -- **KEY_7** = **55** --- Number 7. +- **KEY_7** = **55** --- Number 7 key. -- **KEY_8** = **56** --- Number 8. +- **KEY_8** = **56** --- Number 8 key. -- **KEY_9** = **57** --- Number 9. +- **KEY_9** = **57** --- Number 9 key. - **KEY_COLON** = **58** --- : key. @@ -1621,9 +1653,9 @@ enum **MouseButton**: - **MOUSE_BUTTON_NONE** = **0** --- Enum value which doesn't correspond to any mouse button. This is used to initialize :ref:`MouseButton` properties with a generic state. -- **MOUSE_BUTTON_LEFT** = **1** --- Primary mouse button, usually the left button. +- **MOUSE_BUTTON_LEFT** = **1** --- Primary mouse button, usually assigned to the left button. -- **MOUSE_BUTTON_RIGHT** = **2** --- Secondary mouse button, usually the right button. +- **MOUSE_BUTTON_RIGHT** = **2** --- Secondary mouse button, usually assigned to the right button. - **MOUSE_BUTTON_MIDDLE** = **3** --- Middle mouse button. @@ -1635,9 +1667,9 @@ enum **MouseButton**: - **MOUSE_BUTTON_WHEEL_RIGHT** = **7** --- Mouse wheel right button (only present on some mice). -- **MOUSE_BUTTON_XBUTTON1** = **8** --- Extra mouse button 1 (only present on some mice). +- **MOUSE_BUTTON_XBUTTON1** = **8** --- Extra mouse button 1. This is sometimes present, usually to the sides of the mouse. -- **MOUSE_BUTTON_XBUTTON2** = **9** --- Extra mouse button 2 (only present on some mice). +- **MOUSE_BUTTON_XBUTTON2** = **9** --- Extra mouse button 2. This is sometimes present, usually to the sides of the mouse. - **MOUSE_BUTTON_MASK_LEFT** = **1** --- Primary mouse button mask, usually for the left button. @@ -1735,7 +1767,7 @@ enum **JoyButton**: - **JOY_BUTTON_DPAD_RIGHT** = **14** --- Game controller D-pad right button. -- **JOY_BUTTON_MISC1** = **15** --- Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo capture button. +- **JOY_BUTTON_MISC1** = **15** --- Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo Switch capture button. - **JOY_BUTTON_PADDLE1** = **16** --- Game controller SDL paddle 1 button. @@ -1751,11 +1783,11 @@ enum **JoyButton**: - **JOY_BUTTON_MAX** = **128** --- The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: - - Android: Up to 36 buttons. + - **Android:** Up to 36 buttons. - - Linux: Up to 80 buttons. + - **Linux:** Up to 80 buttons. - - Windows and macOS: Up to 128 buttons. + - **Windows** and **macOS:** Up to 128 buttons. ---- @@ -1985,18 +2017,23 @@ enum **MIDIMessage**: enum **Error**: -- **OK** = **0** --- Methods that return :ref:`Error` return :ref:`OK` when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. +- **OK** = **0** --- Methods that return :ref:`Error` return :ref:`OK` when no error occurred. -Since :ref:`OK` has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: +Since :ref:`OK` has value 0, and all other error constants are positive integers, it can also be used in boolean checks. + +\ **Example:**\ :: - var err = method_that_returns_error() - if err != OK: - print("Failure!") - # Or, equivalent: - if err: - print("Still failing!") + var error = method_that_returns_error() + if error != OK: + printerr("Failure!") + + # Or, alternatively: + if error: + printerr("Still failing!") + +\ **Note:** Many functions do not return an error code, but will print error messages to standard output. - **FAILED** = **1** --- Generic error. @@ -2088,11 +2125,13 @@ Since :ref:`OK` has value 0, and all other failu - **ERR_SKIP** = **45** --- Skip error. -- **ERR_HELP** = **46** --- Help error. +- **ERR_HELP** = **46** --- Help error. Used internally when passing ``--version`` or ``--help`` as executable options. -- **ERR_BUG** = **47** --- Bug error. +- **ERR_BUG** = **47** --- Bug error, caused by an implementation issue in the method. -- **ERR_PRINTER_ON_FIRE** = **48** --- Printer on fire error. (This is an easter egg, no engine methods return this error code.) +\ **Note:** If a built-in method returns this code, please open an issue on `the GitHub Issue Tracker `__. + +- **ERR_PRINTER_ON_FIRE** = **48** --- Printer on fire error (This is an easter egg, no built-in methods return this error code). ---- @@ -2196,72 +2235,76 @@ Since :ref:`OK` has value 0, and all other failu enum **PropertyHint**: -- **PROPERTY_HINT_NONE** = **0** --- No hint for the edited property. +- **PROPERTY_HINT_NONE** = **0** --- The property has no hint for the editor. -- **PROPERTY_HINT_RANGE** = **1** --- Hints that an integer or float property should be within a range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_less"`` to allow manual input going respectively above the max or below the min values. Example: ``"-360,360,1,or_greater,or_less"``. +- **PROPERTY_HINT_RANGE** = **1** --- Hints that an :ref:`int` or :ref:`float` property should be within a range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_less"`` to allow manual input going respectively above the max or below the min values. + +\ **Example:** ``"-360,360,1,or_greater,or_less"``. 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 ``"hide_slider"`` to hide the slider. -- **PROPERTY_HINT_ENUM** = **2** --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string. +- **PROPERTY_HINT_ENUM** = **2** --- Hints that an :ref:`int`, :ref:`float`, or :ref:`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 ``"Hello,Something,Else"``. Whitespaces are **not** removed from either end of a name. 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 ``:integer`` to the name, e.g. ``"Zero,One,Three:3,Four,Six:6"``. -- **PROPERTY_HINT_ENUM_SUGGESTION** = **3** --- Hints that a string property can be an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. +- **PROPERTY_HINT_ENUM_SUGGESTION** = **3** --- Hints that a :ref:`String` property can be an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. -Unlike :ref:`PROPERTY_HINT_ENUM` a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. +Unlike :ref:`PROPERTY_HINT_ENUM`, a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. -- **PROPERTY_HINT_EXP_EASING** = **4** --- Hints that a float property should be edited via an exponential easing function. The hint string can include ``"attenuation"`` to flip the curve horizontally and/or ``"positive_only"`` to exclude in/out easing and limit values to be greater than or equal to zero. +- **PROPERTY_HINT_EXP_EASING** = **4** --- Hints that a :ref:`float` property should be edited via an exponential easing function. The hint string can include ``"attenuation"`` to flip the curve horizontally and/or ``"positive_only"`` to exclude in/out easing and limit values to be greater than or equal to zero. -- **PROPERTY_HINT_LINK** = **5** --- Hints that a vector property should allow linking values (e.g. to edit both ``x`` and ``y`` together). +- **PROPERTY_HINT_LINK** = **5** --- Hints that a vector property should allow its components to be linked. For example, this allows :ref:`Vector2.x` and :ref:`Vector2.y` to be edited together. -- **PROPERTY_HINT_FLAGS** = **6** --- 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 ``"Bit0,Bit1,Bit2,,Bit4"``. +- **PROPERTY_HINT_FLAGS** = **6** --- Hints that an :ref:`int` 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 ``"Bit0,Bit1,Bit2,,Bit4"``. -- **PROPERTY_HINT_LAYERS_2D_RENDER** = **7** --- Hints that an integer property is a bitmask using the optionally named 2D render layers. +- **PROPERTY_HINT_LAYERS_2D_RENDER** = **7** --- Hints that an :ref:`int` property is a bitmask using the optionally named 2D render layers. -- **PROPERTY_HINT_LAYERS_2D_PHYSICS** = **8** --- Hints that an integer property is a bitmask using the optionally named 2D physics layers. +- **PROPERTY_HINT_LAYERS_2D_PHYSICS** = **8** --- Hints that an :ref:`int` property is a bitmask using the optionally named 2D physics layers. -- **PROPERTY_HINT_LAYERS_2D_NAVIGATION** = **9** --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers. +- **PROPERTY_HINT_LAYERS_2D_NAVIGATION** = **9** --- Hints that an :ref:`int` property is a bitmask using the optionally named 2D navigation layers. -- **PROPERTY_HINT_LAYERS_3D_RENDER** = **10** --- Hints that an integer property is a bitmask using the optionally named 3D render layers. +- **PROPERTY_HINT_LAYERS_3D_RENDER** = **10** --- Hints that an :ref:`int` property is a bitmask using the optionally named 3D render layers. -- **PROPERTY_HINT_LAYERS_3D_PHYSICS** = **11** --- Hints that an integer property is a bitmask using the optionally named 3D physics layers. +- **PROPERTY_HINT_LAYERS_3D_PHYSICS** = **11** --- Hints that an :ref:`int` property is a bitmask using the optionally named 3D physics layers. -- **PROPERTY_HINT_LAYERS_3D_NAVIGATION** = **12** --- Hints that an integer property is a bitmask using the optionally named 3D navigation layers. +- **PROPERTY_HINT_LAYERS_3D_NAVIGATION** = **12** --- Hints that an :ref:`int` property is a bitmask using the optionally named 3D navigation layers. -- **PROPERTY_HINT_FILE** = **13** --- 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 ``"*.png,*.jpg"``. +- **PROPERTY_HINT_FILE** = **13** --- Hints that a :ref:`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 ``"*.png,*.jpg"``. -- **PROPERTY_HINT_DIR** = **14** --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. +- **PROPERTY_HINT_DIR** = **14** --- Hints that a :ref:`String` property is a path to a directory. Editing it will show a file dialog for picking the path. -- **PROPERTY_HINT_GLOBAL_FILE** = **15** --- 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 ``"*.png,*.jpg"``. +- **PROPERTY_HINT_GLOBAL_FILE** = **15** --- Hints that a :ref:`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 ``"*.png,*.jpg"``. -- **PROPERTY_HINT_GLOBAL_DIR** = **16** --- 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. +- **PROPERTY_HINT_GLOBAL_DIR** = **16** --- Hints that a :ref:`String` property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. - **PROPERTY_HINT_RESOURCE_TYPE** = **17** --- Hints that a property is an instance of a :ref:`Resource`-derived type, optionally specified via the hint string (e.g. ``"Texture2D"``). Editing it will show a popup menu of valid resource types to instantiate. -- **PROPERTY_HINT_MULTILINE_TEXT** = **18** --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. +- **PROPERTY_HINT_MULTILINE_TEXT** = **18** --- Hints that a :ref:`String` property is text with line breaks. Editing it will show a text input field where line breaks can be typed. -- **PROPERTY_HINT_EXPRESSION** = **19** --- Hints that a string property is an :ref:`Expression`. +- **PROPERTY_HINT_EXPRESSION** = **19** --- Hints that a :ref:`String` property is an :ref:`Expression`. -- **PROPERTY_HINT_PLACEHOLDER_TEXT** = **20** --- 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. +- **PROPERTY_HINT_PLACEHOLDER_TEXT** = **20** --- Hints that a :ref:`String` property should show a placeholder text on its input field, if empty. The hint string is the placeholder text to use. -- **PROPERTY_HINT_COLOR_NO_ALPHA** = **21** --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. +- **PROPERTY_HINT_COLOR_NO_ALPHA** = **21** --- Hints that a :ref:`Color` property should be edited without affecting its transparency (:ref:`Color.a` is not editable). -- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSY** = **22** --- Hints that an image is compressed using lossy compression. +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSY** = **22** --- Hints that an image is compressed using lossy compression. The editor does not internally use this property hint. -- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS** = **23** --- Hints that an image is compressed using lossless compression. +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS** = **23** --- Hints that an image is compressed using lossless compression. The editor does not internally use this property hint. - **PROPERTY_HINT_OBJECT_ID** = **24** -- **PROPERTY_HINT_TYPE_STRING** = **25** --- Hint that a property represents a particular type. If a property is :ref:`TYPE_STRING`, allows to set a type from the create dialog. If you need to create an :ref:`Array` to contain elements of a specific type, the ``hint_string`` must encode nested types using ``":"`` and ``"/"`` for specifying :ref:`Resource` types. For instance: +- **PROPERTY_HINT_TYPE_STRING** = **25** --- Hints that a property represents a particular type. If a property is :ref:`TYPE_STRING`, allows to set a type from the create dialog. If you need to create an :ref:`Array` to contain elements of a specific type, the ``hint_string`` must encode nested types using ``":"`` and ``"/"`` for specifying :ref:`Resource` types. + +\ **Example:**\ :: - hint_string = "%s:" % [TYPE_INT] # Array of inteters. + hint_string = "%s:" % [TYPE_INT] # Array of integers. hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats. hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources. hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources. -\ **Note:** The final colon is required to specify for properly detecting built-in types. +\ **Note:** The final colon is required for properly detecting built-in types. - **PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE** = **26** @@ -2281,7 +2324,7 @@ Unlike :ref:`PROPERTY_HINT_ENUM` - **PROPERTY_HINT_PROPERTY_OF_SCRIPT** = **34** -- **PROPERTY_HINT_OBJECT_TOO_BIG** = **35** +- **PROPERTY_HINT_OBJECT_TOO_BIG** = **35** --- Hints that a property's size (in bytes) is too big to be displayed, when debugging a running project. The debugger uses this hint internally. - **PROPERTY_HINT_NODE_PATH_VALID_TYPES** = **36** @@ -2291,21 +2334,23 @@ Unlike :ref:`PROPERTY_HINT_ENUM` - **PROPERTY_HINT_INT_IS_OBJECTID** = **39** -- **PROPERTY_HINT_INT_IS_POINTER** = **41** +- **PROPERTY_HINT_INT_IS_POINTER** = **40** -- **PROPERTY_HINT_ARRAY_TYPE** = **40** +- **PROPERTY_HINT_ARRAY_TYPE** = **41** -- **PROPERTY_HINT_LOCALE_ID** = **42** --- Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. +- **PROPERTY_HINT_LOCALE_ID** = **42** --- Hints that a :ref:`String` property is a locale code. Editing it will show a locale dialog for picking language and country. -- **PROPERTY_HINT_LOCALIZABLE_STRING** = **43** --- Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. +- **PROPERTY_HINT_LOCALIZABLE_STRING** = **43** --- Hints that a :ref:`Dictionary` property is string translation map. Dictionary keys are locale codes and, values are translated strings. - **PROPERTY_HINT_NODE_TYPE** = **44** -- **PROPERTY_HINT_HIDE_QUATERNION_EDIT** = **45** --- Hints that a quaternion property should disable the temporary euler editor. +- **PROPERTY_HINT_HIDE_QUATERNION_EDIT** = **45** --- Hints that a :ref:`Quaternion` property should disable the temporary euler editor. -- **PROPERTY_HINT_PASSWORD** = **46** --- Hints that a string property is a password, and every character is replaced with the secret character. +- **PROPERTY_HINT_PASSWORD** = **46** --- Hints that a :ref:`String` property is a password. Every character of the string is displayed as the secret character (typically ``*``). -- **PROPERTY_HINT_MAX** = **47** +An optional placeholder text can be shown on its input field, similarly to :ref:`PROPERTY_HINT_PLACEHOLDER_TEXT`. + +- **PROPERTY_HINT_MAX** = **47** --- Represents the size of the :ref:`PropertyHint` enum. ---- @@ -2379,15 +2424,15 @@ Unlike :ref:`PROPERTY_HINT_ENUM` enum **PropertyUsageFlags**: -- **PROPERTY_USAGE_NONE** = **0** +- **PROPERTY_USAGE_NONE** = **0** --- The property is not stored, and does not display in the editor. This is the default for non-exported properties. - **PROPERTY_USAGE_STORAGE** = **2** --- The property is serialized and saved in the scene file (default). -- **PROPERTY_USAGE_EDITOR** = **4** --- The property is shown in the editor inspector (default). +- **PROPERTY_USAGE_EDITOR** = **4** --- The property is shown in the :ref:`EditorInspector` (default). -- **PROPERTY_USAGE_CHECKABLE** = **8** --- The property can be checked in the editor inspector. +- **PROPERTY_USAGE_CHECKABLE** = **8** --- The property can be checked in the :ref:`EditorInspector`. -- **PROPERTY_USAGE_CHECKED** = **16** --- The property is checked in the editor inspector. +- **PROPERTY_USAGE_CHECKED** = **16** --- The property is checked in the :ref:`EditorInspector`. - **PROPERTY_USAGE_INTERNATIONALIZED** = **32** --- The property is a translatable string. @@ -2419,9 +2464,9 @@ enum **PropertyUsageFlags**: - **PROPERTY_USAGE_INTERNAL** = **524288** -- **PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE** = **1048576** +- **PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE** = **1048576** --- If the property is a :ref:`Resource`, a new copy of it is always created when calling :ref:`Node.duplicate` or :ref:`Resource.duplicate`. -- **PROPERTY_USAGE_HIGH_END_GFX** = **2097152** +- **PROPERTY_USAGE_HIGH_END_GFX** = **2097152** --- The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). - **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = **4194304** @@ -2435,9 +2480,9 @@ enum **PropertyUsageFlags**: - **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = **134217728** -- **PROPERTY_USAGE_READ_ONLY** = **268435456** --- The property is read-only in the editor inspector. +- **PROPERTY_USAGE_READ_ONLY** = **268435456** --- The property is read-only in the :ref:`EditorInspector`. -- **PROPERTY_USAGE_ARRAY** = **536870912** +- **PROPERTY_USAGE_ARRAY** = **536870912** --- The property is an array. - **PROPERTY_USAGE_DEFAULT** = **6** --- Default usage (storage, editor and network). @@ -2475,13 +2520,13 @@ enum **MethodFlags**: - **METHOD_FLAG_VIRTUAL** = **8** --- Flag for a virtual method. -- **METHOD_FLAG_VARARG** = **16** +- **METHOD_FLAG_VARARG** = **16** --- Flag for a method with a variable number of arguments. -- **METHOD_FLAG_STATIC** = **32** +- **METHOD_FLAG_STATIC** = **32** --- Flag for a static method. -- **METHOD_FLAG_OBJECT_CORE** = **64** --- Used internally. Allows to not dump core virtuals such as ``_notification`` to the JSON API. +- **METHOD_FLAG_OBJECT_CORE** = **64** --- Used internally. Allows to not dump core virtual methods (such as :ref:`Object._notification`) to the JSON API. -- **METHOD_FLAGS_DEFAULT** = **1** --- Default method flags. +- **METHOD_FLAGS_DEFAULT** = **1** --- Default method flags (normal). ---- @@ -2573,7 +2618,7 @@ enum **Variant.Type**: - **TYPE_INT** = **2** --- Variable is of type :ref:`int`. -- **TYPE_FLOAT** = **3** --- Variable is of type :ref:`float` (real). +- **TYPE_FLOAT** = **3** --- Variable is of type :ref:`float`. - **TYPE_STRING** = **4** --- Variable is of type :ref:`String`. @@ -2591,9 +2636,9 @@ enum **Variant.Type**: - **TYPE_TRANSFORM2D** = **11** --- Variable is of type :ref:`Transform2D`. -- **TYPE_VECTOR4** = **12** +- **TYPE_VECTOR4** = **12** --- Variable is of type :ref:`Vector4`. -- **TYPE_VECTOR4I** = **13** +- **TYPE_VECTOR4I** = **13** --- Variable is of type :ref:`Vector4i`. - **TYPE_PLANE** = **14** --- Variable is of type :ref:`Plane`. @@ -2605,7 +2650,7 @@ enum **Variant.Type**: - **TYPE_TRANSFORM3D** = **18** --- Variable is of type :ref:`Transform3D`. -- **TYPE_PROJECTION** = **19** +- **TYPE_PROJECTION** = **19** --- Variable is of type :ref:`Projection`. - **TYPE_COLOR** = **20** --- Variable is of type :ref:`Color`. @@ -2886,6 +2931,8 @@ The :ref:`Marshalls` singleton. - :ref:`NativeExtensionManager` **NativeExtensionManager** +The :ref:`NativeExtensionManager` singleton. + ---- .. _class_@GlobalScope_property_NavigationMeshGenerator: @@ -3053,7 +3100,7 @@ Method Descriptions - :ref:`Variant` **abs** **(** :ref:`Variant` x **)** -Returns the absolute value of a :ref:`Variant` parameter ``x`` (i.e. non-negative value). Variant types :ref:`int`, :ref:`float` (real), :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. +Returns the absolute value of a :ref:`Variant` parameter ``x`` (i.e. non-negative value). Variant types :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. :: @@ -3163,7 +3210,7 @@ Important note: The Y coordinate comes first, by convention. - :ref:`float` **bezier_interpolate** **(** :ref:`float` start, :ref:`float` control_1, :ref:`float` control_2, :ref:`float` end, :ref:`float` t **)** -Returns the point at the given ``t`` on a one-dimnesional `Bezier curve `__ defined by the given ``control_1``, ``control_2``, and ``end`` points. +Returns the point at the given ``t`` on a one-dimensional `Bezier curve `__ defined by the given ``control_1``, ``control_2``, and ``end`` points. ---- @@ -3200,7 +3247,7 @@ Rounds ``x`` upward (towards positive infinity), returning the smallest whole nu See also :ref:`floor`, :ref:`round`, and :ref:`snapped`. -\ **Note:** For better type safety, you can use :ref:`ceilf`, :ref:`ceili`, :ref:`Vector2.ceil`, :ref:`Vector3.ceil` or :ref:`Vector4.ceil` instead. +\ **Note:** For better type safety, see :ref:`ceilf`, :ref:`ceili`, :ref:`Vector2.ceil`, :ref:`Vector3.ceil` and :ref:`Vector4.ceil`. ---- @@ -3210,7 +3257,7 @@ See also :ref:`floor`, :ref:`round`, specialzied in floats. +A type-safe version of :ref:`ceil`, returning a :ref:`float`. ---- @@ -3220,7 +3267,7 @@ A type-safe version of :ref:`ceil`, specialzied Rounds ``x`` upward (towards positive infinity), returning the smallest whole number that is not less than ``x``. -A type-safe version of :ref:`ceil` that returns integer. +A type-safe version of :ref:`ceil`, returning an :ref:`int`. ---- @@ -3228,7 +3275,7 @@ A type-safe version of :ref:`ceil` that returns - :ref:`Variant` **clamp** **(** :ref:`Variant` value, :ref:`Variant` min, :ref:`Variant` max **)** -Clamps the :ref:`Variant` ``value`` and returns a value not less than ``min`` and not more than ``max``. Variant types :ref:`int`, :ref:`float` (real), :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. +Clamps the ``value``, returning a :ref:`Variant` not less than ``min`` and not more than ``max``. Variant types :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. :: @@ -3256,17 +3303,15 @@ Clamps the :ref:`Variant` ``value`` and returns a value not less - :ref:`float` **clampf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** -Clamps the float ``value`` and returns a value not less than ``min`` and not more than ``max``. +Clamps the ``value``, returning a :ref:`float` not less than ``min`` and not more than ``max``. :: var speed = 42.1 - # a is 20.0 - var a = clampf(speed, 1.0, 20.0) + var a = clampf(speed, 1.0, 20.5) # a is 20.5 speed = -10.0 - # a is -1.0 - a = clampf(speed, -1.0, 1.0) + var b = clampf(speed, -1.0, 1.0) # b is -1.0 ---- @@ -3274,17 +3319,15 @@ Clamps the float ``value`` and returns a value not less than ``min`` and not mor - :ref:`int` **clampi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** -Clamps the integer ``value`` and returns a value not less than ``min`` and not more than ``max``. +Clamps the ``value``, returning an :ref:`int` not less than ``min`` and not more than ``max``. :: var speed = 42 - # a is 20 - var a = clampi(speed, 1, 20) + var a = clampi(speed, 1, 20) # a is 20 speed = -10 - # a is -1 - a = clampi(speed, -1, 1) + var b = clampi(speed, -1, 1) # b is -1 ---- @@ -3310,8 +3353,7 @@ Returns the hyperbolic cosine of ``x`` in radians. :: - # Prints 1.543081 - print(cosh(1)) + print(cosh(1)) # Prints 1.543081 ---- @@ -3319,7 +3361,7 @@ Returns the hyperbolic cosine of ``x`` in radians. - :ref:`float` **cubic_interpolate** **(** :ref:`float` from, :ref:`float` to, :ref:`float` pre, :ref:`float` post, :ref:`float` weight **)** -Cubic interpolates between two values by the factor defined in ``weight`` with pre and post values. +Cubic interpolates between two values by the factor defined in ``weight`` with ``pre`` and ``post`` values. ---- @@ -3327,7 +3369,7 @@ Cubic interpolates between two values by the factor defined in ``weight`` with p - :ref:`float` **cubic_interpolate_angle** **(** :ref:`float` from, :ref:`float` to, :ref:`float` pre, :ref:`float` post, :ref:`float` weight **)** -Cubic interpolates between two rotation values with shortest path by the factor defined in ``weight`` with pre and post values. See also :ref:`lerp_angle`. +Cubic interpolates between two rotation values with shortest path by the factor defined in ``weight`` with ``pre`` and ``post`` values. See also :ref:`lerp_angle`. ---- @@ -3335,7 +3377,7 @@ Cubic interpolates between two rotation values with shortest path by the factor - :ref:`float` **cubic_interpolate_angle_in_time** **(** :ref:`float` from, :ref:`float` to, :ref:`float` pre, :ref:`float` post, :ref:`float` weight, :ref:`float` to_t, :ref:`float` pre_t, :ref:`float` post_t **)** -Cubic interpolates between two rotation values with shortest path by the factor defined in ``weight`` with pre and post values. See also :ref:`lerp_angle`. +Cubic interpolates between two rotation values with shortest path by the factor defined in ``weight`` with ``pre`` and ``post`` values. See also :ref:`lerp_angle`. It can perform smoother interpolation than ``cubic_interpolate()`` by the time values. @@ -3345,9 +3387,9 @@ It can perform smoother interpolation than ``cubic_interpolate()`` by the time v - :ref:`float` **cubic_interpolate_in_time** **(** :ref:`float` from, :ref:`float` to, :ref:`float` pre, :ref:`float` post, :ref:`float` weight, :ref:`float` to_t, :ref:`float` pre_t, :ref:`float` post_t **)** -Cubic interpolates between two values by the factor defined in ``weight`` with pre and post values. +Cubic interpolates between two values by the factor defined in ``weight`` with ``pre`` and ``post`` values. -It can perform smoother interpolation than ``cubic_interpolate()`` by the time values. +It can perform smoother interpolation than :ref:`cubic_interpolate` by the time values. ---- @@ -3367,8 +3409,7 @@ Converts an angle expressed in degrees to radians. :: - # r is 3.141593 - var r = deg_to_rad(180) + var r = deg_to_rad(180) # r is 3.141593 ---- @@ -3398,7 +3439,14 @@ See also :ref:`smoothstep`. If you need to - :ref:`String` **error_string** **(** :ref:`int` error **)** -Returns a human-readable name for the given error code. +Returns a human-readable name for the given :ref:`Error` code. + +:: + + print(OK) # Prints 0 + print(error_string(OK)) # Prints OK + print(error_string(ERR_BUSY)) # Prints Busy + print(error_string(ERR_OUT_OF_MEMORY)) # Prints Out of memory ---- @@ -3426,14 +3474,12 @@ Rounds ``x`` downward (towards negative infinity), returning the largest whole n :: - # a is 2.0 - var a = floor(2.99) - # a is -3.0 - a = floor(-2.99) + var a = floor(2.99) # a is 2.0 + a = floor(-2.99) # a is -3.0 See also :ref:`ceil`, :ref:`round`, and :ref:`snapped`. -\ **Note:** For better type safety, you can use :ref:`floorf`, :ref:`floori`, :ref:`Vector2.floor`, :ref:`Vector3.floor` or :ref:`Vector4.floor` instead. +\ **Note:** For better type safety, see :ref:`floorf`, :ref:`floori`, :ref:`Vector2.floor`, :ref:`Vector3.floor` and :ref:`Vector4.floor`. ---- @@ -3443,7 +3489,7 @@ See also :ref:`ceil`, :ref:`round`, specialzied in floats. +A type-safe version of :ref:`floor`, returning a :ref:`float`. ---- @@ -3453,7 +3499,9 @@ A type-safe version of :ref:`floor`, specialzie Rounds ``x`` downward (towards negative infinity), returning the largest whole number that is not more than ``x``. -Equivalent of doing ``int(x)``. +A type-safe version of :ref:`floor`, returning an :ref:`int`. + +\ **Note:** This function is *not* the same as ``int(x)``, which rounds towards 0. ---- @@ -3461,12 +3509,11 @@ Equivalent of doing ``int(x)``. - :ref:`float` **fmod** **(** :ref:`float` x, :ref:`float` y **)** -Returns the floating-point remainder of ``x/y``, keeping the sign of ``x``. +Returns the floating-point remainder of ``x`` divided by ``y``, keeping the sign of ``x``. :: - # Remainder is 1.5 - var remainder = fmod(7, 5.5) + var remainder = fmod(7, 5.5) # remainder is 1.5 For the integer remainder operation, use the ``%`` operator. @@ -3476,25 +3523,27 @@ For the integer remainder operation, use the ``%`` operator. - :ref:`float` **fposmod** **(** :ref:`float` x, :ref:`float` y **)** -Returns the floating-point modulus of ``x/y`` that wraps equally in positive and negative. +Returns the floating-point modulus of ``x`` divided by ``y``, wrapping equally in positive and negative. :: + print(" (x) (fmod(x, 1.5)) (fposmod(x, 1.5))") for i in 7: - var x = 0.5 * i - 1.5 - print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) + var x = i * 0.5 - 1.5 + print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) Produces: :: - -1.5 -0.0 0.0 - -1.0 -1.0 0.5 - -0.5 -0.5 1.0 - 0.0 0.0 0.0 - 0.5 0.5 0.5 - 1.0 1.0 1.0 - 1.5 0.0 0.0 + (x) (fmod(x, 1.5)) (fposmod(x, 1.5)) + -1.5 -0.0 | 0.0 + -1.0 -1.0 | 0.5 + -0.5 -0.5 | 1.0 + 0.0 0.0 | 0.0 + 0.5 0.5 | 0.5 + 1.0 1.0 | 1.0 + 1.5 0.0 | 0.0 ---- @@ -3502,7 +3551,7 @@ Produces: - :ref:`int` **hash** **(** :ref:`Variant` variable **)** -Returns the integer hash of the variable passed. +Returns the integer hash of the passed ``variable``. :: @@ -3514,7 +3563,7 @@ Returns the integer hash of the variable passed. - :ref:`Object` **instance_from_id** **(** :ref:`int` instance_id **)** -Returns the Object that corresponds to ``instance_id``. All Objects have a unique instance ID. +Returns the :ref:`Object` that corresponds to ``instance_id``. All Objects have a unique instance ID. See also :ref:`Object.get_instance_id`. :: @@ -3536,12 +3585,13 @@ Returns an interpolation or extrapolation factor considering the range specified # The interpolation ratio in the `lerp()` call below is 0.75. var middle = lerp(20, 30, 0.75) - # `middle` is now 27.5. + # middle is now 27.5. + # Now, we pretend to have forgotten the original ratio and want to get it back. var ratio = inverse_lerp(20, 30, 27.5) - # `ratio` is now 0.75. + # ratio is now 0.75. -See also :ref:`lerp` which performs the reverse of this operation, and :ref:`remap` to map a continuous series of values to another. +See also :ref:`lerp`, which performs the reverse of this operation, and :ref:`remap` to map a continuous series of values to another. ---- @@ -3551,17 +3601,25 @@ See also :ref:`lerp` which performs the reverse Returns ``true`` if ``a`` and ``b`` are approximately equal to each other. -Here, approximately equal means that ``a`` and ``b`` are within a small internal epsilon of each other, which scales with the magnitude of the numbers. +Here, "approximately equal" means that ``a`` and ``b`` are within a small internal epsilon of each other, which scales with the magnitude of the numbers. Infinity values of the same sign are considered equal. ---- +.. _class_@GlobalScope_method_is_finite: + +- :ref:`bool` **is_finite** **(** :ref:`float` x **)** + +Returns whether ``x`` is a finite value, i.e. it is not :ref:`@GDScript.NAN`, positive infinity, or negative infinity. + +---- + .. _class_@GlobalScope_method_is_inf: - :ref:`bool` **is_inf** **(** :ref:`float` x **)** -Returns whether ``x`` is an infinity value (either positive infinity or negative infinity). +Returns ``true`` if ``x`` is either positive infinity or negative infinity. ---- @@ -3577,7 +3635,7 @@ Returns ``true`` if the Object that corresponds to ``id`` is a valid object (e.g - :ref:`bool` **is_instance_valid** **(** :ref:`Variant` instance **)** -Returns whether ``instance`` is a valid object (e.g. has not been deleted from memory). +Returns ``true`` if ``instance`` is a valid Object (e.g. has not been deleted from memory). ---- @@ -3585,7 +3643,7 @@ Returns whether ``instance`` is a valid object (e.g. has not been deleted from m - :ref:`bool` **is_nan** **(** :ref:`float` x **)** -Returns whether ``x`` is a NaN ("Not a Number" or invalid) value. +Returns ``true`` if ``x`` is a NaN ("Not a Number" or invalid) value. ---- @@ -3595,7 +3653,7 @@ Returns whether ``x`` is a NaN ("Not a Number" or invalid) value. Returns ``true`` if ``x`` is zero or almost zero. -This method is faster than using :ref:`is_equal_approx` with one value as zero. +This function is faster than using :ref:`is_equal_approx` with one value as zero. ---- @@ -3603,9 +3661,9 @@ This method is faster than using :ref:`is_equal_approx` **lerp** **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`Variant` weight **)** -Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. Use :ref:`clamp` on the result of :ref:`lerp` if this is not desired. +Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. If this is not desired, use :ref:`clamp` on the result of this function. -Both ``from`` and ``to`` must have matching types. Supported types: :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`, :ref:`Color`, :ref:`Quaternion`, :ref:`Basis`. +Both ``from`` and ``to`` must be the same type. Supported types: :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`, :ref:`Color`, :ref:`Quaternion`, :ref:`Basis`. :: @@ -3613,7 +3671,7 @@ Both ``from`` and ``to`` must have matching types. Supported types: :ref:`float< See also :ref:`inverse_lerp` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp`, combine it with :ref:`ease` or :ref:`smoothstep`. See also :ref:`remap` to map a continuous series of values to another. -\ **Note:** For better type safety, you can use :ref:`lerpf`, :ref:`Vector2.lerp`, :ref:`Vector3.lerp`, :ref:`Vector4.lerp`, :ref:`Color.lerp`, :ref:`Quaternion.slerp` or :ref:`Basis.slerp` instead. +\ **Note:** For better type safety, use :ref:`lerpf`, :ref:`Vector2.lerp`, :ref:`Vector3.lerp`, :ref:`Vector4.lerp`, :ref:`Color.lerp`, :ref:`Quaternion.slerp` or :ref:`Basis.slerp`. ---- @@ -3621,7 +3679,7 @@ See also :ref:`inverse_lerp` which perfo - :ref:`float` **lerp_angle** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** -Linearly interpolates between two angles (in radians) by a normalized value. +Linearly interpolates between two angles (in radians) by a ``weight`` value between 0.0 and 1.0. Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`@GDScript.TAU`. To perform eased interpolation with :ref:`lerp_angle`, combine it with :ref:`ease` or :ref:`smoothstep`. @@ -3635,7 +3693,7 @@ Similar to :ref:`lerp`, but interpolates correct rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta -\ **Note:** This method lerps through the shortest path between ``from`` and ``to``. However, when these two angles are approximately ``PI + k * TAU`` apart for any integer ``k``, it's not obvious which way they lerp due to floating-point precision errors. For example, ``lerp_angle(0, PI, weight)`` lerps counter-clockwise, while ``lerp_angle(0, PI + 5 * TAU, weight)`` lerps clockwise. +\ **Note:** This function lerps through the shortest path between ``from`` and ``to``. However, when these two angles are approximately ``PI + k * TAU`` apart for any integer ``k``, it's not obvious which way they lerp due to floating-point precision errors. For example, ``lerp_angle(0, PI, weight)`` lerps counter-clockwise, while ``lerp_angle(0, PI + 5 * TAU, weight)`` lerps clockwise. ---- @@ -3643,7 +3701,7 @@ Similar to :ref:`lerp`, but interpolates correct - :ref:`float` **lerpf** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** -Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. +Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. If this is not desired, use :ref:`clampf` on the result of this function. :: @@ -3657,7 +3715,9 @@ See also :ref:`inverse_lerp` which perfo - :ref:`float` **linear_to_db** **(** :ref:`float` lin **)** -Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example: +Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). + +\ **Example:**\ :: @@ -3672,7 +3732,7 @@ Converts from linear energy to decibels (audio). This can be used to implement v - :ref:`float` **log** **(** :ref:`float` x **)** -Natural logarithm. The amount of time needed to reach a certain level of continuous growth. +Returns the natural logarithm of ``x``. This is the amount of time needed to reach a certain level of continuous growth. \ **Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. @@ -3688,7 +3748,7 @@ Natural logarithm. The amount of time needed to reach a certain level of continu - :ref:`Variant` **max** **(** ... **)** |vararg| -Returns the maximum of the given values. This method can take any number of arguments. +Returns the maximum of the given values. This function can take any number of arguments. :: @@ -3700,11 +3760,11 @@ Returns the maximum of the given values. This method can take any number of argu - :ref:`float` **maxf** **(** :ref:`float` a, :ref:`float` b **)** -Returns the maximum of two float values. +Returns the maximum of two :ref:`float` values. :: - maxf(3.6, 24) # Returns 24.0 + maxf(3.6, 24) # Returns 24.0 maxf(-3.99, -4) # Returns -3.99 ---- @@ -3713,11 +3773,11 @@ Returns the maximum of two float values. - :ref:`int` **maxi** **(** :ref:`int` a, :ref:`int` b **)** -Returns the maximum of two int values. +Returns the maximum of two :ref:`int` values. :: - maxi(1, 2) # Returns 2 + maxi(1, 2) # Returns 2 maxi(-3, -4) # Returns -3 ---- @@ -3726,7 +3786,7 @@ Returns the maximum of two int values. - :ref:`Variant` **min** **(** ... **)** |vararg| -Returns the minimum of the given values. This method can take any number of arguments. +Returns the minimum of the given values. This function can take any number of arguments. :: @@ -3738,11 +3798,11 @@ Returns the minimum of the given values. This method can take any number of argu - :ref:`float` **minf** **(** :ref:`float` a, :ref:`float` b **)** -Returns the minimum of two float values. +Returns the minimum of two :ref:`float` values. :: - minf(3.6, 24) # Returns 3.6 + minf(3.6, 24) # Returns 3.6 minf(-3.99, -4) # Returns -4.0 ---- @@ -3751,11 +3811,11 @@ Returns the minimum of two float values. - :ref:`int` **mini** **(** :ref:`int` a, :ref:`int` b **)** -Returns the minimum of two int values. +Returns the minimum of two :ref:`int` values. :: - mini(1, 2) # Returns 1 + mini(1, 2) # Returns 1 mini(-3, -4) # Returns -4 ---- @@ -3770,8 +3830,8 @@ Use a negative ``delta`` value to move away. :: - move_toward(5, 10, 4) # Returns 9 - move_toward(10, 5, 4) # Returns 6 + move_toward(5, 10, 4) # Returns 9 + move_toward(10, 5, 4) # Returns 6 move_toward(10, 5, -1.5) # Returns 11.5 ---- @@ -3780,7 +3840,7 @@ Use a negative ``delta`` value to move away. - :ref:`int` **nearest_po2** **(** :ref:`int` value **)** -Returns the nearest equal or larger power of 2 for integer ``value``. +Returns the nearest equal or larger power of 2 for the integer ``value``. In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such that ``value <= a`` for some non-negative integer ``n``. @@ -3790,10 +3850,10 @@ In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such th nearest_po2(4) # Returns 4 nearest_po2(5) # Returns 8 - nearest_po2(0) # Returns 0 (this may not be what you expect) - nearest_po2(-1) # Returns 0 (this may not be what you expect) + nearest_po2(0) # Returns 0 (this may not be expected) + nearest_po2(-1) # Returns 0 (this may not be expected) -\ **Warning:** Due to the way it is implemented, this function returns ``0`` rather than ``1`` for non-positive values of ``value`` (in reality, 1 is the smallest integer power of 2). +\ **Warning:** Due to the way it is implemented, this function returns ``0`` rather than ``1`` for negative values of ``value`` (in reality, 1 is the smallest integer power of 2). ---- @@ -3801,20 +3861,20 @@ In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such th - :ref:`float` **pingpong** **(** :ref:`float` value, :ref:`float` length **)** -Returns the ``value`` wrapped between ``0`` and the ``length``. If the limit is reached, the next value the function returned is decreased to the ``0`` side or increased to the ``length`` side (like a triangle wave). If ``length`` is less than zero, it becomes positive. +Wraps ``value`` between ``0`` and the ``length``. If the limit is reached, the next value the function returns is decreased to the ``0`` side or increased to the ``length`` side (like a triangle wave). If ``length`` is less than zero, it becomes positive. :: - pingpong(-3.0, 3.0) # Returns 3 - pingpong(-2.0, 3.0) # Returns 2 - pingpong(-1.0, 3.0) # Returns 1 - pingpong(0.0, 3.0) # Returns 0 - pingpong(1.0, 3.0) # Returns 1 - pingpong(2.0, 3.0) # Returns 2 - pingpong(3.0, 3.0) # Returns 3 - pingpong(4.0, 3.0) # Returns 2 - pingpong(5.0, 3.0) # Returns 1 - pingpong(6.0, 3.0) # Returns 0 + pingpong(-3.0, 3.0) # Returns 3.0 + pingpong(-2.0, 3.0) # Returns 2.0 + pingpong(-1.0, 3.0) # Returns 1.0 + pingpong(0.0, 3.0) # Returns 0.0 + pingpong(1.0, 3.0) # Returns 1.0 + pingpong(2.0, 3.0) # Returns 2.0 + pingpong(3.0, 3.0) # Returns 3.0 + pingpong(4.0, 3.0) # Returns 2.0 + pingpong(5.0, 3.0) # Returns 1.0 + pingpong(6.0, 3.0) # Returns 0.0 ---- @@ -3822,24 +3882,26 @@ Returns the ``value`` wrapped between ``0`` and the ``length``. If the limit is - :ref:`int` **posmod** **(** :ref:`int` x, :ref:`int` y **)** -Returns the integer modulus of ``x/y`` that wraps equally in positive and negative. +Returns the integer modulus of ``x`` divided by ``y`` that wraps equally in positive and negative. :: + print("#(i) (i % 3) (posmod(i, 3))") for i in range(-3, 4): - print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) + print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)]) Produces: :: - -3 0 0 - -2 -2 1 - -1 -1 2 - 0 0 0 - 1 1 1 - 2 2 2 - 3 0 0 + (i) (i % 3) (posmod(i, 3)) + -3 0 | 0 + -2 -2 | 1 + -1 -1 | 2 + 0 0 | 0 + 1 1 | 1 + 2 2 | 2 + 3 0 | 0 ---- @@ -3849,6 +3911,8 @@ Produces: Returns the result of ``base`` raised to the power of ``exp``. +In GDScript, this is the equivalent of the ``**`` operator. + :: pow(2, 5) # Returns 32 @@ -3866,7 +3930,7 @@ Converts one or more arguments of any type to string in the best way possible an var a = [1, 2, 3] print("a", "b", a) # Prints ab[1, 2, 3] -\ **Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. +\ **Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print` or :ref:`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. ---- @@ -3910,13 +3974,14 @@ Prints one or more arguments to strings in the best way possible to standard err - void **printraw** **(** ... **)** |vararg| -Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. +Prints one or more arguments to strings in the best way possible to console. Unlike :ref:`print`, no newline is automatically added at the end. :: printraw("A") printraw("B") - # Prints AB + printraw("C") + # Prints ABC \ **Note:** Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as :ref:`print`. @@ -3956,7 +4021,7 @@ Pushes an error message to Godot's built-in debugger and to the OS terminal. push_error("test error") # Prints "test error" to debugger and terminal as error call -\ **Note:** Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. +\ **Note:** This function does not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. ---- @@ -3981,6 +4046,8 @@ Converts an angle expressed in radians to degrees. :: rad_to_deg(0.523599) # Returns 30 + rad_to_deg(PI) # Returns 180 + rad_to_deg(PI * 2) # Returns 360 ---- @@ -3988,7 +4055,16 @@ Converts an angle expressed in radians to degrees. - :ref:`PackedInt64Array` **rand_from_seed** **(** :ref:`int` seed **)** -Random from seed: pass a ``seed``, and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. +Given a ``seed``, returns a :ref:`PackedInt64Array` of size ``2``, where its first element is the randomized :ref:`int` value, and the second element is the same as ``seed``. Passing the same ``seed`` consistently returns the same array. + +\ **Note:** "Seed" here refers to the internal state of the pseudo random number generator, currently implemented as a 64 bit integer. + +:: + + var a = rand_from_seed(4) + + print(a[0]) # Prints 2879024997 + print(a[1]) # Prints 4 ---- @@ -4008,11 +4084,12 @@ Returns a random floating point value between ``0.0`` and ``1.0`` (inclusive). - :ref:`float` **randf_range** **(** :ref:`float` from, :ref:`float` to **)** -Returns a random floating point value on the interval between ``from`` and ``to`` (inclusive). +Returns a random floating point value between ``from`` and ``to`` (inclusive). :: - prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 + randf_range(0, 20.5) # Returns e.g. 7.45315 + randf_range(-10, 10) # Returns e.g. -3.844535 ---- @@ -4047,8 +4124,8 @@ Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). :: - print(randi_range(0, 1)) # Prints 0 or 1 - print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 + randi_range(0, 1) # Returns either 0 or 1 + randi_range(-10, 1000) # Returns random integer between -10 and 1000 ---- @@ -4056,9 +4133,9 @@ Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). - void **randomize** **(** **)** -Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. +Randomizes the seed (or the internal state) of the random number generator. The current implementation uses a number based on the device's time. -\ **Note:** This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use :ref:`seed` to initialize the random number generator. +\ **Note:** This function is called automatically when the project is run. If you need to fix the seed to have consistent, reproducible results, use :ref:`seed` to initialize the random number generator. ---- @@ -4066,13 +4143,13 @@ Randomizes the seed (or the internal state) of the random number generator. Curr - :ref:`float` **remap** **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** -Maps a ``value`` from range ``[istart, istop]`` to ``[ostart, ostop]``. See also :ref:`lerp` and :ref:`inverse_lerp`. If ``value`` is outside ``[istart, istop]``, then the resulting value will also be outside ``[ostart, ostop]``. Use :ref:`clamp` on the result of :ref:`remap` if this is not desired. +Maps a ``value`` from range ``[istart, istop]`` to ``[ostart, ostop]``. See also :ref:`lerp` and :ref:`inverse_lerp`. If ``value`` is outside ``[istart, istop]``, then the resulting value will also be outside ``[ostart, ostop]``. If this is not desired, use :ref:`clamp` on the result of this function. :: remap(75, 0, 100, -1, 1) # Returns 0.5 -For complex use cases where you need multiple ranges, consider using :ref:`Curve` or :ref:`Gradient` instead. +For complex use cases where multiple ranges are needed, consider using :ref:`Curve` or :ref:`Gradient` instead. ---- @@ -4080,7 +4157,7 @@ For complex use cases where you need multiple ranges, consider using :ref:`Curve - :ref:`int` **rid_allocate_id** **(** **)** -Allocate a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers. +Allocates a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers. ---- @@ -4088,7 +4165,7 @@ Allocate a unique ID which can be used by the implementation to construct a RID. - :ref:`RID` **rid_from_int64** **(** :ref:`int` base **)** -Create a RID from an int64. This is used mainly from native extensions to build servers. +Creates a RID from a ``base``. This is used mainly from native extensions to build servers. ---- @@ -4096,7 +4173,7 @@ Create a RID from an int64. This is used mainly from native extensions to build - :ref:`Variant` **round** **(** :ref:`Variant` x **)** -Rounds ``x`` to the nearest whole number, with halfway cases rounded away from zero. Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`. +Rounds ``x`` to the nearest whole number, with halfway cases rounded away from 0. Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`. :: @@ -4106,7 +4183,7 @@ Rounds ``x`` to the nearest whole number, with halfway cases rounded away from z See also :ref:`floor`, :ref:`ceil`, and :ref:`snapped`. -\ **Note:** For better type safety, you can use :ref:`roundf`, :ref:`roundi`, :ref:`Vector2.round`, :ref:`Vector3.round` or :ref:`Vector4.round` instead. +\ **Note:** For better type safety, use :ref:`roundf`, :ref:`roundi`, :ref:`Vector2.round`, :ref:`Vector3.round` or :ref:`Vector4.round`, instead. ---- @@ -4114,9 +4191,9 @@ See also :ref:`floor`, :ref:`ceil` **roundf** **(** :ref:`float` x **)** -Rounds ``x`` to the nearest whole number, with halfway cases rounded away from zero. +Rounds ``x`` to the nearest whole number, with halfway cases rounded away from 0. -A type-safe version of :ref:`round`, specialzied in floats. +A type-safe version of :ref:`round`, returning a :ref:`float`. ---- @@ -4124,9 +4201,9 @@ A type-safe version of :ref:`round`, specialzie - :ref:`int` **roundi** **(** :ref:`float` x **)** -Rounds ``x`` to the nearest whole number, with halfway cases rounded away from zero. +Rounds ``x`` to the nearest whole number, with halfway cases rounded away from 0. -A type-safe version of :ref:`round` that returns integer. +A type-safe version of :ref:`round`, returning an :ref:`int`. ---- @@ -4134,12 +4211,16 @@ A type-safe version of :ref:`round` that return - void **seed** **(** :ref:`int` base **)** -Sets seed for the random number generator. +Sets the seed for the random number generator to ``base``. Setting the seed manually can ensure consistent, repeatable results for most random functions. :: - var my_seed = "Godot Rocks" - seed(my_seed.hash()) + var my_seed = "Godot Rocks".hash() + seed(my_seed) + var a = randf() + randi() + seed(my_seed) + var b = randf() + randi() + # a and b are now identical ---- @@ -4147,7 +4228,7 @@ Sets seed for the random number generator. - :ref:`Variant` **sign** **(** :ref:`Variant` x **)** -Returns the sign of ``x`` as same type of :ref:`Variant` as ``x`` with each component being -1, 0 and 1 for each negative, zero and positive values respectivelu. Variant types :ref:`int`, :ref:`float` (real), :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. +Returns the sign of ``x`` as same type of :ref:`Variant` as ``x`` with each component being -1, 0 and 1 for each negative, zero and positive values respectively. Variant types :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3` and :ref:`Vector3i` are supported. :: @@ -4163,13 +4244,13 @@ Returns the sign of ``x`` as same type of :ref:`Variant` as ``x`` - :ref:`float` **signf** **(** :ref:`float` x **)** -Returns the sign of ``x`` as a float: -1.0 or 1.0. Returns 0.0 if ``x`` is 0. +Returns the sign of ``x`` as a :ref:`float`: -1.0 or 1.0. Returns 0.0 if ``x`` is 0.0. :: - sign(-6.0) # Returns -1.0 + sign(-6.5) # Returns -1.0 sign(0.0) # Returns 0.0 - sign(6.0) # Returns 1.0 + sign(6.5) # Returns 1.0 ---- @@ -4177,7 +4258,7 @@ Returns the sign of ``x`` as a float: -1.0 or 1.0. Returns 0.0 if ``x`` is 0. - :ref:`int` **signi** **(** :ref:`int` x **)** -Returns the sign of ``x`` as an integer: -1 or 1. Returns 0 if ``x`` is 0. +Returns the sign of ``x`` as an :ref:`int`: -1 or 1. Returns 0 if ``x`` is 0. :: @@ -4240,7 +4321,7 @@ Compared to :ref:`ease` with a curve value of `` - :ref:`float` **snapped** **(** :ref:`float` x, :ref:`float` step **)** -Snaps float value ``x`` to a given ``step``. This can also be used to round a floating point number to an arbitrary number of decimals. +Snaps the float value ``x`` to a given ``step``. This can also be used to round a floating point number to an arbitrary number of decimals. :: @@ -4259,9 +4340,11 @@ Returns the square root of ``x``, where ``x`` is a non-negative number. :: - sqrt(9) # Returns 3 + sqrt(9) # Returns 3 + sqrt(10.24) # Returns 3.2 + sqrt(-1) # Returns NaN -\ **Note:** Negative values of ``x`` return NaN. If you need negative inputs, use ``System.Numerics.Complex`` in C#. +\ **Note:** Negative values of ``x`` return NaN ("Not a Number"). in C#, if you need negative inputs, use ``System.Numerics.Complex``. ---- @@ -4273,12 +4356,9 @@ Returns the position of the first non-zero digit, after the decimal point. Note :: - # n is 0 - var n = step_decimals(5) - # n is 4 - n = step_decimals(1.0005) - # n is 9 - n = step_decimals(0.000000005) + var n = step_decimals(5) # n is 0 + n = step_decimals(1.0005) # n is 4 + n = step_decimals(0.000000005) # n is 9 ---- @@ -4286,7 +4366,7 @@ Returns the position of the first non-zero digit, after the decimal point. Note - :ref:`String` **str** **(** ... **)** |vararg| -Converts one or more arguments of any type to string in the best way possible. +Converts one or more arguments of any :ref:`Variant` type to :ref:`String` in the best way possible. ---- @@ -4294,13 +4374,13 @@ Converts one or more arguments of any type to string in the best way possible. - :ref:`Variant` **str_to_var** **(** :ref:`String` string **)** -Converts a formatted ``string`` that was returned by :ref:`var_to_str` to the original value. +Converts a formatted ``string`` that was returned by :ref:`var_to_str` to the original :ref:`Variant`. :: - var a = '{ "a": 1, "b": 2 }' - var b = str_to_var(a) - print(b["a"]) # Prints 1 + var a = '{ "a": 1, "b": 2 }' # a is a String + var b = str_to_var(a) # b is a Dictionary + print(b["a"]) # Prints 1 ---- @@ -4325,7 +4405,7 @@ Returns the hyperbolic tangent of ``x``. :: var a = log(2.0) # Returns 0.693147 - tanh(a) # Returns 0.6 + tanh(a) # Returns 0.6 ---- @@ -4333,7 +4413,7 @@ Returns the hyperbolic tangent of ``x``. - :ref:`int` **typeof** **(** :ref:`Variant` variable **)** -Returns the internal type of the given Variant object, using the :ref:`Variant.Type` values. +Returns the internal type of the given ``variable``, using the :ref:`Variant.Type` values. :: @@ -4361,7 +4441,7 @@ Encodes a :ref:`Variant` value to a byte array, without encoding - :ref:`PackedByteArray` **var_to_bytes_with_objects** **(** :ref:`Variant` variable **)** -Encodes a :ref:`Variant` value to a byte array. Encoding objects is allowed (and can potentially include code). Deserialization can be done with :ref:`bytes_to_var_with_objects`. +Encodes a :ref:`Variant` value to a byte array. Encoding objects is allowed (and can potentially include executable code). Deserialization can be done with :ref:`bytes_to_var_with_objects`. ---- @@ -4369,14 +4449,14 @@ Encodes a :ref:`Variant` value to a byte array. Encoding objects - :ref:`String` **var_to_str** **(** :ref:`Variant` variable **)** -Converts a Variant ``variable`` to a formatted string that can later be parsed using :ref:`str_to_var`. +Converts a :ref:`Variant` ``variable`` to a formatted :ref:`String` that can then be parsed using :ref:`str_to_var`. :: a = { "a": 1, "b": 2 } print(var_to_str(a)) -prints +Prints: :: @@ -4391,7 +4471,7 @@ prints - :ref:`Variant` **weakref** **(** :ref:`Variant` obj **)** -Returns a weak reference to an object, or ``null`` if the argument is invalid. +Returns a weak reference to an object, or ``null`` if ``obj`` is invalid. 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. @@ -4401,11 +4481,9 @@ A weak reference to an object is not enough to keep the object alive: when the o - :ref:`Variant` **wrap** **(** :ref:`Variant` value, :ref:`Variant` min, :ref:`Variant` max **)** -Wraps the :ref:`Variant` ``value`` between ``min`` and ``max``. +Wraps the :ref:`Variant` ``value`` between ``min`` and ``max``. Can be used for creating loop-alike behavior or infinite surfaces. -Usable for creating loop-alike behavior or infinite surfaces. - -Variant types :ref:`int` and :ref:`float` (real) are supported. If any of the argument is :ref:`float` the result will be :ref:`float`, otherwise it is :ref:`int`. +Variant types :ref:`int` and :ref:`float` are supported. If any of the arguments is :ref:`float` this function returns a :ref:`float`, otherwise it returns an :ref:`int`. :: @@ -4424,9 +4502,7 @@ Variant types :ref:`int` and :ref:`float` (real) are sup - :ref:`float` **wrapf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** -Wraps float ``value`` between ``min`` and ``max``. - -Usable for creating loop-alike behavior or infinite surfaces. +Wraps the float ``value`` between ``min`` and ``max``. Can be used for creating loop-alike behavior or infinite surfaces. :: @@ -4453,9 +4529,7 @@ Usable for creating loop-alike behavior or infinite surfaces. - :ref:`int` **wrapi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** -Wraps integer ``value`` between ``min`` and ``max``. - -Usable for creating loop-alike behavior or infinite surfaces. +Wraps the integer ``value`` between ``min`` and ``max``. Can be used for creating loop-alike behavior or infinite surfaces. :: diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 82c1e3ff8..c2d8feb6d 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -104,6 +104,8 @@ Methods +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`AABB` aabb **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`merge` **(** :ref:`AABB` with **)** |const| | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -368,6 +370,8 @@ Returns ``true`` if the ``AABB`` is on both sides of a plane. - :ref:`Variant` **intersects_ray** **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** |const| +Returns ``true`` if the given ray intersects with this ``AABB``. Ray length is infinite. + ---- .. _class_AABB_method_intersects_segment: @@ -386,6 +390,14 @@ Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calli ---- +.. _class_AABB_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this ``AABB`` is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_AABB_method_merge: - :ref:`AABB` **merge** **(** :ref:`AABB` with **)** |const| diff --git a/classes/class_animation.rst b/classes/class_animation.rst index 013d045c3..face0ae5b 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -46,6 +46,8 @@ An Animation resource contains data used to animate everything in the engine. An Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType` to see available types. +\ **Note:** For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D`, :ref:`TYPE_ROTATION_3D` and :ref:`TYPE_SCALE_3D` track types instead of :ref:`TYPE_VALUE` is recommended for performance reasons. + Tutorials --------- @@ -227,15 +229,15 @@ Enumerations enum **TrackType**: -- **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be Interpolated. +- **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D`, :ref:`TYPE_ROTATION_3D` and :ref:`TYPE_SCALE_3D` track types instead of :ref:`TYPE_VALUE` is recommended for performance reasons. -- **TYPE_POSITION_3D** = **1** +- **TYPE_POSITION_3D** = **1** --- 3D position track (values are stored in :ref:`Vector3`\ s). -- **TYPE_ROTATION_3D** = **2** +- **TYPE_ROTATION_3D** = **2** --- 3D rotation track (values are stored in :ref:`Quaternion`\ s). -- **TYPE_SCALE_3D** = **3** +- **TYPE_SCALE_3D** = **3** --- 3D scale track (values are stored in :ref:`Vector3`\ s). -- **TYPE_BLEND_SHAPE** = **4** +- **TYPE_BLEND_SHAPE** = **4** --- Blend shape track. - **TYPE_METHOD** = **5** --- Method tracks call functions with given arguments per key. @@ -265,7 +267,7 @@ enum **InterpolationType**: - **INTERPOLATION_LINEAR** = **1** --- Linear interpolation. -- **INTERPOLATION_CUBIC** = **2** --- Cubic interpolation. +- **INTERPOLATION_CUBIC** = **2** --- Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to :ref:`INTERPOLATION_LINEAR` for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return. - **INTERPOLATION_LINEAR_ANGLE** = **3** --- Linear interpolation with shortest path rotation. @@ -533,6 +535,8 @@ Sets the value of the key identified by ``key_idx`` to the given value. The ``tr - :ref:`int` **blend_shape_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` amount **)** +Inserts a key in a given blend shape track. Returns the key index. + ---- .. _class_Animation_method_clear: @@ -547,6 +551,10 @@ Clear the animation (clear all tracks and reset all). - void **compress** **(** :ref:`int` page_size=8192, :ref:`int` fps=120, :ref:`float` split_tolerance=4.0 **)** +Compress the animation and all its tracks in-place. This will make :ref:`track_is_compressed` return ``true`` once called on this ``Animation``. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions. + +\ **Note:** Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them. + ---- .. _class_Animation_method_copy_track: @@ -601,6 +609,8 @@ Returns the arguments values to be called on a method track for a given key in a - :ref:`int` **position_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` position **)** +Inserts a key in a given 3D position track. Returns the key index. + ---- .. _class_Animation_method_remove_track: @@ -615,12 +625,16 @@ Removes a track by specifying the track index. - :ref:`int` **rotation_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Quaternion` rotation **)** +Inserts a key in a given 3D rotation track. Returns the key index. + ---- .. _class_Animation_method_scale_track_insert_key: - :ref:`int` **scale_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` scale **)** +Inserts a key in a given 3D scale track. Returns the key index. + ---- .. _class_Animation_method_track_find_key: @@ -707,6 +721,8 @@ Inserts a generic key in a given track. Returns the key index. - :ref:`bool` **track_is_compressed** **(** :ref:`int` track_idx **)** |const| +Returns ``true`` if the track is compressed, ``false`` otherwise. See also :ref:`compress`. + ---- .. _class_Animation_method_track_is_enabled: diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index 696b2688f..df0f12175 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -145,6 +145,14 @@ Notifies when an animation finished playing. ---- +.. _class_AnimationPlayer_signal_animation_libraries_updated: + +- **animation_libraries_updated** **(** **)** + +Notifies when the animation libraries have changed. + +---- + .. _class_AnimationPlayer_signal_animation_list_changed: - **animation_list_changed** **(** **)** @@ -247,7 +255,7 @@ The key of the animation to play when the scene loads. The key of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See :ref:`play` for more information on playing animations. -\ **Note:** while this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see :ref:`Animation`. +\ **Note:** While this property appears in the Inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see :ref:`Animation`. ---- @@ -367,7 +375,7 @@ The process notification in which to update animations. | *Getter* | get_speed_scale() | +-----------+------------------------+ -The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. +The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. ---- diff --git a/classes/class_area3d.rst b/classes/class_area3d.rst index 01b793e41..a68b560db 100644 --- a/classes/class_area3d.rst +++ b/classes/class_area3d.rst @@ -66,7 +66,7 @@ Properties +-------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`reverb_bus_amount` | ``0.0`` | +-------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`reverb_bus_enable` | ``false`` | +| :ref:`bool` | :ref:`reverb_bus_enabled` | ``false`` | +-------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ | :ref:`StringName` | :ref:`reverb_bus_name` | ``&"Master"`` | +-------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ @@ -491,9 +491,9 @@ The degree to which this area applies reverb to its associated audio. Ranges fro ---- -.. _class_Area3D_property_reverb_bus_enable: +.. _class_Area3D_property_reverb_bus_enabled: -- :ref:`bool` **reverb_bus_enable** +- :ref:`bool` **reverb_bus_enabled** +-----------+---------------------------+ | *Default* | ``false`` | @@ -511,15 +511,15 @@ If ``true``, the area applies reverb to its associated audio. - :ref:`StringName` **reverb_bus_name** -+-----------+-----------------------+ -| *Default* | ``&"Master"`` | -+-----------+-----------------------+ -| *Setter* | set_reverb_bus(value) | -+-----------+-----------------------+ -| *Getter* | get_reverb_bus() | -+-----------+-----------------------+ ++-----------+----------------------------+ +| *Default* | ``&"Master"`` | ++-----------+----------------------------+ +| *Setter* | set_reverb_bus_name(value) | ++-----------+----------------------------+ +| *Getter* | get_reverb_bus_name() | ++-----------+----------------------------+ -The reverb bus name to use for this area's associated audio. +The name of the reverb bus to use for this area's associated audio. ---- diff --git a/classes/class_array.rst b/classes/class_array.rst index c27f613e8..7a82faed2 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -157,6 +157,8 @@ Methods +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`min` **(** **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pick_random` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`pop_at` **(** :ref:`int` position **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`pop_back` **(** **)** | @@ -228,6 +230,8 @@ Constructs an empty ``Array``. - :ref:`Array` **Array** **(** :ref:`Array` base, :ref:`int` type, :ref:`StringName` class_name, :ref:`Variant` script **)** +Creates a typed array from the ``base`` array. The base array can't be already typed. See :ref:`set_typed` for more details. + ---- - :ref:`Array` **Array** **(** :ref:`Array` from **)** @@ -463,6 +467,8 @@ Assigns the given value to all elements in the array. This can typically be used +\ **Note:** If ``value`` is of a reference type (:ref:`Object`-derived, ``Array``, :ref:`Dictionary`, etc.) then the array is filled with the references to the same object, i.e. no duplicates are created. + ---- .. _class_Array_method_filter: @@ -516,18 +522,24 @@ Returns the first element of the array. Prints an error and returns ``null`` if - :ref:`int` **get_typed_builtin** **(** **)** |const| +Returns the :ref:`Variant.Type` constant for a typed array. If the ``Array`` is not typed, returns :ref:`@GlobalScope.TYPE_NIL`. + ---- .. _class_Array_method_get_typed_class_name: - :ref:`StringName` **get_typed_class_name** **(** **)** |const| +Returns a class name of a typed ``Array`` of type :ref:`@GlobalScope.TYPE_OBJECT`. + ---- .. _class_Array_method_get_typed_script: - :ref:`Variant` **get_typed_script** **(** **)** |const| +Returns the script associated with a typed array tied to a class name. + ---- .. _class_Array_method_has: @@ -557,8 +569,6 @@ Returns ``true`` if the array contains the given value. - - \ **Note:** This is equivalent to using the ``in`` operator as follows: @@ -617,12 +627,16 @@ Returns ``true`` if the array is empty. - :ref:`bool` **is_read_only** **(** **)** |const| +Returns ``true`` if the array is read-only. See :ref:`set_read_only`. Arrays are automatically read-only if declared with ``const`` keyword. + ---- .. _class_Array_method_is_typed: - :ref:`bool` **is_typed** **(** **)** |const| +Returns ``true`` if the array is typed. Typed arrays can only store elements of their associated type and provide type safety for the ``[]`` operator. Methods of typed array still return :ref:`Variant`. + ---- .. _class_Array_method_map: @@ -662,6 +676,19 @@ Returns the minimum value contained in the array if all elements are of comparab ---- +.. _class_Array_method_pick_random: + +- :ref:`Variant` **pick_random** **(** **)** |const| + +Returns a random value from the target array. + +:: + + var array: Array\ :ref:`int` = [1, 2, 3, 4] + print(array.pick_random()) # Prints either of the four numbers. + +---- + .. _class_Array_method_pop_at: - :ref:`Variant` **pop_at** **(** :ref:`int` position **)** @@ -769,12 +796,18 @@ Searches the array in reverse order. Optionally, a start search index can be pas - void **set_read_only** **(** :ref:`bool` enable **)** +Makes the ``Array`` read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays. + ---- .. _class_Array_method_set_typed: - void **set_typed** **(** :ref:`int` type, :ref:`StringName` class_name, :ref:`Variant` script **)** +Makes the ``Array`` typed. The ``type`` should be one of the :ref:`Variant.Type` constants. ``class_name`` is optional and can only be provided for :ref:`@GlobalScope.TYPE_OBJECT`. ``script`` can only be provided if ``class_name`` is not empty. + +The method fails if an array is already typed. + ---- .. _class_Array_method_shuffle: @@ -885,6 +918,8 @@ Sorts the array using a custom method. The custom method receives two arguments - :ref:`bool` **typed_assign** **(** :ref:`Array` array **)** +Assigns a different ``Array`` to this array reference. It the array is typed, the new array's type must be compatible and its elements will be automatically converted. + Operator Descriptions --------------------- diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index 705dc792a..5cb6e6d60 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -385,7 +385,7 @@ Removes the point associated with the given ``id`` from the points pool. - void **reserve_space** **(** :ref:`int` num_nodes **)** -Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. +Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. ---- diff --git a/classes/class_astar3d.rst b/classes/class_astar3d.rst index e0ce46bd4..778a29435 100644 --- a/classes/class_astar3d.rst +++ b/classes/class_astar3d.rst @@ -421,7 +421,7 @@ Removes the point associated with the given ``id`` from the points pool. - void **reserve_space** **(** :ref:`int` num_nodes **)** -Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. +Reserves space internally for ``num_nodes`` points. Useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. ---- diff --git a/classes/class_audiostreamgeneratorplayback.rst b/classes/class_audiostreamgeneratorplayback.rst index 87771f3df..8c83d70c3 100644 --- a/classes/class_audiostreamgeneratorplayback.rst +++ b/classes/class_audiostreamgeneratorplayback.rst @@ -66,7 +66,7 @@ Clears the audio sample data buffer. - :ref:`int` **get_frames_available** **(** **)** |const| -Returns the number of audio data frames left to play. If this returned number reaches ``0``, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking. +Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is ``0``, the buffer is full. ---- diff --git a/classes/class_basebutton.rst b/classes/class_basebutton.rst index 7f2acd7f0..1fb8a1216 100644 --- a/classes/class_basebutton.rst +++ b/classes/class_basebutton.rst @@ -24,27 +24,29 @@ BaseButton is the abstract base class for buttons, so it shouldn't be used direc Properties ---------- -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`ActionMode` | :ref:`action_mode` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`ButtonGroup` | :ref:`button_group` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`MouseButton` | :ref:`button_mask` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`button_pressed` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`disabled` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`keep_pressed_outside` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`Shortcut` | :ref:`shortcut` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`Node` | :ref:`shortcut_context` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`shortcut_in_tooltip` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`toggle_mode` | -+---------------------------------------------------+-----------------------------------------------------------------------------+ ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`ActionMode` | :ref:`action_mode` | ``1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`ButtonGroup` | :ref:`button_group` | | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`MouseButton` | :ref:`button_mask` | ``1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`button_pressed` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`keep_pressed_outside` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`Shortcut` | :ref:`shortcut` | | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`shortcut_feedback` | ``true`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`shortcut_in_tooltip` | ``true`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`toggle_mode` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+ Methods ------- @@ -144,11 +146,13 @@ Property Descriptions - :ref:`ActionMode` **action_mode** -+----------+------------------------+ -| *Setter* | set_action_mode(value) | -+----------+------------------------+ -| *Getter* | get_action_mode() | -+----------+------------------------+ ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_action_mode(value) | ++-----------+------------------------+ +| *Getter* | get_action_mode() | ++-----------+------------------------+ Determines when the button is considered clicked, one of the :ref:`ActionMode` constants. @@ -172,11 +176,13 @@ The :ref:`ButtonGroup` associated with the button. Not to be - :ref:`MouseButton` **button_mask** -+----------+------------------------+ -| *Setter* | set_button_mask(value) | -+----------+------------------------+ -| *Getter* | get_button_mask() | -+----------+------------------------+ ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_button_mask(value) | ++-----------+------------------------+ +| *Getter* | get_button_mask() | ++-----------+------------------------+ Binary mask to choose which mouse buttons this button will respond to. @@ -188,11 +194,13 @@ To allow both left-click and right-click, use ``MOUSE_BUTTON_MASK_LEFT | MOUSE_B - :ref:`bool` **button_pressed** -+----------+--------------------+ -| *Setter* | set_pressed(value) | -+----------+--------------------+ -| *Getter* | is_pressed() | -+----------+--------------------+ ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ If ``true``, the button's state is pressed. Means the button is pressed down or toggled (if :ref:`toggle_mode` is active). Only works if :ref:`toggle_mode` is ``true``. @@ -204,11 +212,13 @@ If ``true``, the button's state is pressed. Means the button is pressed down or - :ref:`bool` **disabled** -+----------+---------------------+ -| *Setter* | set_disabled(value) | -+----------+---------------------+ -| *Getter* | is_disabled() | -+----------+---------------------+ ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ If ``true``, the button is in disabled state and can't be clicked or toggled. @@ -218,11 +228,13 @@ If ``true``, the button is in disabled state and can't be clicked or toggled. - :ref:`bool` **keep_pressed_outside** -+----------+---------------------------------+ -| *Setter* | set_keep_pressed_outside(value) | -+----------+---------------------------------+ -| *Getter* | is_keep_pressed_outside() | -+----------+---------------------------------+ ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_keep_pressed_outside(value) | ++-----------+---------------------------------+ +| *Getter* | is_keep_pressed_outside() | ++-----------+---------------------------------+ If ``true``, the button stays pressed when moving the cursor outside the button while pressing it. @@ -244,17 +256,19 @@ If ``true``, the button stays pressed when moving the cursor outside the button ---- -.. _class_BaseButton_property_shortcut_context: +.. _class_BaseButton_property_shortcut_feedback: -- :ref:`Node` **shortcut_context** +- :ref:`bool` **shortcut_feedback** -+----------+-----------------------------+ -| *Setter* | set_shortcut_context(value) | -+----------+-----------------------------+ -| *Getter* | get_shortcut_context() | -+----------+-----------------------------+ ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_shortcut_feedback(value) | ++-----------+------------------------------+ +| *Getter* | is_shortcut_feedback() | ++-----------+------------------------------+ -The :ref:`Node` which must be a parent of the focused GUI :ref:`Control` for the shortcut to be activated. If ``null``, 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. +If ``true``, the button will appear pressed when its shortcut is activated. If ``false`` and :ref:`toggle_mode` is ``false``, the shortcut will activate the button without appearing to press the button. ---- @@ -262,11 +276,13 @@ The :ref:`Node` which must be a parent of the focused GUI :ref:`Cont - :ref:`bool` **shortcut_in_tooltip** -+----------+----------------------------------+ -| *Setter* | set_shortcut_in_tooltip(value) | -+----------+----------------------------------+ -| *Getter* | is_shortcut_in_tooltip_enabled() | -+----------+----------------------------------+ ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_shortcut_in_tooltip(value) | ++-----------+----------------------------------+ +| *Getter* | is_shortcut_in_tooltip_enabled() | ++-----------+----------------------------------+ If ``true``, the button will add information about its shortcut in the tooltip. @@ -276,11 +292,13 @@ If ``true``, the button will add information about its shortcut in the tooltip. - :ref:`bool` **toggle_mode** -+----------+------------------------+ -| *Setter* | set_toggle_mode(value) | -+----------+------------------------+ -| *Getter* | is_toggle_mode() | -+----------+------------------------+ ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_toggle_mode(value) | ++-----------+------------------------+ +| *Getter* | is_toggle_mode() | ++-----------+------------------------+ If ``true``, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. diff --git a/classes/class_basematerial3d.rst b/classes/class_basematerial3d.rst index ccd664bb5..20e71bf83 100644 --- a/classes/class_basematerial3d.rst +++ b/classes/class_basematerial3d.rst @@ -180,7 +180,7 @@ Properties +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`proximity_fade_distance` | ``1.0`` | +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`proximity_fade_enable` | ``false`` | +| :ref:`bool` | :ref:`proximity_fade_enabled` | ``false`` | +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`refraction_enabled` | ``false`` | +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+-----------------------+ @@ -687,7 +687,7 @@ enum **Flags**: - **FLAG_SUBSURFACE_MODE_SKIN** = **18** --- Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin. -- **FLAG_PARTICLE_TRAILS_MODE** = **19** +- **FLAG_PARTICLE_TRAILS_MODE** = **19** --- Enables parts of the shader required for :ref:`GPUParticles3D` trails to function. This also requires using a mesh with appropriate skinning, such as :ref:`RibbonTrailMesh` or :ref:`TubeTrailMesh`. Enabling this feature outside of materials used in :ref:`GPUParticles3D` meshes will break material rendering. - **FLAG_ALBEDO_TEXTURE_MSDF** = **20** --- Enables multichannel signed distance field rendering shader. @@ -1104,7 +1104,7 @@ The color used by the backlight effect. Represents the light passing through an | *Getter* | get_feature() | +-----------+--------------------+ -If ``true``, the backlight effect is enabled. +If ``true``, the backlight effect is enabled. See also :ref:`subsurf_scatter_transmittance_enabled`. ---- @@ -1946,6 +1946,8 @@ Texture used to specify the normal at a given pixel. The :ref:`normal_texture`, :ref:`roughness_texture` and :ref:`metallic_texture` in :ref:`ORMMaterial3D`. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored. + ---- .. _class_BaseMaterial3D_property_particles_anim_h_frames: @@ -2022,17 +2024,17 @@ Distance over which the fade effect takes place. The larger the distance the lon ---- -.. _class_BaseMaterial3D_property_proximity_fade_enable: +.. _class_BaseMaterial3D_property_proximity_fade_enabled: -- :ref:`bool` **proximity_fade_enable** +- :ref:`bool` **proximity_fade_enabled** -+-----------+-----------------------------+ -| *Default* | ``false`` | -+-----------+-----------------------------+ -| *Setter* | set_proximity_fade(value) | -+-----------+-----------------------------+ -| *Getter* | is_proximity_fade_enabled() | -+-----------+-----------------------------+ ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_proximity_fade_enabled(value) | ++-----------+-----------------------------------+ +| *Getter* | is_proximity_fade_enabled() | ++-----------+-----------------------------------+ If ``true``, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. @@ -2256,7 +2258,7 @@ If ``true``, enables the "shadow to opacity" render mode where lighting modifies The method for rendering the specular blob. See :ref:`SpecularMode`. -\ **Note:** Only applies to the specular blob. Does not affect specular reflections from the Sky, SSR, or ReflectionProbes. +\ **Note:** :ref:`specular_mode` only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, :ref:`VoxelGI`, SDFGI or :ref:`ReflectionProbe`\ s. To disable reflections from these sources as well, set :ref:`metallic_specular` to ``0.0`` instead. ---- @@ -2288,7 +2290,7 @@ If ``true``, subsurface scattering is enabled. Emulates light that penetrates an | *Getter* | get_flag() | +-----------+-----------------+ -If ``true``, subsurface scattering will use a special mode optimized for the color and density of human skin. +If ``true``, subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering. ---- @@ -2334,6 +2336,8 @@ Texture used to control the subsurface scattering strength. Stored in the red te | *Getter* | get_transmittance_boost() | +-----------+--------------------------------+ +The intensity of the subsurface scattering transmittance effect. + ---- .. _class_BaseMaterial3D_property_subsurf_scatter_transmittance_color: @@ -2348,6 +2352,8 @@ Texture used to control the subsurface scattering strength. Stored in the red te | *Getter* | get_transmittance_color() | +-----------+--------------------------------+ +The color to multiply the subsurface scattering transmittance effect with. Ignored if :ref:`subsurf_scatter_skin_mode` is ``true``. + ---- .. _class_BaseMaterial3D_property_subsurf_scatter_transmittance_depth: @@ -2362,6 +2368,8 @@ Texture used to control the subsurface scattering strength. Stored in the red te | *Getter* | get_transmittance_depth() | +-----------+--------------------------------+ +The depth of the subsurface scattering transmittance effect. + ---- .. _class_BaseMaterial3D_property_subsurf_scatter_transmittance_enabled: @@ -2376,6 +2384,8 @@ Texture used to control the subsurface scattering strength. Stored in the red te | *Getter* | get_feature() | +-----------+--------------------+ +If ``true``, enables subsurface scattering transmittance. Only effective if :ref:`subsurf_scatter_enabled` is ``true``. See also :ref:`backlight_enabled`. + ---- .. _class_BaseMaterial3D_property_subsurf_scatter_transmittance_texture: @@ -2388,6 +2398,8 @@ Texture used to control the subsurface scattering strength. Stored in the red te | *Getter* | get_texture() | +----------+--------------------+ +The texture to use for multiplying the intensity of the subsurface scattering transmitteance intensity. See also :ref:`subsurf_scatter_texture`. Ignored if :ref:`subsurf_scatter_skin_mode` is ``true``. + ---- .. _class_BaseMaterial3D_property_texture_filter: @@ -2452,6 +2464,8 @@ If ``true``, transparency is enabled on the body. See also :ref:`blend_mode` trails to function. This also requires using a mesh with appropriate skinning, such as :ref:`RibbonTrailMesh` or :ref:`TubeTrailMesh`. Enabling this feature outside of materials used in :ref:`GPUParticles3D` meshes will break material rendering. + ---- .. _class_BaseMaterial3D_property_use_point_size: diff --git a/classes/class_basis.rst b/classes/class_basis.rst index 849308ac8..b79a5c526 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -86,6 +86,8 @@ Methods +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Basis` b **)** |const| | +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`looking_at` **(** :ref:`Vector3` target, :ref:`Vector3` up=Vector3(0, 1, 0) **)** |static| | +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`orthonormalized` **(** **)** |const| | @@ -127,18 +129,6 @@ Operators Constants --------- -.. _class_Basis_constant_EULER_ORDER_XYZ: - -.. _class_Basis_constant_EULER_ORDER_XZY: - -.. _class_Basis_constant_EULER_ORDER_YXZ: - -.. _class_Basis_constant_EULER_ORDER_YZX: - -.. _class_Basis_constant_EULER_ORDER_ZXY: - -.. _class_Basis_constant_EULER_ORDER_ZYX: - .. _class_Basis_constant_IDENTITY: .. _class_Basis_constant_FLIP_X: @@ -147,18 +137,6 @@ Constants .. _class_Basis_constant_FLIP_Z: -- **EULER_ORDER_XYZ** = **0** - -- **EULER_ORDER_XZY** = **1** - -- **EULER_ORDER_YXZ** = **2** - -- **EULER_ORDER_YZX** = **3** - -- **EULER_ORDER_ZXY** = **4** - -- **EULER_ORDER_ZYX** = **5** - - **IDENTITY** = **Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)** --- The identity basis, with no rotation or scaling applied. This is identical to calling ``Basis()`` without any parameters. This constant can be used to make your code clearer, and for consistency with C#. @@ -256,6 +234,8 @@ A negative determinant means the basis has a negative scale. A zero determinant - :ref:`Basis` **from_euler** **(** :ref:`Vector3` euler, :ref:`int` order=2 **)** |static| +Constructs a pure rotation Basis matrix from Euler angles in the specified Euler rotation order. By default, use YXZ order (most common). See the :ref:`EulerOrder` enum for possible values. + ---- .. _class_Basis_method_from_scale: @@ -308,6 +288,14 @@ Returns ``true`` if this basis and ``b`` are approximately equal, by calling ``i ---- +.. _class_Basis_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this basis is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Basis_method_looking_at: - :ref:`Basis` **looking_at** **(** :ref:`Vector3` target, :ref:`Vector3` up=Vector3(0, 1, 0) **)** |static| diff --git a/classes/class_bitmap.rst b/classes/class_bitmap.rst index b4d1e567b..a6f0cf644 100644 --- a/classes/class_bitmap.rst +++ b/classes/class_bitmap.rst @@ -57,7 +57,7 @@ Method Descriptions - :ref:`Image` **convert_to_image** **(** **)** |const| -Returns an image of the same size as the bitmap and with a :ref:`Format` of type ``FORMAT_L8``. ``true`` bits of the bitmap are being converted into white pixels, and ``false`` bits into black. +Returns an image of the same size as the bitmap and with a :ref:`Format` of type :ref:`Image.FORMAT_L8`. ``true`` bits of the bitmap are being converted into white pixels, and ``false`` bits into black. ---- diff --git a/classes/class_bonemap.rst b/classes/class_bonemap.rst index 6cb234be5..858a631fc 100644 --- a/classes/class_bonemap.rst +++ b/classes/class_bonemap.rst @@ -21,6 +21,11 @@ This class contains a hashmap that uses a list of bone names in :ref:`SkeletonPr By assigning the actual :ref:`Skeleton3D` bone name as the key value, it maps the :ref:`Skeleton3D` to the :ref:`SkeletonProfile`. +Tutorials +--------- + +- :doc:`Retargeting 3D Skeletons <../tutorials/assets_pipeline/retargeting_3d_skeletons>` + Properties ---------- diff --git a/classes/class_button.rst b/classes/class_button.rst index 25d3f65d0..57052223a 100644 --- a/classes/class_button.rst +++ b/classes/class_button.rst @@ -31,7 +31,7 @@ Button is the standard themed button. It can contain text and an icon, and will func _ready(): var button = Button.new() button.text = "Click me" - button.connect("pressed", self, "_button_pressed") + button.pressed.connect(self._button_pressed) add_child(button) func _button_pressed(): @@ -43,7 +43,7 @@ Button is the standard themed button. It can contain text and an icon, and will { var button = new Button(); button.Text = "Click me"; - button.Connect("pressed", this, nameof(ButtonPressed)); + button.Pressed += ButtonPressed; AddChild(button); } diff --git a/classes/class_callbacktweener.rst b/classes/class_callbacktweener.rst index 0704922d6..c29532308 100644 --- a/classes/class_callbacktweener.rst +++ b/classes/class_callbacktweener.rst @@ -35,7 +35,9 @@ Method Descriptions - :ref:`CallbackTweener` **set_delay** **(** :ref:`float` delay **)** -Makes the callback call delayed by given time in seconds. Example: +Makes the callback call delayed by given time in seconds. + +\ **Example:**\ :: diff --git a/classes/class_camera2d.rst b/classes/class_camera2d.rst index 736cebbc8..871e9a843 100644 --- a/classes/class_camera2d.rst +++ b/classes/class_camera2d.rst @@ -80,16 +80,16 @@ Properties +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`position_smoothing_enabled` | ``false`` | ++-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`position_smoothing_speed` | ``5.0`` | ++-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ | :ref:`Camera2DProcessCallback` | :ref:`process_callback` | ``1`` | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ | :ref:`bool` | :ref:`rotation_smoothing_enabled` | ``false`` | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ | :ref:`float` | :ref:`rotation_smoothing_speed` | ``5.0`` | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ -| :ref:`bool` | :ref:`smoothing_enabled` | ``false`` | -+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ -| :ref:`float` | :ref:`smoothing_speed` | ``5.0`` | -+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`zoom` | ``Vector2(1, 1)`` | +-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+ @@ -452,7 +452,7 @@ Right scroll limit in pixels. The camera stops moving when reaching this value, If ``true``, the camera smoothly stops when reaches its limits. -This property has no effect if :ref:`smoothing_enabled` is ``false``. +This property has no effect if :ref:`position_smoothing_enabled` is ``false``. \ **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke :ref:`reset_smoothing`. @@ -490,6 +490,38 @@ The camera's relative offset. Useful for looking around or camera shake animatio ---- +.. _class_Camera2D_property_position_smoothing_enabled: + +- :ref:`bool` **position_smoothing_enabled** + ++-----------+---------------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------------+ +| *Setter* | set_position_smoothing_enabled(value) | ++-----------+---------------------------------------+ +| *Getter* | is_position_smoothing_enabled() | ++-----------+---------------------------------------+ + +If ``true``, the camera's view smoothly moves towards its target position at :ref:`position_smoothing_speed`. + +---- + +.. _class_Camera2D_property_position_smoothing_speed: + +- :ref:`float` **position_smoothing_speed** + ++-----------+-------------------------------------+ +| *Default* | ``5.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_position_smoothing_speed(value) | ++-----------+-------------------------------------+ +| *Getter* | get_position_smoothing_speed() | ++-----------+-------------------------------------+ + +Speed in pixels per second of the camera's smoothing effect when :ref:`position_smoothing_enabled` is ``true``. + +---- + .. _class_Camera2D_property_process_callback: - :ref:`Camera2DProcessCallback` **process_callback** @@ -540,38 +572,6 @@ The angular, asymptotic speed of the camera's rotation smoothing effect when :re ---- -.. _class_Camera2D_property_smoothing_enabled: - -- :ref:`bool` **smoothing_enabled** - -+-----------+------------------------------------+ -| *Default* | ``false`` | -+-----------+------------------------------------+ -| *Setter* | set_enable_follow_smoothing(value) | -+-----------+------------------------------------+ -| *Getter* | is_follow_smoothing_enabled() | -+-----------+------------------------------------+ - -If ``true``, the camera smoothly moves towards the target at :ref:`smoothing_speed`. - ----- - -.. _class_Camera2D_property_smoothing_speed: - -- :ref:`float` **smoothing_speed** - -+-----------+-----------------------------+ -| *Default* | ``5.0`` | -+-----------+-----------------------------+ -| *Setter* | set_follow_smoothing(value) | -+-----------+-----------------------------+ -| *Getter* | get_follow_smoothing() | -+-----------+-----------------------------+ - -Speed in pixels per second of the camera's smoothing effect when :ref:`smoothing_enabled` is ``true``. - ----- - .. _class_Camera2D_property_zoom: - :ref:`Vector2` **zoom** @@ -637,7 +637,7 @@ Returns the center of the screen from this camera's point of view, in global coo Returns this camera's target position, in global coordinates. -\ **Note:** The returned value is not the same as :ref:`Node2D.global_position`, as it is affected by the drag properties. It is also not the same as the current position if :ref:`smoothing_enabled` is ``true`` (see :ref:`get_screen_center_position`). +\ **Note:** The returned value is not the same as :ref:`Node2D.global_position`, as it is affected by the drag properties. It is also not the same as the current position if :ref:`position_smoothing_enabled` is ``true`` (see :ref:`get_screen_center_position`). ---- @@ -647,7 +647,7 @@ Returns this camera's target position, in global coordinates. Sets the camera's position immediately to its current smoothing destination. -This method has no effect if :ref:`smoothing_enabled` is ``false``. +This method has no effect if :ref:`position_smoothing_enabled` is ``false``. ---- diff --git a/classes/class_cameraattributes.rst b/classes/class_cameraattributes.rst index 291b78ef4..2864ef1a1 100644 --- a/classes/class_cameraattributes.rst +++ b/classes/class_cameraattributes.rst @@ -30,17 +30,17 @@ This is a pure virtual class that is inherited by :ref:`CameraAttributesPhysical Properties ---------- -+---------------------------+-------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`auto_exposure_enabled` | -+---------------------------+-------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`auto_exposure_scale` | -+---------------------------+-------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`auto_exposure_speed` | -+---------------------------+-------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`exposure_multiplier` | -+---------------------------+-------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`exposure_sensitivity` | -+---------------------------+-------------------------------------------------------------------------------------+ ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`auto_exposure_enabled` | ``false`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`auto_exposure_scale` | ``0.4`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`auto_exposure_speed` | ``0.5`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`exposure_multiplier` | ``1.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`exposure_sensitivity` | ``100.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ Property Descriptions --------------------- @@ -49,11 +49,13 @@ Property Descriptions - :ref:`bool` **auto_exposure_enabled** -+----------+----------------------------------+ -| *Setter* | set_auto_exposure_enabled(value) | -+----------+----------------------------------+ -| *Getter* | is_auto_exposure_enabled() | -+----------+----------------------------------+ ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_auto_exposure_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_auto_exposure_enabled() | ++-----------+----------------------------------+ If ``true``, enables the tonemapping auto exposure mode of the scene renderer. If ``true``, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. @@ -63,11 +65,13 @@ If ``true``, enables the tonemapping auto exposure mode of the scene renderer. I - :ref:`float` **auto_exposure_scale** -+----------+--------------------------------+ -| *Setter* | set_auto_exposure_scale(value) | -+----------+--------------------------------+ -| *Getter* | get_auto_exposure_scale() | -+----------+--------------------------------+ ++-----------+--------------------------------+ +| *Default* | ``0.4`` | ++-----------+--------------------------------+ +| *Setter* | set_auto_exposure_scale(value) | ++-----------+--------------------------------+ +| *Getter* | get_auto_exposure_scale() | ++-----------+--------------------------------+ The scale of the auto exposure effect. Affects the intensity of auto exposure. @@ -77,11 +81,13 @@ The scale of the auto exposure effect. Affects the intensity of auto exposure. - :ref:`float` **auto_exposure_speed** -+----------+--------------------------------+ -| *Setter* | set_auto_exposure_speed(value) | -+----------+--------------------------------+ -| *Getter* | get_auto_exposure_speed() | -+----------+--------------------------------+ ++-----------+--------------------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------------------+ +| *Setter* | set_auto_exposure_speed(value) | ++-----------+--------------------------------+ +| *Getter* | get_auto_exposure_speed() | ++-----------+--------------------------------+ The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. @@ -91,11 +97,13 @@ The speed of the auto exposure effect. Affects the time needed for the camera to - :ref:`float` **exposure_multiplier** -+----------+--------------------------------+ -| *Setter* | set_exposure_multiplier(value) | -+----------+--------------------------------+ -| *Getter* | get_exposure_multiplier() | -+----------+--------------------------------+ ++-----------+--------------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------------+ +| *Setter* | set_exposure_multiplier(value) | ++-----------+--------------------------------+ +| *Getter* | get_exposure_multiplier() | ++-----------+--------------------------------+ Multiplier for the exposure amount. A higher value results in a brighter image. @@ -105,11 +113,13 @@ Multiplier for the exposure amount. A higher value results in a brighter image. - :ref:`float` **exposure_sensitivity** -+----------+---------------------------------+ -| *Setter* | set_exposure_sensitivity(value) | -+----------+---------------------------------+ -| *Getter* | get_exposure_sensitivity() | -+----------+---------------------------------+ ++-----------+---------------------------------+ +| *Default* | ``100.0`` | ++-----------+---------------------------------+ +| *Setter* | set_exposure_sensitivity(value) | ++-----------+---------------------------------+ +| *Getter* | get_exposure_sensitivity() | ++-----------+---------------------------------+ Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image. Only available when :ref:`ProjectSettings.rendering/lights_and_shadows/use_physical_light_units` is enabled. When :ref:`auto_exposure_enabled` this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop. diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index bec5a6c30..0ff9f603e 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -43,29 +43,31 @@ Tutorials Properties ---------- -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`clip_children` | ``false`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`light_mask` | ``1`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`Material` | :ref:`material` | | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`modulate` | ``Color(1, 1, 1, 1)`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`self_modulate` | ``Color(1, 1, 1, 1)`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`show_behind_parent` | ``false`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`TextureFilter` | :ref:`texture_filter` | ``0`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`TextureRepeat` | :ref:`texture_repeat` | ``0`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`top_level` | ``false`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`use_parent_material` | ``false`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`visible` | ``true`` | -+-----------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`ClipChildrenMode` | :ref:`clip_children` | ``0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`light_mask` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`Material` | :ref:`material` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color(1, 1, 1, 1)`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`Color` | :ref:`self_modulate` | ``Color(1, 1, 1, 1)`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`show_behind_parent` | ``false`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`TextureFilter` | :ref:`texture_filter` | ``0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`TextureRepeat` | :ref:`texture_repeat` | ``0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`top_level` | ``false`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`use_parent_material` | ``false`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`visibility_layer` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`visible` | ``true`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+-----------------------+ Methods ------- @@ -157,6 +159,8 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`get_viewport_transform` **(** **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_visibility_layer_bit` **(** :ref:`int` layer **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`World2D` | :ref:`get_world_2d` **(** **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`hide` **(** **)** | @@ -179,6 +183,8 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_notify_transform` **(** :ref:`bool` enable **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_visibility_layer_bit` **(** :ref:`int` layer, :ref:`bool` enabled **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`show` **(** **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -286,6 +292,28 @@ enum **TextureRepeat**: - **TEXTURE_REPEAT_MAX** = **4** --- Represents the size of the :ref:`TextureRepeat` enum. +---- + +.. _enum_CanvasItem_ClipChildrenMode: + +.. _class_CanvasItem_constant_CLIP_CHILDREN_DISABLED: + +.. _class_CanvasItem_constant_CLIP_CHILDREN_ONLY: + +.. _class_CanvasItem_constant_CLIP_CHILDREN_AND_DRAW: + +.. _class_CanvasItem_constant_CLIP_CHILDREN_MAX: + +enum **ClipChildrenMode**: + +- **CLIP_CHILDREN_DISABLED** = **0** + +- **CLIP_CHILDREN_ONLY** = **1** + +- **CLIP_CHILDREN_AND_DRAW** = **2** + +- **CLIP_CHILDREN_MAX** = **3** + Constants --------- @@ -318,15 +346,15 @@ Property Descriptions .. _class_CanvasItem_property_clip_children: -- :ref:`bool` **clip_children** +- :ref:`ClipChildrenMode` **clip_children** -+-----------+--------------------------+ -| *Default* | ``false`` | -+-----------+--------------------------+ -| *Setter* | set_clip_children(value) | -+-----------+--------------------------+ -| *Getter* | is_clipping_children() | -+-----------+--------------------------+ ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_clip_children_mode(value) | ++-----------+-------------------------------+ +| *Getter* | get_clip_children_mode() | ++-----------+-------------------------------+ Allows the current node to clip children nodes, essentially acting as a mask. @@ -474,6 +502,22 @@ If ``true``, the parent ``CanvasItem``'s :ref:`material` **visibility_layer** + ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_visibility_layer(value) | ++-----------+-----------------------------+ +| *Getter* | get_visibility_layer() | ++-----------+-----------------------------+ + +The rendering layer in which this ``CanvasItem`` is rendered by :ref:`Viewport` nodes. A :ref:`Viewport` will render a ``CanvasItem`` if it and all its parents share a layer with the :ref:`Viewport`'s canvas cull mask. + +---- + .. _class_CanvasItem_property_visible: - :ref:`bool` **visible** @@ -571,7 +615,7 @@ After submitting all animations slices via :ref:`draw_animation_slice` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1) **)** -Draws a textured rectangle region of the font texture with LCD sub-pixel anti-aliasing at a given position, optionally modulated by a color. +Draws a textured rectangle region of the font texture with LCD subpixel anti-aliasing at a given position, optionally modulated by a color. Texture is drawn using the following blend operation, blend mode of the :ref:`CanvasItemMaterial` is ignored: @@ -829,7 +873,7 @@ Returns the mouse's position in the :ref:`CanvasLayer` that t - :ref:`Transform2D` **get_global_transform** **(** **)** |const| -Returns the global transform matrix of this item. +Returns the global transform matrix of this item, i.e. the combined transform up to the topmost ``CanvasItem`` node. The topmost item is a ``CanvasItem`` that either has no parent, has non-``CanvasItem`` parent or it has :ref:`top_level` enabled. ---- @@ -883,6 +927,14 @@ Returns this item's transform in relation to the viewport. ---- +.. _class_CanvasItem_method_get_visibility_layer_bit: + +- :ref:`bool` **get_visibility_layer_bit** **(** :ref:`int` layer **)** |const| + +Returns an individual bit on the rendering visibility layer. + +---- + .. _class_CanvasItem_method_get_world_2d: - :ref:`World2D` **get_world_2d** **(** **)** |const| @@ -973,6 +1025,14 @@ If ``enable`` is ``true``, this node will receive :ref:`NOTIFICATION_TRANSFORM_C ---- +.. _class_CanvasItem_method_set_visibility_layer_bit: + +- void **set_visibility_layer_bit** **(** :ref:`int` layer, :ref:`bool` enabled **)** + +Set/clear individual bits on the rendering visibility layer. This simplifies editing this ``CanvasItem``'s visibility layer. + +---- + .. _class_CanvasItem_method_show: - void **show** **(** **)** diff --git a/classes/class_canvaslayer.rst b/classes/class_canvaslayer.rst index 37b9c311b..9e92e1dcb 100644 --- a/classes/class_canvaslayer.rst +++ b/classes/class_canvaslayer.rst @@ -21,6 +21,8 @@ Description Canvas drawing layer. :ref:`CanvasItem` nodes that are direct or indirect children of a ``CanvasLayer`` will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a ``CanvasLayer`` with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). +Embedded :ref:`Window`\ s are placed in layer 1024. CanvasItems in layer 1025 or above appear in front of embedded windows, CanvasItems in layer 1023 or below appear behind embedded windows. + Tutorials --------- diff --git a/classes/class_canvastexture.rst b/classes/class_canvastexture.rst index a3e4975de..c7b0cc26c 100644 --- a/classes/class_canvastexture.rst +++ b/classes/class_canvastexture.rst @@ -12,7 +12,14 @@ CanvasTexture **Inherits:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` +Texture with optional normal and specular maps for use in 2D rendering. +Description +----------- + +``CanvasTexture`` is an alternative to :ref:`ImageTexture` for 2D rendering. It allows using normal maps and specular maps in any node that inherits from :ref:`CanvasItem`. ``CanvasTexture`` also allows overriding the texture's filter and repeat mode independently of the node's properties (or the project settings). + +\ **Note:** ``CanvasTexture`` cannot be used in 3D rendering. For physically-based materials in 3D, use :ref:`BaseMaterial3D` instead. Properties ---------- @@ -46,6 +53,8 @@ Property Descriptions | *Getter* | get_diffuse_texture() | +----------+----------------------------+ +The diffuse (color) texture to use. This is the main texture you want to set in most cases. + ---- .. _class_CanvasTexture_property_normal_texture: @@ -58,6 +67,10 @@ Property Descriptions | *Getter* | get_normal_texture() | +----------+---------------------------+ +The normal map texture to use. Only has a visible effect if :ref:`Light2D`\ s are affecting this ``CanvasTexture``. + +\ **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_CanvasTexture_property_specular_color: @@ -72,6 +85,8 @@ Property Descriptions | *Getter* | get_specular_color() | +-----------+---------------------------+ +The multiplier for specular reflection colors. The :ref:`Light2D`'s color is also taken into account when determining the reflection color. Only has a visible effect if :ref:`Light2D`\ s are affecting this ``CanvasTexture``. + ---- .. _class_CanvasTexture_property_specular_shininess: @@ -86,6 +101,8 @@ Property Descriptions | *Getter* | get_specular_shininess() | +-----------+-------------------------------+ +The specular exponent for :ref:`Light2D` specular reflections. Higher values result in a more glossy/"wet" look, with reflections becoming more localized and less visible overall. The default value of ``1.0`` disables specular reflections entirely. Only has a visible effect if :ref:`Light2D`\ s are affecting this ``CanvasTexture``. + ---- .. _class_CanvasTexture_property_specular_texture: @@ -98,6 +115,8 @@ Property Descriptions | *Getter* | get_specular_texture() | +----------+-----------------------------+ +The specular map to use for :ref:`Light2D` specular reflections. This should be a grayscale or colored texture, with brighter areas resulting in a higher :ref:`specular_shininess` value. Using a colored :ref:`specular_texture` allows controlling specular shininess on a per-channel basis. Only has a visible effect if :ref:`Light2D`\ s are affecting this ``CanvasTexture``. + ---- .. _class_CanvasTexture_property_texture_filter: @@ -112,6 +131,8 @@ Property Descriptions | *Getter* | get_texture_filter() | +-----------+---------------------------+ +The texture filtering mode to use when drawing this ``CanvasTexture``. + ---- .. _class_CanvasTexture_property_texture_repeat: @@ -126,6 +147,8 @@ Property Descriptions | *Getter* | get_texture_repeat() | +-----------+---------------------------+ +The texture repeat mode to use when drawing this ``CanvasTexture``. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_characterbody2d.rst b/classes/class_characterbody2d.rst index 44be1c3f3..1a3f89199 100644 --- a/classes/class_characterbody2d.rst +++ b/classes/class_characterbody2d.rst @@ -208,7 +208,7 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceili Sets a snapping distance. When set to a value different from ``0.0``, the body is kept attached to slopes when calling :ref:`move_and_slide`. The snapping vector is determined by the given distance along the opposite direction of the :ref:`up_direction`. -As long as the snapping vector is in contact with the ground and the body moves against `up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along `up_direction`, so it will be able to detach from the ground when jumping. +As long as the snapping vector is in contact with the ground and the body moves against :ref:`up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along :ref:`up_direction`, so it will be able to detach from the ground when jumping. ---- diff --git a/classes/class_characterbody3d.rst b/classes/class_characterbody3d.rst index 220137653..81c727073 100644 --- a/classes/class_characterbody3d.rst +++ b/classes/class_characterbody3d.rst @@ -210,7 +210,7 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceili Sets a snapping distance. When set to a value different from ``0.0``, the body is kept attached to slopes when calling :ref:`move_and_slide`. The snapping vector is determined by the given distance along the opposite direction of the :ref:`up_direction`. -As long as the snapping vector is in contact with the ground and the body moves against `up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along `up_direction`, so it will be able to detach from the ground when jumping. +As long as the snapping vector is in contact with the ground and the body moves against :ref:`up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along :ref:`up_direction`, so it will be able to detach from the ground when jumping. ---- diff --git a/classes/class_checkbox.rst b/classes/class_checkbox.rst index 934d3d3d3..2d2fb151b 100644 --- a/classes/class_checkbox.rst +++ b/classes/class_checkbox.rst @@ -17,7 +17,7 @@ Binary choice user interface widget. See also :ref:`CheckButton` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has **no** immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. +A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to :ref:`CheckButton` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has **no** immediate effect on something. For example, it could be used when toggling it will only do something once a confirmation button is pressed. See also :ref:`BaseButton` which contains common properties and methods associated with this node. diff --git a/classes/class_checkbutton.rst b/classes/class_checkbutton.rst index f830f498e..19b4c0330 100644 --- a/classes/class_checkbutton.rst +++ b/classes/class_checkbutton.rst @@ -17,7 +17,7 @@ Checkable button. See also :ref:`CheckBox`. Description ----------- -CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. +CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For example, it could be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. See also :ref:`BaseButton` which contains common properties and methods associated with this node. diff --git a/classes/class_classdb.rst b/classes/class_classdb.rst index a736b8fef..57b2bcc29 100644 --- a/classes/class_classdb.rst +++ b/classes/class_classdb.rst @@ -77,7 +77,7 @@ Method Descriptions - :ref:`bool` **can_instantiate** **(** :ref:`StringName` class **)** |const| -Returns ``true`` if you can instance objects from the specified ``class``, ``false`` in other case. +Returns ``true`` if objects can be instantiated from the specified ``class``, otherwise returns ``false``. ---- diff --git a/classes/class_codeedit.rst b/classes/class_codeedit.rst index d93933035..d0ba53675 100644 --- a/classes/class_codeedit.rst +++ b/classes/class_codeedit.rst @@ -17,7 +17,7 @@ Multiline text control intended for editing code. Description ----------- -CodeEdit is a specialised :ref:`TextEdit` designed for editing plain text code files. It contains a bunch of features commonly found in code editors such as line numbers, line folding, code completion, indent management and string / comment management. +CodeEdit is a specialized :ref:`TextEdit` designed for editing plain text code files. It contains a bunch of features commonly found in code editors such as line numbers, line folding, code completion, indent management and string / comment management. \ **Note:** By default ``CodeEdit`` always use left-to-right text direction to correctly display source code. @@ -235,7 +235,7 @@ Theme Properties +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_readonly_color` | ``Color(0.875, 0.875, 0.875, 0.5)`` | +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+ -| :ref:`Color` | :ref:`font_selected_color` | ``Color(0, 0, 0, 1)`` | +| :ref:`Color` | :ref:`font_selected_color` | ``Color(0, 0, 0, 0)`` | +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`line_length_guideline_color` | ``Color(0.3, 0.5, 0.8, 0.1)`` | +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+ @@ -1426,10 +1426,10 @@ Sets the font :ref:`Color` when :ref:`TextEdit.editable` **font_selected_color** +-----------+-----------------------+ -| *Default* | ``Color(0, 0, 0, 1)`` | +| *Default* | ``Color(0, 0, 0, 0)`` | +-----------+-----------------------+ -Sets the :ref:`Color` of the selected text. :ref:`TextEdit.override_selected_font_color` has to be enabled. +Sets the :ref:`Color` of the selected text. If equal to ``Color(0, 0, 0, 0)``, it will be ignored. ---- diff --git a/classes/class_color.rst b/classes/class_color.rst index 65a006b3b..f0e298111 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -90,8 +90,6 @@ Methods +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`darkened` **(** :ref:`float` amount **)** |const| | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`find_named_color` **(** :ref:`String` name **)** |static| | -+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`from_hsv` **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` alpha=1.0 **)** |static| | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`from_ok_hsl` **(** :ref:`float` h, :ref:`float` s, :ref:`float` l, :ref:`float` alpha=1.0 **)** |static| | @@ -102,12 +100,6 @@ Methods +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_luminance` **(** **)** |const| | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_named_color` **(** :ref:`int` idx **)** |static| | -+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_named_color_count` **(** **)** |static| | -+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_named_color_name` **(** :ref:`int` idx **)** |static| | -+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`hex` **(** :ref:`int` hex **)** |static| | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`hex64` **(** :ref:`int` hex **)** |static| | @@ -1035,12 +1027,6 @@ Returns a new color resulting from making this color darker by the specified per ----- - -.. _class_Color_method_find_named_color: - -- :ref:`int` **find_named_color** **(** :ref:`String` name **)** |static| - ---- .. _class_Color_method_from_hsv: @@ -1089,12 +1075,16 @@ Constructs a color from an `OK HSL profile ` **from_rgbe9995** **(** :ref:`int` rgbe **)** |static| +Encodes a ``Color`` from a RGBE9995 format integer. See :ref:`Image.FORMAT_RGBE9995`. + ---- .. _class_Color_method_from_string: - :ref:`Color` **from_string** **(** :ref:`String` str, :ref:`Color` default **)** |static| +Creates a ``Color`` from string, which can be either a HTML color code or a named color. Fallbacks to ``default`` if the string does not denote any valid color. + ---- .. _class_Color_method_get_luminance: @@ -1105,25 +1095,7 @@ Returns the luminance of the color in the ``[0.0, 1.0]`` range. This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. -\ **Note:** :ref:`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 :ref:`srgb_to_linear` to convert it to the linear color space first. - ----- - -.. _class_Color_method_get_named_color: - -- :ref:`Color` **get_named_color** **(** :ref:`int` idx **)** |static| - ----- - -.. _class_Color_method_get_named_color_count: - -- :ref:`int` **get_named_color_count** **(** **)** |static| - ----- - -.. _class_Color_method_get_named_color_name: - -- :ref:`String` **get_named_color_name** **(** :ref:`int` idx **)** |static| +\ **Note:** :ref:`get_luminance` relies on the color being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use :ref:`srgb_to_linear` to convert it to the linear color space first. ---- @@ -1131,12 +1103,20 @@ This is useful when determining light or dark color. Colors with a luminance sma - :ref:`Color` **hex** **(** :ref:`int` hex **)** |static| +Returns the ``Color`` associated with the provided integer number, with 8 bits per channel in ARGB order. The integer should be 32-bit. Best used with hexadecimal notation. + +:: + + modulate = Color.hex(0xffff0000) # red + ---- .. _class_Color_method_hex64: - :ref:`Color` **hex64** **(** :ref:`int` hex **)** |static| +Same as :ref:`hex`, but takes 64-bit integer and the color uses 16 bits per channel. + ---- .. _class_Color_method_html: diff --git a/classes/class_colorpicker.rst b/classes/class_colorpicker.rst index 6050b9f1f..4db0df109 100644 --- a/classes/class_colorpicker.rst +++ b/classes/class_colorpicker.rst @@ -29,23 +29,31 @@ Tutorials Properties ---------- -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`color` | ``Color(1, 1, 1, 1)`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`ColorModeType` | :ref:`color_mode` | ``0`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`deferred_mode` | ``false`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`edit_alpha` | ``true`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`PickerShapeType` | :ref:`picker_shape` | ``0`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`presets_enabled` | ``true`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`presets_visible` | ``true`` | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ -| :ref:`bool` | vertical | ``true`` (overrides :ref:`BoxContainer`) | -+----------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------------------+ ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_add_swatches` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`color` | ``Color(1, 1, 1, 1)`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`ColorModeType` | :ref:`color_mode` | ``0`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`color_modes_visible` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`deferred_mode` | ``false`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`edit_alpha` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`hex_visible` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`PickerShapeType` | :ref:`picker_shape` | ``0`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`presets_visible` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`sampler_visible` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`sliders_visible` | ``true`` | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`bool` | vertical | ``true`` (overrides :ref:`BoxContainer`) | ++----------------------------------------------------------+----------------------------------------------------------------------------+--------------------------------------------------------------------------------+ Methods ------- @@ -84,6 +92,8 @@ Theme Properties +-----------------------------------+--------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`color_hue` | | +-----------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture2D` | :ref:`color_okhsl_hue` | | ++-----------------------------------+--------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`expanded_arrow` | | +-----------------------------------+--------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`folded_arrow` | | @@ -167,6 +177,8 @@ OKHSL is a new color space similar to HSL but that better match perception by le .. _class_ColorPicker_constant_SHAPE_OKHSL_CIRCLE: +.. _class_ColorPicker_constant_SHAPE_NONE: + enum **PickerShapeType**: - **SHAPE_HSV_RECTANGLE** = **0** --- HSV Color Model rectangle color space. @@ -177,9 +189,27 @@ enum **PickerShapeType**: - **SHAPE_OKHSL_CIRCLE** = **3** --- HSL OK Color Model circle color space. +- **SHAPE_NONE** = **4** --- The color space shape and the shape select button are hidden. Can't be selected from the shapes popup. + Property Descriptions --------------------- +.. _class_ColorPicker_property_can_add_swatches: + +- :ref:`bool` **can_add_swatches** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_can_add_swatches(value) | ++-----------+-----------------------------+ +| *Getter* | are_swatches_enabled() | ++-----------+-----------------------------+ + +If ``true``, it's possible to add presets under Swatches. If ``false``, the button to add presets is disabled. + +---- + .. _class_ColorPicker_property_color: - :ref:`Color` **color** @@ -212,6 +242,22 @@ The currently selected color mode. See :ref:`ColorModeType` **color_modes_visible** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_modes_visible(value) | ++-----------+--------------------------+ +| *Getter* | are_modes_visible() | ++-----------+--------------------------+ + +If ``true``, the color mode buttons are visible. + +---- + .. _class_ColorPicker_property_deferred_mode: - :ref:`bool` **deferred_mode** @@ -244,6 +290,22 @@ If ``true``, shows an alpha channel slider (opacity). ---- +.. _class_ColorPicker_property_hex_visible: + +- :ref:`bool` **hex_visible** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_hex_visible(value) | ++-----------+------------------------+ +| *Getter* | is_hex_visible() | ++-----------+------------------------+ + +If ``true``, the hex color code input field is visible. + +---- + .. _class_ColorPicker_property_picker_shape: - :ref:`PickerShapeType` **picker_shape** @@ -260,22 +322,6 @@ The shape of the color space view. See :ref:`PickerShapeType` **presets_enabled** - -+-----------+----------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------+ -| *Setter* | set_presets_enabled(value) | -+-----------+----------------------------+ -| *Getter* | are_presets_enabled() | -+-----------+----------------------------+ - -If ``true``, the "add preset" button is enabled. - ----- - .. _class_ColorPicker_property_presets_visible: - :ref:`bool` **presets_visible** @@ -288,7 +334,39 @@ If ``true``, the "add preset" button is enabled. | *Getter* | are_presets_visible() | +-----------+----------------------------+ -If ``true``, saved color presets are visible. +If ``true``, the Swatches and Recent Colors presets are visible. + +---- + +.. _class_ColorPicker_property_sampler_visible: + +- :ref:`bool` **sampler_visible** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_sampler_visible(value) | ++-----------+----------------------------+ +| *Getter* | is_sampler_visible() | ++-----------+----------------------------+ + +If ``true``, the color sampler and color preview are visible. + +---- + +.. _class_ColorPicker_property_sliders_visible: + +- :ref:`bool` **sliders_visible** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_sliders_visible(value) | ++-----------+----------------------------+ +| *Getter* | are_sliders_visible() | ++-----------+----------------------------+ + +If ``true``, the color sliders are visible. Method Descriptions ------------------- @@ -366,6 +444,8 @@ The width of the hue selection slider. | *Default* | ``10`` | +-----------+--------+ +The minimum width of the color labels next to sliders. + ---- .. _class_ColorPicker_theme_constant_margin: @@ -428,6 +508,14 @@ Custom texture for the hue selection slider on the right. ---- +.. _class_ColorPicker_theme_icon_color_okhsl_hue: + +- :ref:`Texture2D` **color_okhsl_hue** + +Custom texture for the H slider in the OKHSL color mode. + +---- + .. _class_ColorPicker_theme_icon_expanded_arrow: - :ref:`Texture2D` **expanded_arrow** @@ -456,12 +544,16 @@ The indicator used to signalize that the color value is outside the 0-1 range. - :ref:`Texture2D` **picker_cursor** +The image displayed over the color box/circle (depending on the :ref:`picker_shape`), marking the currently selected color. + ---- .. _class_ColorPicker_theme_icon_sample_bg: - :ref:`Texture2D` **sample_bg** +Background panel for the color preview box (visible when the color is translucent). + ---- .. _class_ColorPicker_theme_icon_screen_picker: diff --git a/classes/class_configfile.rst b/classes/class_configfile.rst index ae6a6abfa..133747786 100644 --- a/classes/class_configfile.rst +++ b/classes/class_configfile.rst @@ -240,7 +240,7 @@ Returns ``true`` if the specified section-key pair exists. Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -250,7 +250,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Loads the encrypted config file specified as a parameter, using the provided ``key`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -260,7 +260,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Loads the encrypted config file specified as a parameter, using the provided ``password`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -270,7 +270,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -280,7 +280,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Saves the contents of the ``ConfigFile`` object to the file specified as a parameter. The output file uses an INI-style structure. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -290,7 +290,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``key`` to encrypt it. The output file uses an INI-style structure. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -300,7 +300,7 @@ Returns one of the :ref:`Error` code constants (``OK`` Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``password`` to encrypt it. The output file uses an INI-style structure. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- diff --git a/classes/class_confirmationdialog.rst b/classes/class_confirmationdialog.rst index 8e280834f..7f274dd58 100644 --- a/classes/class_confirmationdialog.rst +++ b/classes/class_confirmationdialog.rst @@ -28,11 +28,11 @@ To get cancel action, you can use: .. code-tab:: gdscript - get_cancel().connect("pressed", self, "cancelled") + get_cancel_button().pressed.connect(self.cancelled) .. code-tab:: csharp - GetCancel().Connect("pressed", this, nameof(Cancelled)); + GetCancelButton().Pressed += Cancelled; diff --git a/classes/class_container.rst b/classes/class_container.rst index 4c59ba881..78be01a10 100644 --- a/classes/class_container.rst +++ b/classes/class_container.rst @@ -83,7 +83,7 @@ Method Descriptions - :ref:`PackedInt32Array` **_get_allowed_size_flags_horizontal** **(** **)** |virtual| |const| -Implement to return a list of allowed horizontal :ref:`SizeFlags` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the inspector dock. +Implement to return a list of allowed horizontal :ref:`SizeFlags` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. \ **Note:** Having no size flags is equal to having :ref:`Control.SIZE_SHRINK_BEGIN`. As such, this value is always implicitly allowed. @@ -93,7 +93,7 @@ Implement to return a list of allowed horizontal :ref:`SizeFlags` **_get_allowed_size_flags_vertical** **(** **)** |virtual| |const| -Implement to return a list of allowed vertical :ref:`SizeFlags` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the inspector dock. +Implement to return a list of allowed vertical :ref:`SizeFlags` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. \ **Note:** Having no size flags is equal to having :ref:`Control.SIZE_SHRINK_BEGIN`. As such, this value is always implicitly allowed. diff --git a/classes/class_control.rst b/classes/class_control.rst index 398dff877..8ca9ae999 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -35,7 +35,7 @@ Only one ``Control`` node can be in focus. Only the node in focus will receive e Sets :ref:`mouse_filter` to :ref:`MOUSE_FILTER_IGNORE` to tell a ``Control`` node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. -\ :ref:`Theme` resources change the Control's appearance. If you change the :ref:`Theme` on a ``Control`` node, it affects all of its children. To override some of the theme's parameters, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override`. You can override the theme with the inspector. +\ :ref:`Theme` resources change the Control's appearance. If you change the :ref:`Theme` on a ``Control`` node, it affects all of its children. To override some of the theme's parameters, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override`. You can override the theme with the Inspector. \ **Note:** Theme items are *not* :ref:`Object` properties. This means you can't access their values using :ref:`Object.get` and :ref:`Object.set`. Instead, use the ``get_theme_*`` and ``add_theme_*_override`` methods provided by this class. @@ -53,79 +53,81 @@ Tutorials Properties ---------- -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`anchor_bottom` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`anchor_left` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`anchor_right` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`anchor_top` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`bool` | :ref:`auto_translate` | ``true`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`bool` | :ref:`clip_contents` | ``false`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2i` | :ref:`custom_minimum_size` | ``Vector2i(0, 0)`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`FocusMode` | :ref:`focus_mode` | ``0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_neighbor_bottom` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_neighbor_left` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_neighbor_right` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_neighbor_top` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_next` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`focus_previous` | ``NodePath("")`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2` | :ref:`global_position` | | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`GrowDirection` | :ref:`grow_horizontal` | ``1`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`GrowDirection` | :ref:`grow_vertical` | ``1`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`LayoutDirection` | :ref:`layout_direction` | ``0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`CursorShape` | :ref:`mouse_default_cursor_shape` | ``0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`MouseFilter` | :ref:`mouse_filter` | ``0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`bool` | :ref:`mouse_force_pass_scroll_events` | ``true`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`offset_bottom` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`offset_left` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`offset_right` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`offset_top` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2` | :ref:`pivot_offset` | ``Vector2(0, 0)`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`rotation` | ``0.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2` | :ref:`scale` | ``Vector2(1, 1)`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Vector2` | :ref:`size` | ``Vector2(0, 0)`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`int` | :ref:`size_flags_horizontal` | ``1`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`size_flags_stretch_ratio` | ``1.0`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`int` | :ref:`size_flags_vertical` | ``1`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`Theme` | :ref:`theme` | | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`StringName` | :ref:`theme_type_variation` | ``&""`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ -| :ref:`String` | :ref:`tooltip_text` | ``""`` | -+------------------------------------------------------+----------------------------------------------------------------------------------------------+--------------------+ ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`anchor_bottom` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`anchor_left` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`anchor_right` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`anchor_top` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`auto_translate` | ``true`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`clip_contents` | ``false`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`custom_minimum_size` | ``Vector2(0, 0)`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`FocusMode` | :ref:`focus_mode` | ``0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_neighbor_bottom` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_neighbor_left` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_neighbor_right` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_neighbor_top` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_next` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`focus_previous` | ``NodePath("")`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`global_position` | | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`GrowDirection` | :ref:`grow_horizontal` | ``1`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`GrowDirection` | :ref:`grow_vertical` | ``1`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`LayoutDirection` | :ref:`layout_direction` | ``0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`CursorShape` | :ref:`mouse_default_cursor_shape` | ``0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`MouseFilter` | :ref:`mouse_filter` | ``0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`mouse_force_pass_scroll_events` | ``true`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`offset_bottom` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`offset_left` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`offset_right` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`offset_top` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`pivot_offset` | ``Vector2(0, 0)`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`rotation` | ``0.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`scale` | ``Vector2(1, 1)`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Node` | :ref:`shortcut_context` | | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2(0, 0)`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`size_flags_horizontal` | ``1`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`size_flags_stretch_ratio` | ``1.0`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`size_flags_vertical` | ``1`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Theme` | :ref:`theme` | | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`StringName` | :ref:`theme_type_variation` | ``&""`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ +| :ref:`String` | :ref:`tooltip_text` | ``""`` | ++------------------------------------------------------+----------------------------------------------------------------------------------------------+-------------------+ Methods ------- @@ -616,7 +618,7 @@ enum **MouseFilter**: - **MOUSE_FILTER_STOP** = **0** --- The control will receive mouse button input events through :ref:`_gui_input` if clicked on. And the control will receive the :ref:`mouse_entered` and :ref:`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. -- **MOUSE_FILTER_PASS** = **1** --- The control will receive mouse button input events through :ref:`_gui_input` if clicked on. And the control will receive the :ref:`mouse_entered` and :ref:`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. +- **MOUSE_FILTER_PASS** = **1** --- The control will receive mouse button input events through :ref:`_gui_input` if clicked on. And the control will receive the :ref:`mouse_entered` and :ref:`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 :ref:`Node._unhandled_input` for further processing. - **MOUSE_FILTER_IGNORE** = **2** --- The control will not receive mouse button input events through :ref:`_gui_input`. The control will also not receive the :ref:`mouse_entered` nor :ref:`mouse_exited` signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. @@ -840,10 +842,10 @@ Enables whether rendering of :ref:`CanvasItem` based children .. _class_Control_property_custom_minimum_size: -- :ref:`Vector2i` **custom_minimum_size** +- :ref:`Vector2` **custom_minimum_size** +-----------+--------------------------------+ -| *Default* | ``Vector2i(0, 0)`` | +| *Default* | ``Vector2(0, 0)`` | +-----------+--------------------------------+ | *Setter* | set_custom_minimum_size(value) | +-----------+--------------------------------+ @@ -882,7 +884,7 @@ The focus access mode for the control (None, Click or All). Only one Control can | *Getter* | get_focus_neighbor() | +-----------+---------------------------+ -Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the ``ui_down`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. +Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_down` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. ---- @@ -898,7 +900,7 @@ Tells Godot which node it should give focus to if the user presses the down arro | *Getter* | get_focus_neighbor() | +-----------+---------------------------+ -Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the ``ui_left`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the left of this one. +Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_left` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the left of this one. ---- @@ -914,7 +916,7 @@ Tells Godot which node it should give focus to if the user presses the left arro | *Getter* | get_focus_neighbor() | +-----------+---------------------------+ -Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the ``ui_right`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. +Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_right` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. ---- @@ -930,7 +932,7 @@ Tells Godot which node it should give focus to if the user presses the right arr | *Getter* | get_focus_neighbor() | +-----------+---------------------------+ -Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the ``ui_top`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. +Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_up` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. ---- @@ -946,7 +948,7 @@ Tells Godot which node it should give focus to if the user presses the top arrow | *Getter* | get_focus_next() | +-----------+-----------------------+ -Tells Godot which node it should give focus to if the user presses :kbd:`Tab` on a keyboard by default. You can change the key by editing the ``ui_focus_next`` input action. +Tells Godot which node it should give focus to if the user presses :kbd:`Tab` on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_next` input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. @@ -964,7 +966,7 @@ If this property is not set, Godot will select a "best guess" based on surroundi | *Getter* | get_focus_previous() | +-----------+---------------------------+ -Tells Godot which node it should give focus to if the user presses :kbd:`Shift + Tab` on a keyboard by default. You can change the key by editing the ``ui_focus_prev`` input action. +Tells Godot which node it should give focus to if the user presses :kbd:`Shift + Tab` on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_prev` input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. @@ -978,7 +980,7 @@ If this property is not set, Godot will select a "best guess" based on surroundi | *Getter* | get_global_position() | +----------+-----------------------+ -The node's global position, relative to the world (usually to the top-left corner of the window). +The node's global position, relative to the world (usually to the :ref:`CanvasLayer`). ---- @@ -1078,7 +1080,7 @@ Controls whether the control will be able to receive mouse button input events t When enabled, scroll wheel events processed by :ref:`_gui_input` will be passed to the parent control even if :ref:`mouse_filter` is set to :ref:`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 ``_unhandled_input`` processing. +You should disable it on the root of your UI if you do not want scroll events to go to the :ref:`Node._unhandled_input` processing. ---- @@ -1220,6 +1222,20 @@ The node's scale, relative to its :ref:`size`. Chan ---- +.. _class_Control_property_shortcut_context: + +- :ref:`Node` **shortcut_context** + ++----------+-----------------------------+ +| *Setter* | set_shortcut_context(value) | ++----------+-----------------------------+ +| *Getter* | get_shortcut_context() | ++----------+-----------------------------+ + +The :ref:`Node` which must be a parent of the focused ``Control`` for the shortcut to be activated. If ``null``, 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. + +---- + .. _class_Control_property_size: - :ref:`Vector2` **size** @@ -1330,7 +1346,7 @@ When set, this property gives the highest priority to the type of the specified | *Getter* | get_tooltip_text() | +-----------+-------------------------+ -The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter` property is not :ref:`MOUSE_FILTER_IGNORE`. The time required for the tooltip to appear can be changed with the ``gui/timers/tooltip_delay_sec`` option in Project Settings. See also :ref:`get_tooltip`. +The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter` property is not :ref:`MOUSE_FILTER_IGNORE`. The time required for the tooltip to appear can be changed with the :ref:`ProjectSettings.gui/timers/tooltip_delay_sec` option. See also :ref:`get_tooltip`. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding :ref:`_make_custom_tooltip`. The default tooltip includes a :ref:`PopupPanel` and :ref:`Label` whose theme properties can be customized using :ref:`Theme` methods with the ``"TooltipPanel"`` and ``"TooltipLabel"`` respectively. For example: @@ -1471,7 +1487,7 @@ If not overridden, defaults to :ref:`Vector2.ZERO`. Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See :ref:`accept_event`. -Example: clicking a control. +\ **Example usage for clicking a control:**\ .. tabs:: @@ -1541,7 +1557,7 @@ The returned node will be added as child to a :ref:`PopupPanel \ **Note:** The node (and any relevant children) should be :ref:`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: +\ **Example of usage with a custom-constructed node:**\ .. tabs:: @@ -1564,7 +1580,7 @@ Example of usage with a custom-constructed node: -Example of usage with a custom scene instance: +\ **Example of usage with a custom scene instance:**\ .. tabs:: @@ -1595,7 +1611,7 @@ Example of usage with a custom scene instance: User defined BiDi algorithm override function. -Returns ``Array`` of ``Vector2i`` text ranges, in the left-to-right order. Ranges should cover full source ``text`` without overlaps. BiDi algorithm will be used on each range separately. +Returns an :ref:`Array` of :ref:`Vector2i` text ranges, in the left-to-right order. Ranges should cover full source ``text`` without overlaps. BiDi algorithm will be used on each range separately. ---- @@ -1817,7 +1833,7 @@ Returns the focus neighbor for the specified :ref:`Side` - :ref:`Rect2` **get_global_rect** **(** **)** |const| -Returns the position and size of the control relative to the top-left corner of the screen. See :ref:`position` and :ref:`size`. +Returns the position and size of the control relative to the :ref:`CanvasLayer`. See :ref:`global_position` and :ref:`size`. ---- @@ -1869,7 +1885,7 @@ Returns the position of this ``Control`` in global screen coordinates (i.e. taki Equals to :ref:`global_position` if the window is embedded (see :ref:`Viewport.gui_embed_subwindows`). -Example usage for showing a popup: +\ **Example usage for showing a popup:**\ :: @@ -1998,7 +2014,7 @@ See :ref:`get_theme_color` for details. Returns the tooltip text ``at_position`` in local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns :ref:`tooltip_text`. -\ **Note:** This method can be overridden to customise its behaviour. If this method returns an empty :ref:`String`, no tooltip is displayed. +\ **Note:** This method can be overridden to customize its behavior. If this method returns an empty :ref:`String`, no tooltip is displayed. ---- @@ -2447,7 +2463,7 @@ Sets the offset for the specified :ref:`Side` to ``offse Sets the offsets to a ``preset`` from :ref:`LayoutPreset` enum. This is the code equivalent to using the Layout menu in the 2D editor. -Use parameter ``resize_mode`` with constants from :ref:`LayoutPresetMode` to better determine the resulting size of the ``Control``. Constant size will be ignored if used with presets that change size, e.g. ``PRESET_LEFT_WIDE``. +Use parameter ``resize_mode`` with constants from :ref:`LayoutPresetMode` to better determine the resulting size of the ``Control``. Constant size will be ignored if used with presets that change size, e.g. :ref:`PRESET_LEFT_WIDE`. Use parameter ``margin`` to determine the gap between the ``Control`` and the edges. diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index b69b8a275..bcffbc23d 100644 --- a/classes/class_cpuparticles2d.rst +++ b/classes/class_cpuparticles2d.rst @@ -360,6 +360,8 @@ Each particle's rotation will be animated along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum initial rotation applied to each particle, in degrees. + ---- .. _class_CPUParticles2D_property_angle_min: @@ -374,6 +376,8 @@ Each particle's rotation will be animated along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`angle_max`. + ---- .. _class_CPUParticles2D_property_angular_velocity_curve: @@ -402,6 +406,8 @@ Each particle's angular velocity will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. + ---- .. _class_CPUParticles2D_property_angular_velocity_min: @@ -416,6 +422,8 @@ Each particle's angular velocity will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`angular_velocity_max`. + ---- .. _class_CPUParticles2D_property_anim_offset_curve: @@ -444,6 +452,8 @@ Each particle's animation offset will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum animation offset that corresponds to frame index in the texture. ``0`` is the first frame, ``1`` is the last one. See :ref:`CanvasItemMaterial.particles_animation`. + ---- .. _class_CPUParticles2D_property_anim_offset_min: @@ -458,6 +468,8 @@ Each particle's animation offset will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`anim_offset_max`. + ---- .. _class_CPUParticles2D_property_anim_speed_curve: @@ -486,6 +498,10 @@ Each particle's animation speed will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum particle animation speed. Animation speed of ``1`` means that the particles will make full ``0`` to ``1`` offset cycle during lifetime, ``2`` means ``2`` cycles etc. + +With animation speed greater than ``1``, remember to enable :ref:`CanvasItemMaterial.particles_anim_loop` property if you want the animation to repeat. + ---- .. _class_CPUParticles2D_property_anim_speed_min: @@ -500,6 +516,8 @@ Each particle's animation speed will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`anim_speed_max`. + ---- .. _class_CPUParticles2D_property_color: @@ -572,6 +590,8 @@ Damping will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +The maximum rate at which particles lose velocity. For example value of ``100`` means that the particle will go from ``100`` velocity to ``0`` in ``1`` second. + ---- .. _class_CPUParticles2D_property_damping_min: @@ -586,6 +606,8 @@ Damping will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`damping_max`. + ---- .. _class_CPUParticles2D_property_direction: @@ -750,7 +772,7 @@ How rapidly particles in an emission cycle are emitted. If greater than ``0``, t | *Getter* | get_fixed_fps() | +-----------+----------------------+ -The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. +The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. ---- @@ -812,6 +834,8 @@ Each particle's hue will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum initial hue variation applied to each particle. It will shift the particle color's hue. + ---- .. _class_CPUParticles2D_property_hue_variation_min: @@ -826,6 +850,8 @@ Each particle's hue will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`hue_variation_max`. + ---- .. _class_CPUParticles2D_property_initial_velocity_max: @@ -840,6 +866,8 @@ Each particle's hue will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum initial velocity magnitude for each particle. Direction comes from :ref:`direction` and :ref:`spread`. + ---- .. _class_CPUParticles2D_property_initial_velocity_min: @@ -854,6 +882,8 @@ Each particle's hue will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`initial_velocity_max`. + ---- .. _class_CPUParticles2D_property_lifetime: @@ -914,6 +944,8 @@ Each particle's linear acceleration will vary along this :ref:`Curve`. + ---- .. _class_CPUParticles2D_property_local_coords: @@ -988,6 +1022,8 @@ Each particle's orbital velocity will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + ---- .. _class_CPUParticles2D_property_orbit_velocity_min: @@ -1002,6 +1038,8 @@ Each particle's orbital velocity will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`orbit_velocity_max`. + ---- .. _class_CPUParticles2D_property_particle_flag_align_y: @@ -1062,6 +1100,8 @@ Each particle's radial acceleration will vary along this :ref:`Curve`. + ---- .. _class_CPUParticles2D_property_randomness: @@ -1120,6 +1162,8 @@ Each particle's scale will vary along this :ref:`Curve`. | *Getter* | get_param_max() | +-----------+----------------------+ +Maximum initial scale applied to each particle. + ---- .. _class_CPUParticles2D_property_scale_amount_min: @@ -1134,6 +1178,8 @@ Each particle's scale will vary along this :ref:`Curve`. | *Getter* | get_param_min() | +-----------+----------------------+ +Minimum equivalent of :ref:`scale_amount_max`. + ---- .. _class_CPUParticles2D_property_scale_curve_x: @@ -1146,6 +1192,10 @@ Each particle's scale will vary along this :ref:`Curve`. | *Getter* | get_scale_curve_x() | +----------+--------------------------+ +Each particle's horizontal scale will vary along this :ref:`Curve`. + +\ :ref:`split_scale` must be enabled. + ---- .. _class_CPUParticles2D_property_scale_curve_y: @@ -1158,6 +1208,10 @@ Each particle's scale will vary along this :ref:`Curve`. | *Getter* | get_scale_curve_y() | +----------+--------------------------+ +Each particle's vertical scale will vary along this :ref:`Curve`. + +\ :ref:`split_scale` must be enabled. + ---- .. _class_CPUParticles2D_property_speed_scale: @@ -1188,6 +1242,8 @@ Particle system's running speed scaling ratio. A value of ``0`` can be used to p | *Getter* | get_split_scale() | +-----------+------------------------+ +If ``true``, the scale curve will be split into x and y components. See :ref:`scale_curve_x` and :ref:`scale_curve_y`. + ---- .. _class_CPUParticles2D_property_spread: @@ -1232,6 +1288,8 @@ Each particle's tangential acceleration will vary along this :ref:`Curve`. + ---- .. _class_CPUParticles2D_property_texture: @@ -1283,12 +1343,16 @@ Returns the :ref:`Curve` of the parameter specified by :ref:`Parame - :ref:`float` **get_param_max** **(** :ref:`Parameter` param **)** |const| +Returns the maximum value range for the given parameter. + ---- .. _class_CPUParticles2D_method_get_param_min: - :ref:`float` **get_param_min** **(** :ref:`Parameter` param **)** |const| +Returns the minimum value range for the given parameter. + ---- .. _class_CPUParticles2D_method_get_particle_flag: @@ -1319,12 +1383,16 @@ Sets the :ref:`Curve` of the parameter specified by :ref:`Parameter - void **set_param_max** **(** :ref:`Parameter` param, :ref:`float` value **)** +Sets the maximum value for the given parameter. + ---- .. _class_CPUParticles2D_method_set_param_min: - void **set_param_min** **(** :ref:`Parameter` param, :ref:`float` value **)** +Sets the minimum value for the given parameter. + ---- .. _class_CPUParticles2D_method_set_particle_flag: diff --git a/classes/class_cpuparticles3d.rst b/classes/class_cpuparticles3d.rst index 637ab3d61..4cff50bd8 100644 --- a/classes/class_cpuparticles3d.rst +++ b/classes/class_cpuparticles3d.rst @@ -855,7 +855,7 @@ How rapidly particles in an emission cycle are emitted. If greater than ``0``, t | *Getter* | get_fixed_fps() | +-----------+----------------------+ -The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. +The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. ---- @@ -1480,12 +1480,16 @@ Returns the :ref:`Curve` of the parameter specified by :ref:`Parame - :ref:`float` **get_param_max** **(** :ref:`Parameter` param **)** |const| +Returns the maximum value range for the given parameter. + ---- .. _class_CPUParticles3D_method_get_param_min: - :ref:`float` **get_param_min** **(** :ref:`Parameter` param **)** |const| +Returns the minimum value range for the given parameter. + ---- .. _class_CPUParticles3D_method_get_particle_flag: @@ -1516,7 +1520,7 @@ Sets the :ref:`Curve` of the parameter specified by :ref:`Parameter - void **set_param_max** **(** :ref:`Parameter` param, :ref:`float` value **)** -Sets the maximum value for the given parameter +Sets the maximum value for the given parameter. ---- @@ -1524,7 +1528,7 @@ Sets the maximum value for the given parameter - void **set_param_min** **(** :ref:`Parameter` param, :ref:`float` value **)** -Sets the minimum value for the given parameter +Sets the minimum value for the given parameter. ---- diff --git a/classes/class_csgshape3d.rst b/classes/class_csgshape3d.rst index 8db086a1f..f8a4e51b7 100644 --- a/classes/class_csgshape3d.rst +++ b/classes/class_csgshape3d.rst @@ -134,7 +134,7 @@ A contact is detected if object A is in any of the layers that object B scans, o | *Getter* | get_collision_mask() | +-----------+---------------------------+ -The physics layers this CSG shape scans for collisions. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information. +The physics layers this CSG shape scans for collisions. Only effective if :ref:`use_collision` is ``true``. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information. ---- @@ -150,6 +150,8 @@ The physics layers this CSG shape scans for collisions. See `Collision layers an | *Getter* | get_collision_priority() | +-----------+-------------------------------+ +The priority used to solve colliding when occurring penetration. Only effective if :ref:`use_collision` is ``true``. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level. + ---- .. _class_CSGShape3D_property_operation: @@ -196,7 +198,7 @@ Snap makes the mesh snap to a given distance so that the faces of two meshes can | *Getter* | is_using_collision() | +-----------+--------------------------+ -Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. +Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also :ref:`collision_mask` and :ref:`collision_priority`. Method Descriptions ------------------- diff --git a/classes/class_curve.rst b/classes/class_curve.rst index e751a4da8..f7ce7d92a 100644 --- a/classes/class_curve.rst +++ b/classes/class_curve.rst @@ -191,7 +191,7 @@ Recomputes the baked cache of points for the curve. - void **clean_dupes** **(** **)** -Removes points that are closer than ``CMP_EPSILON`` (0.00001) units to their neighbor on the curve. +Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve. ---- diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst index 2eb5cdf20..acad23d31 100644 --- a/classes/class_curve2d.rst +++ b/classes/class_curve2d.rst @@ -33,41 +33,43 @@ Properties Methods ------- -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_point` **(** :ref:`Vector2` position, :ref:`Vector2` in=Vector2(0, 0), :ref:`Vector2` out=Vector2(0, 0), :ref:`int` index=-1 **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_points` **(** **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_baked_length` **(** **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedVector2Array` | :ref:`get_baked_points` **(** **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_closest_offset` **(** :ref:`Vector2` to_point **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_closest_point` **(** :ref:`Vector2` to_point **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_point_in` **(** :ref:`int` idx **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_point_out` **(** :ref:`int` idx **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` idx **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_point` **(** :ref:`int` idx **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`sample` **(** :ref:`int` idx, :ref:`float` t **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`sample_baked` **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`samplef` **(** :ref:`float` fofs **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_in` **(** :ref:`int` idx, :ref:`Vector2` position **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_out` **(** :ref:`int` idx, :ref:`Vector2` position **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_position` **(** :ref:`int` idx, :ref:`Vector2` position **)** | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedVector2Array` | :ref:`tessellate` **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| | -+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`Vector2` position, :ref:`Vector2` in=Vector2(0, 0), :ref:`Vector2` out=Vector2(0, 0), :ref:`int` index=-1 **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_points` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_baked_length` **(** **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedVector2Array` | :ref:`get_baked_points` **(** **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_closest_offset` **(** :ref:`Vector2` to_point **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point` **(** :ref:`Vector2` to_point **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_in` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_out` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` idx **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`sample` **(** :ref:`int` idx, :ref:`float` t **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`sample_baked` **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`sample_baked_with_rotation` **(** :ref:`float` offset, :ref:`bool` cubic=false, :ref:`bool` loop=true, :ref:`float` lookahead=4.0 **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`samplef` **(** :ref:`float` fofs **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_in` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_out` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedVector2Array` | :ref:`tessellate` **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -213,6 +215,22 @@ Cubic interpolation tends to follow the curves better, but linear is faster (and ---- +.. _class_Curve2D_method_sample_baked_with_rotation: + +- :ref:`Transform2D` **sample_baked_with_rotation** **(** :ref:`float` offset, :ref:`bool` cubic=false, :ref:`bool` loop=true, :ref:`float` lookahead=4.0 **)** |const| + +Similar to :ref:`sample_baked`, but returns :ref:`Transform2D` that includes a rotation along the curve. Returns empty transform if length of the curve is ``0``. + +Use ``loop`` to smooth the tangent at the end of the curve. ``lookahead`` defines the distance to a nearby point for calculating the tangent vector. + +:: + + var transform = curve.sample_baked_with_rotation(offset) + position = transform.get_origin() + rotation = transform.get_rotation() + +---- + .. _class_Curve2D_method_samplef: - :ref:`Vector2` **samplef** **(** :ref:`float` fofs **)** |const| diff --git a/classes/class_cylindershape3d.rst b/classes/class_cylindershape3d.rst index e5c496907..8c73dfb3f 100644 --- a/classes/class_cylindershape3d.rst +++ b/classes/class_cylindershape3d.rst @@ -19,6 +19,8 @@ Description Cylinder shape for collisions. Like :ref:`CapsuleShape3D`, but without hemispheres at the cylinder's ends. +\ **Note:** There are several known bugs with cylinder collision shapes. Using :ref:`CapsuleShape3D` or :ref:`BoxShape3D` instead is recommended. + \ **Performance:** Being a primitive collision shape, ``CylinderShape3D`` is fast to check collisions against (though not as fast as :ref:`SphereShape3D`). ``CylinderShape3D`` is also more demanding compared to :ref:`CapsuleShape3D`. Tutorials diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 3722b869a..cf3327856 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -472,18 +472,24 @@ Operator Descriptions - :ref:`bool` **operator !=** **(** :ref:`Dictionary` right **)** +Returns ``true`` if the dictionaries differ, i.e. their key or value lists are different (including the order). + ---- .. _class_Dictionary_operator_eq_bool: - :ref:`bool` **operator ==** **(** :ref:`Dictionary` right **)** +Returns ``true`` if both dictionaries have the same contents, i.e. their keys list and value list are equal. + ---- .. _class_Dictionary_operator_idx_Variant: - :ref:`Variant` **operator []** **(** :ref:`Variant` key **)** +Returns a value at the given ``key`` or ``null`` and error if the key does not exist. For safe access, use :ref:`get` or :ref:`has`. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_diraccess.rst b/classes/class_diraccess.rst index 73c18b5ae..14e51618d 100644 --- a/classes/class_diraccess.rst +++ b/classes/class_diraccess.rst @@ -203,7 +203,7 @@ Method Descriptions Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. ``newdir`` or ``../newdir``), or an absolute path (e.g. ``/tmp/newdir`` or ``res://somedir/newdir``). -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -215,7 +215,7 @@ Copies the ``from`` file to the ``to`` destination. Both arguments should be pat If ``chmod_flags`` is different than ``-1``, the Unix permissions for the destination path will be set to the provided value, if available on the current operating system. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -397,7 +397,7 @@ Closes the current stream opened with :ref:`list_dir_begin`). -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -415,7 +415,7 @@ Static version of :ref:`make_dir`. Supports onl Creates a target directory and all necessary intermediate directories in its path, by calling :ref:`make_dir` recursively. The argument can be relative to the current directory, or an absolute path. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -445,7 +445,7 @@ Permanently deletes the target file or an empty directory. The argument can be r If you don't want to delete the file/directory permanently, use :ref:`OS.move_to_trash` instead. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- @@ -463,7 +463,7 @@ Static version of :ref:`remove`. Supports only ab Renames (move) the ``from`` file or directory to the ``to`` destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten. -Returns one of the :ref:`Error` code constants (``OK`` on success). +Returns one of the :ref:`Error` code constants (:ref:`@GlobalScope.OK` on success). ---- diff --git a/classes/class_displayserver.rst b/classes/class_displayserver.rst index d0912f6ac..2ad3fb32c 100644 --- a/classes/class_displayserver.rst +++ b/classes/class_displayserver.rst @@ -12,7 +12,14 @@ DisplayServer **Inherits:** :ref:`Object` +Singleton for window management functions. +Description +----------- + +``DisplayServer`` handles everything related to window management. This is separated from :ref:`OS` as a single operating system may support multiple display servers. + +\ **Headless mode:** Starting the engine with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` disables all rendering and window management functions. Most functions from ``DisplayServer`` will return dummy values in this case. Methods ------- @@ -28,16 +35,12 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clipboard_set_primary` **(** :ref:`String` clipboard_primary **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`create_sub_window` **(** :ref:`WindowMode` mode, :ref:`VSyncMode` vsync_mode, :ref:`int` flags, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** | -+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`CursorShape` | :ref:`cursor_get_shape` **(** **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_custom_image` **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_shape` **(** :ref:`CursorShape` shape **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`delete_sub_window` **(** :ref:`int` window_id **)** | -+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`dialog_input_text` **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`dialog_show` **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** | @@ -86,6 +89,8 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Callable` | :ref:`global_menu_get_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`global_menu_get_item_count` **(** :ref:`String` menu_root **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :ref:`global_menu_get_item_icon` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`global_menu_get_item_indentation_level` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | @@ -242,8 +247,6 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`warp_mouse` **(** :ref:`Vector2i` position **)** | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`window_attach_instance_id` **(** :ref:`int` instance_id, :ref:`int` window_id=0 **)** | -+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_can_draw` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`window_get_active_popup` **(** **)** |const| | @@ -268,12 +271,14 @@ Methods +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_real_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2i` | :ref:`window_get_safe_title_margins` **(** :ref:`int` window_id=0 **)** |const| | +| :ref:`Vector3i` | :ref:`window_get_safe_title_margins` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`VSyncMode` | :ref:`window_get_vsync_mode` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`window_is_maximize_allowed` **(** :ref:`int` window_id=0 **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_maximize_on_title_dbl_click` **(** **)** |const| | +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_minimize_on_title_dbl_click` **(** **)** |const| | @@ -372,45 +377,45 @@ Enumerations enum **Feature**: -- **FEATURE_GLOBAL_MENU** = **0** +- **FEATURE_GLOBAL_MENU** = **0** --- Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS** -- **FEATURE_SUBWINDOWS** = **1** +- **FEATURE_SUBWINDOWS** = **1** --- Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)** -- **FEATURE_TOUCHSCREEN** = **2** +- **FEATURE_TOUCHSCREEN** = **2** --- Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web** -- **FEATURE_MOUSE** = **3** +- **FEATURE_MOUSE** = **3** --- Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web** -- **FEATURE_MOUSE_WARP** = **4** +- **FEATURE_MOUSE_WARP** = **4** --- Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. **Windows, macOS, Linux (X11)** -- **FEATURE_CLIPBOARD** = **5** +- **FEATURE_CLIPBOARD** = **5** --- Display server supports setting and getting clipboard data. See also :ref:`FEATURE_CLIPBOARD_PRIMARY`. **Windows, macOS, Linux (X11), Android, iOS, Web** -- **FEATURE_VIRTUAL_KEYBOARD** = **6** +- **FEATURE_VIRTUAL_KEYBOARD** = **6** --- Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web** -- **FEATURE_CURSOR_SHAPE** = **7** +- **FEATURE_CURSOR_SHAPE** = **7** --- Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web** -- **FEATURE_CUSTOM_CURSOR_SHAPE** = **8** +- **FEATURE_CUSTOM_CURSOR_SHAPE** = **8** --- Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web** -- **FEATURE_NATIVE_DIALOG** = **9** +- **FEATURE_NATIVE_DIALOG** = **9** --- Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS** -- **FEATURE_IME** = **10** +- **FEATURE_IME** = **10** --- Display server supports `Input Method Editor `__, which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. **Windows, macOS, Linux (X11)** -- **FEATURE_WINDOW_TRANSPARENCY** = **11** +- **FEATURE_WINDOW_TRANSPARENCY** = **11** --- Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)** -- **FEATURE_HIDPI** = **12** +- **FEATURE_HIDPI** = **12** --- Display server supports querying the operating system's display scale factor. This allows for *reliable* automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). **Windows, macOS** -- **FEATURE_ICON** = **13** +- **FEATURE_ICON** = **13** --- Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)** -- **FEATURE_NATIVE_ICON** = **14** +- **FEATURE_NATIVE_ICON** = **14** --- Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS** -- **FEATURE_ORIENTATION** = **15** +- **FEATURE_ORIENTATION** = **15** --- Display server supports changing the screen orientation. **Android, iOS** -- **FEATURE_SWAP_BUFFERS** = **16** +- **FEATURE_SWAP_BUFFERS** = **16** --- Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). **Windows, macOS, Linux (X11)** -- **FEATURE_CLIPBOARD_PRIMARY** = **18** +- **FEATURE_CLIPBOARD_PRIMARY** = **18** --- Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD`. **Linux (X11)** -- **FEATURE_TEXT_TO_SPEECH** = **19** --- Display server supports text-to-speech. See ``tts_*`` methods. +- **FEATURE_TEXT_TO_SPEECH** = **19** --- Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web** -- **FEATURE_EXTEND_TO_TITLE** = **20** --- Display server supports expanding window content to the title. See :ref:`WINDOW_FLAG_EXTEND_TO_TITLE`. +- **FEATURE_EXTEND_TO_TITLE** = **20** --- Display server supports expanding window content to the title. See :ref:`WINDOW_FLAG_EXTEND_TO_TITLE`. **macOS** ---- @@ -460,19 +465,19 @@ enum **MouseMode**: enum **ScreenOrientation**: -- **SCREEN_LANDSCAPE** = **0** +- **SCREEN_LANDSCAPE** = **0** --- Default landscape orientation. -- **SCREEN_PORTRAIT** = **1** +- **SCREEN_PORTRAIT** = **1** --- Default portrait orienstation. -- **SCREEN_REVERSE_LANDSCAPE** = **2** +- **SCREEN_REVERSE_LANDSCAPE** = **2** --- Reverse landscape orientation (upside down). -- **SCREEN_REVERSE_PORTRAIT** = **3** +- **SCREEN_REVERSE_PORTRAIT** = **3** --- Reverse portrait orientation (upside down). -- **SCREEN_SENSOR_LANDSCAPE** = **4** +- **SCREEN_SENSOR_LANDSCAPE** = **4** --- Automatic landscape orientation (default or reverse depending on sensor). -- **SCREEN_SENSOR_PORTRAIT** = **5** +- **SCREEN_SENSOR_PORTRAIT** = **5** --- Automatic portrait orientation (default or reverse depending on sensor). -- **SCREEN_SENSOR** = **6** +- **SCREEN_SENSOR** = **6** --- Automatic landscape or portrait orientation (default or reverse depending on sensor). ---- @@ -556,41 +561,41 @@ enum **VirtualKeyboardType**: enum **CursorShape**: -- **CURSOR_ARROW** = **0** +- **CURSOR_ARROW** = **0** --- Arrow cursor shape. This is the default when not pointing anything that overrides the mouse cursor, such as a :ref:`LineEdit` or :ref:`TextEdit`. -- **CURSOR_IBEAM** = **1** +- **CURSOR_IBEAM** = **1** --- I-beam cursor shape. This is used by default when hovering a control that accepts text input, such as :ref:`LineEdit` or :ref:`TextEdit`. -- **CURSOR_POINTING_HAND** = **2** +- **CURSOR_POINTING_HAND** = **2** --- Pointing hand cursor shape. This is used by default when hovering a :ref:`LinkButton` or an URL tag in a :ref:`RichTextLabel`.⋅ -- **CURSOR_CROSS** = **3** +- **CURSOR_CROSS** = **3** --- Crosshair cursor. This is intended to be displayed when the user needs precise aim over an element, such as a rectangle selection tool or a color picker. -- **CURSOR_WAIT** = **4** +- **CURSOR_WAIT** = **4** --- Wait cursor. On most cursor themes, this displays a spinning icon *besides* the arrow. Intended to be used for non-blocking operations (when the user can do something else at the moment). See also :ref:`CURSOR_BUSY`. -- **CURSOR_BUSY** = **5** +- **CURSOR_BUSY** = **5** --- Wait cursor. On most cursor themes, this *replaces* the arrow with a spinning icon. Intended to be used for blocking operations (when the user can't do anything else at the moment). See also :ref:`CURSOR_WAIT`. -- **CURSOR_DRAG** = **6** +- **CURSOR_DRAG** = **6** --- Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP`. -- **CURSOR_CAN_DROP** = **7** +- **CURSOR_CAN_DROP** = **7** --- "Can drop" cursor. This is displayed during drag-and-drop operations if hovering over a :ref:`Control` that can accept the drag-and-drop event. On most cursor themes, this displays a dragging hand with an arrow symbol besides it. See also :ref:`CURSOR_DRAG`. -- **CURSOR_FORBIDDEN** = **8** +- **CURSOR_FORBIDDEN** = **8** --- Forbidden cursor. This is displayed during drag-and-drop operations if the hovered :ref:`Control` can't accept the drag-and-drop event. -- **CURSOR_VSIZE** = **9** +- **CURSOR_VSIZE** = **9** --- Vertical resize cursor. Intended to be displayed when the hovered :ref:`Control` can be vertically resized using the mouse. See also :ref:`CURSOR_VSPLIT`. -- **CURSOR_HSIZE** = **10** +- **CURSOR_HSIZE** = **10** --- Horizontal resize cursor. Intended to be displayed when the hovered :ref:`Control` can be horizontally resized using the mouse. See also :ref:`CURSOR_HSPLIT`. -- **CURSOR_BDIAGSIZE** = **11** +- **CURSOR_BDIAGSIZE** = **11** --- Secondary diagonal resize cursor (top-right/bottom-left). Intended to be displayed when the hovered :ref:`Control` can be resized on both axes at once using the mouse. -- **CURSOR_FDIAGSIZE** = **12** +- **CURSOR_FDIAGSIZE** = **12** --- Main diagonal resize cursor (top-left/bottom-right). Intended to be displayed when the hovered :ref:`Control` can be resized on both axes at once using the mouse. -- **CURSOR_MOVE** = **13** +- **CURSOR_MOVE** = **13** --- Move cursor. Intended to be displayed when the hovered :ref:`Control` can be moved using the mouse. -- **CURSOR_VSPLIT** = **14** +- **CURSOR_VSPLIT** = **14** --- Vertical split cursor. This is displayed when hovering a :ref:`Control` with splits that can be vertically resized using the mouse, such as :ref:`VSplitContainer`. On some cursor themes, this cursor may have the same appearance as :ref:`CURSOR_VSIZE`. -- **CURSOR_HSPLIT** = **15** +- **CURSOR_HSPLIT** = **15** --- Horizontal split cursor. This is displayed when hovering a :ref:`Control` with splits that can be horizontally resized using the mouse, such as :ref:`HSplitContainer`. On some cursor themes, this cursor may have the same appearance as :ref:`CURSOR_HSIZE`. -- **CURSOR_HELP** = **16** +- **CURSOR_HELP** = **16** --- Help cursor. On most cursor themes, this displays a question mark icon instead of the mouse cursor. Intended to be used when the user has requested help on the next element that will be clicked. -- **CURSOR_MAX** = **17** +- **CURSOR_MAX** = **17** --- Represents the size of the :ref:`CursorShape` enum. ---- @@ -614,7 +619,7 @@ enum **WindowMode**: - **WINDOW_MODE_MAXIMIZED** = **2** --- Maximized window mode, i.e. :ref:`Window` will occupy whole screen area except task bar and still display its borders. Normally happens when the minimize button is pressed. -- **WINDOW_MODE_FULLSCREEN** = **3** --- Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. +- **WINDOW_MODE_FULLSCREEN** = **3** --- Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux (X11), a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode. @@ -656,7 +661,7 @@ enum **WindowFlags**: \ **Note:** This flag has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed` is set to ``false``. -\ **Note:** Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. +\ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. - **WINDOW_FLAG_NO_FOCUS** = **4** --- The window can't be focused. No-focus window will ignore all input, except mouse clicks. @@ -730,15 +735,15 @@ enum **WindowEvent**: enum **VSyncMode**: -- **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). +- **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (nonwithstanding :ref:`Engine.max_fps`). -- **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). +- **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (nonwithstanding :ref:`Engine.max_fps`). -- **VSYNC_ADAPTIVE** = **2** --- Behaves like :ref:`VSYNC_DISABLED` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible), otherwise vertical synchronization is enabled to avoid tearing. +- **VSYNC_ADAPTIVE** = **2** --- Behaves like :ref:`VSYNC_DISABLED` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (nonwithstanding :ref:`Engine.max_fps`). -- **VSYNC_MAILBOX** = **3** --- Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). +- **VSYNC_MAILBOX** = **3** --- Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (nonwithstanding :ref:`Engine.max_fps`). -Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag. +Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). :ref:`VSYNC_MAILBOX` works best when at least twice as many frames as the display refresh rate are rendered. ---- @@ -754,13 +759,13 @@ enum **HandleType**: - **DISPLAY_HANDLE** = **0** --- Display handle: - - Linux: ``X11::Display*`` for the display. + - Linux (X11): ``X11::Display*`` for the display. - **WINDOW_HANDLE** = **1** --- Window handle: - Windows: ``HWND`` for the window. - - Linux: ``X11::Window*`` for the window. + - Linux (X11): ``X11::Window*`` for the window. - macOS: ``NSWindow*`` for the window. @@ -805,11 +810,11 @@ Constants .. _class_DisplayServer_constant_INVALID_WINDOW_ID: -- **SCREEN_OF_MAIN_WINDOW** = **-1** +- **SCREEN_OF_MAIN_WINDOW** = **-1** --- Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens. -- **MAIN_WINDOW_ID** = **0** +- **MAIN_WINDOW_ID** = **0** --- The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``. -- **INVALID_WINDOW_ID** = **-1** +- **INVALID_WINDOW_ID** = **-1** --- The ID that refers to a nonexisting window. This is be returned by some ``DisplayServer`` methods if no window matches the requested result. Method Descriptions ------------------- @@ -826,9 +831,9 @@ Returns the user's clipboard as a string if possible. - :ref:`String` **clipboard_get_primary** **(** **)** |const| -Returns the user's primary clipboard as a string if possible. +Returns the user's `primary `__ clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. -\ **Note:** This method is only implemented on Linux. +\ **Note:** This method is only implemented on Linux (X11). ---- @@ -852,15 +857,9 @@ Sets the user's clipboard content to the given string. - void **clipboard_set_primary** **(** :ref:`String` clipboard_primary **)** -Sets the user's primary clipboard content to the given string. +Sets the user's `primary `__ clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. -\ **Note:** This method is only implemented on Linux. - ----- - -.. _class_DisplayServer_method_create_sub_window: - -- :ref:`int` **create_sub_window** **(** :ref:`WindowMode` mode, :ref:`VSyncMode` vsync_mode, :ref:`int` flags, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** +\ **Note:** This method is only implemented on Linux (X11). ---- @@ -868,23 +867,23 @@ Sets the user's primary clipboard content to the given string. - :ref:`CursorShape` **cursor_get_shape** **(** **)** |const| +Returns the default mouse cursor shape set by :ref:`cursor_set_shape`. + ---- .. _class_DisplayServer_method_cursor_set_custom_image: - void **cursor_set_custom_image** **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** +Sets a custom mouse cursor image for the defined ``shape``. This means the user's operating system and mouse cursor theme will no longer influence the mouse cursor's appearance. The image must be ``256x256`` or smaller for correct appearance. ``hotspot`` can optionally be set to define the area where the cursor will click. By default, ``hotspot`` is set to ``Vector2(0, 0)``, which is the top-left corner of the image. See also :ref:`cursor_set_shape`. + ---- .. _class_DisplayServer_method_cursor_set_shape: - void **cursor_set_shape** **(** :ref:`CursorShape` shape **)** ----- - -.. _class_DisplayServer_method_delete_sub_window: - -- void **delete_sub_window** **(** :ref:`int` window_id **)** +Sets the default mouse cursor shape. The cursor's appearance will vary depending on the user's operating system and mouse cursor theme. See also :ref:`cursor_get_shape` and :ref:`cursor_set_custom_image`. ---- @@ -892,24 +891,40 @@ Sets the user's primary clipboard content to the given string. - :ref:`Error` **dialog_input_text** **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** +Shows a text input dialog which uses the operating system's native look-and-feel. ``callback`` will be called with a :ref:`String` argument equal to the text field's contents when the dialog is closed for any reason. + +\ **Note:** This method is implemented on macOS. + ---- .. _class_DisplayServer_method_dialog_show: - :ref:`Error` **dialog_show** **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** +Shows a text dialog which uses the operating system's native look-and-feel. ``callback`` will be called when the dialog is closed for any reason. + +\ **Note:** This method is implemented on macOS. + ---- .. _class_DisplayServer_method_enable_for_stealing_focus: - void **enable_for_stealing_focus** **(** :ref:`int` process_id **)** +Allows the ``process_id`` PID to steal focus from this window. In other words, this disables the operating system's focus stealing protection for the specified PID. + +\ **Note:** This method is implemented on Windows. + ---- .. _class_DisplayServer_method_force_process_and_drop_events: - void **force_process_and_drop_events** **(** **)** +Forces window manager processing while ignoring all :ref:`InputEvent`\ s. See also :ref:`process_events`. + +\ **Note:** This method is implemented on Windows and macOS. + ---- .. _class_DisplayServer_method_get_accent_color: @@ -944,30 +959,55 @@ Returns the unobscured area of the display where interactive controls should be - :ref:`String` **get_name** **(** **)** |const| +Returns the name of the ``DisplayServer`` currently in use. Most operating systems only have a single ``DisplayServer``, but Linux has access to more than one ``DisplayServer`` (although only X11 is currently implemented in Godot). + +The names of built-in display servers are ``Windows``, ``macOS``, ``X11`` (Linux), ``Android``, ``iOS``, ``web`` (HTML5) and ``headless`` (when started with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`). + ---- .. _class_DisplayServer_method_get_screen_count: - :ref:`int` **get_screen_count** **(** **)** |const| +Returns the number of displays available. + ---- .. _class_DisplayServer_method_get_swap_cancel_ok: - :ref:`bool` **get_swap_cancel_ok** **(** **)** +Returns ``true`` if positions of **OK** and **Cancel** buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing :ref:`ProjectSettings.gui/common/swap_cancel_ok`. + +\ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show`. + ---- .. _class_DisplayServer_method_get_window_at_screen_position: - :ref:`int` **get_window_at_screen_position** **(** :ref:`Vector2i` position **)** |const| +Returns the ID of the window at the specified screen ``position`` (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + +:: + + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + ---- .. _class_DisplayServer_method_get_window_list: - :ref:`PackedInt32Array` **get_window_list** **(** **)** |const| +Returns the list of Godot window IDs belonging to this process. + +\ **Note:** Native dialogs are not included in this list. + ---- .. _class_DisplayServer_method_global_menu_add_check_item: @@ -1186,6 +1226,16 @@ Returns the callback of the item at index ``idx``. ---- +.. _class_DisplayServer_method_global_menu_get_item_count: + +- :ref:`int` **global_menu_get_item_count** **(** :ref:`String` menu_root **)** |const| + +Returns number of items in the global menu with ID ``menu_root``. + +\ **Note:** This method is implemented on macOS. + +---- + .. _class_DisplayServer_method_global_menu_get_item_icon: - :ref:`Texture2D` **global_menu_get_item_icon** **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| @@ -1510,18 +1560,28 @@ Sets the :ref:`String` tooltip of the item at the specified index - :ref:`bool` **has_feature** **(** :ref:`Feature` feature **)** |const| +Returns ``true`` if the specified ``feature`` is supported by the current ``DisplayServer``, ``false`` otherwise. + ---- .. _class_DisplayServer_method_ime_get_selection: - :ref:`Vector2i` **ime_get_selection** **(** **)** |const| +Returns the text selection in the `Input Method Editor `__ composition string, with the :ref:`Vector2i`'s ``x`` component being the caret position and ``y`` being the length of the selection. + +\ **Note:** This method is implemented on macOS. + ---- .. _class_DisplayServer_method_ime_get_text: - :ref:`String` **ime_get_text** **(** **)** |const| +Returns the composition string contained within the `Input Method Editor `__ window. + +\ **Note:** This method is implemented on macOS. + ---- .. _class_DisplayServer_method_is_dark_mode: @@ -1530,7 +1590,7 @@ Sets the :ref:`String` tooltip of the item at the specified index Returns ``true`` if OS is using dark mode. -\ **Note:** This method is implemented on macOS, Windows and Linux. +\ **Note:** This method is implemented on macOS, Windows and Linux (X11). ---- @@ -1540,7 +1600,7 @@ Returns ``true`` if OS is using dark mode. Returns ``true`` if OS supports dark mode. -\ **Note:** This method is implemented on macOS, Windows and Linux. +\ **Note:** This method is implemented on macOS, Windows and Linux (X11). ---- @@ -1550,7 +1610,7 @@ Returns ``true`` if OS supports dark mode. Returns active keyboard layout index. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1560,7 +1620,7 @@ Returns active keyboard layout index. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1570,7 +1630,7 @@ Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout Returns the number of keyboard layouts. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1580,7 +1640,7 @@ Returns the number of keyboard layouts. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1590,7 +1650,7 @@ Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``in Returns the localized name of the keyboard layout at position ``index``. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1598,9 +1658,9 @@ Returns the localized name of the keyboard layout at position ``index``. - void **keyboard_set_current_layout** **(** :ref:`int` index **)** -Sets active keyboard layout. +Sets the active keyboard layout. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -1608,12 +1668,16 @@ Sets active keyboard layout. - :ref:`MouseButton` **mouse_get_button_state** **(** **)** |const| +Returns the current state of mouse buttons (whether each button is pressed) as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to :ref:`Input.get_mouse_button_mask`. + ---- .. _class_DisplayServer_method_mouse_get_mode: - :ref:`MouseMode` **mouse_get_mode** **(** **)** |const| +Returns the current mouse mode. See also :ref:`mouse_set_mode`. + ---- .. _class_DisplayServer_method_mouse_get_position: @@ -1628,12 +1692,16 @@ Returns the mouse cursor's current position. - void **mouse_set_mode** **(** :ref:`MouseMode` mouse_mode **)** +Sets the current mouse mode. See also :ref:`mouse_get_mode`. + ---- .. _class_DisplayServer_method_process_events: - void **process_events** **(** **)** +Perform window manager processing, including input flushing. See also :ref:`force_process_and_drop_events`, :ref:`Input.flush_buffered_events` and :ref:`Input.use_accumulated_input`. + ---- .. _class_DisplayServer_method_screen_get_dpi: @@ -1655,7 +1723,7 @@ Returns the dots per inch density of the specified screen. If ``screen`` is :ref xxhdpi - 480 dpi xxxhdpi - 640 dpi -\ **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms. +\ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms. ---- @@ -1675,12 +1743,29 @@ Returns the greatest scale factor of all screens. - :ref:`ScreenOrientation` **screen_get_orientation** **(** :ref:`int` screen=-1 **)** |const| +Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation`. + +\ **Note:** This method is implemented on Android and iOS. + ---- .. _class_DisplayServer_method_screen_get_position: - :ref:`Vector2i` **screen_get_position** **(** :ref:`int` screen=-1 **)** |const| +Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + +:: + + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + +See also :ref:`screen_get_size`. + ---- .. _class_DisplayServer_method_screen_get_refresh_rate: @@ -1717,48 +1802,64 @@ Returns the scale factor of the specified screen by index. - :ref:`Vector2i` **screen_get_size** **(** :ref:`int` screen=-1 **)** |const| +Returns the screen's size in pixels. See also :ref:`screen_get_position` and :ref:`screen_get_usable_rect`. + ---- .. _class_DisplayServer_method_screen_get_usable_rect: - :ref:`Rect2i` **screen_get_usable_rect** **(** :ref:`int` screen=-1 **)** |const| +Returns the portion of the screen that is not obstructed by a status bar in pixels. See also :ref:`screen_get_size`. + ---- .. _class_DisplayServer_method_screen_is_kept_on: - :ref:`bool` **screen_is_kept_on** **(** **)** |const| +Returns ``true`` if the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_set_keep_on`. + ---- .. _class_DisplayServer_method_screen_is_touchscreen: - :ref:`bool` **screen_is_touchscreen** **(** :ref:`int` screen=-1 **)** |const| +Returns ``true`` if the screen can send touch events or if :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse` is ``true``. + ---- .. _class_DisplayServer_method_screen_set_keep_on: - void **screen_set_keep_on** **(** :ref:`bool` enable **)** +Sets whether the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_is_kept_on`. + ---- .. _class_DisplayServer_method_screen_set_orientation: - void **screen_set_orientation** **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** +Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation`. + ---- .. _class_DisplayServer_method_set_icon: - void **set_icon** **(** :ref:`Image` image **)** +Sets the window icon (usually displayed in the top-left corner) in the operating system's *native* format. To use icons in the operating system's native format, use :ref:`set_native_icon` instead. + ---- .. _class_DisplayServer_method_set_native_icon: - void **set_native_icon** **(** :ref:`String` filename **)** +Sets the window icon (usually displayed in the top-left corner) in the operating system's *native* format. The file at ``filename`` must be in ``.ico`` format on Windows or ``.icns`` on macOS. By using specially crafted ``.ico`` or ``.icns`` icons, :ref:`set_native_icon` allows specifying different icons depending on the size the icon is displayed at. This size is determined by the operating system and user preferences (including the display scale factor). To use icons in other formats, use :ref:`set_icon` instead. + ---- .. _class_DisplayServer_method_tablet_get_current_driver: @@ -1815,7 +1916,7 @@ Each :ref:`Dictionary` contains two :ref:`String - ``language`` is language code in ``lang_Variant`` format. ``lang`` part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And ``Variant`` part is an engine dependent string describing country, region or/and dialect. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1825,7 +1926,7 @@ Each :ref:`Dictionary` contains two :ref:`String Returns an :ref:`PackedStringArray` of voice identifiers for the ``language``. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1835,7 +1936,7 @@ Returns an :ref:`PackedStringArray` of voice identifier Returns ``true`` if the synthesizer is in a paused state. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1845,7 +1946,7 @@ Returns ``true`` if the synthesizer is in a paused state. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1855,7 +1956,7 @@ Returns ``true`` if the synthesizer is generating speech, or have utterance wait Puts the synthesizer into a paused state. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1865,7 +1966,7 @@ Puts the synthesizer into a paused state. Resumes the synthesizer if it was paused. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1875,13 +1976,13 @@ Resumes the synthesizer if it was paused. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary. -- ``TTS_UTTERANCE_STARTED``, ``TTS_UTTERANCE_ENDED``, and ``TTS_UTTERANCE_CANCELED`` callable's method should take one :ref:`int` parameter, the utterance id. +- :ref:`TTS_UTTERANCE_STARTED`, :ref:`TTS_UTTERANCE_ENDED`, and :ref:`TTS_UTTERANCE_CANCELED` callable's method should take one :ref:`int` parameter, the utterance id. -- ``TTS_UTTERANCE_BOUNDARY`` callable's method should take two :ref:`int` parameters, the index of the character and the utterance id. +- :ref:`TTS_UTTERANCE_BOUNDARY` callable's method should take two :ref:`int` parameters, the index of the character and the utterance id. \ **Note:** The granularity of the boundary callbacks is engine dependent. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1901,11 +2002,11 @@ Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is clear - ``utterance_id`` is passed as a parameter to the callback functions. -\ **Note:** On Windows and Linux, utterance ``text`` 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 :ref:`tts_speak`. +\ **Note:** On Windows and Linux (X11), utterance ``text`` 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 :ref:`tts_speak`. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1915,7 +2016,7 @@ Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is clear Stops synthesis in progress and removes all utterances from the queue. -\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. ---- @@ -1965,16 +2066,12 @@ Sets the mouse cursor position to the given ``position`` relative to an origin a ---- -.. _class_DisplayServer_method_window_attach_instance_id: - -- void **window_attach_instance_id** **(** :ref:`int` instance_id, :ref:`int` window_id=0 **)** - ----- - .. _class_DisplayServer_method_window_can_draw: - :ref:`bool` **window_can_draw** **(** :ref:`int` window_id=0 **)** |const| +Returns ``true`` if anything can be drawn in the window specified by ``window_id``, ``false`` otherwise. Using the ``--disable-render-loop`` command line argument or a headless build will return ``false``. + ---- .. _class_DisplayServer_method_window_get_active_popup: @@ -1989,12 +2086,16 @@ Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID` **window_get_attached_instance_id** **(** :ref:`int` window_id=0 **)** |const| +Returns the :ref:`Object.get_instance_id` of the :ref:`Window` the ``window_id`` is attached to. also :ref:`window_get_attached_instance_id`. + ---- .. _class_DisplayServer_method_window_get_current_screen: - :ref:`int` **window_get_current_screen** **(** :ref:`int` window_id=0 **)** |const| +Returns the screen the window specified by ``window_id`` is currently positioned on. If the screen overlaps multiple displays, the screen where the window's center is located is returned. See also :ref:`window_set_current_screen`. + ---- .. _class_DisplayServer_method_window_get_flag: @@ -2009,12 +2110,16 @@ Returns the current value of the given window's ``flag``. - :ref:`Vector2i` **window_get_max_size** **(** :ref:`int` window_id=0 **)** |const| +Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size`. + ---- .. _class_DisplayServer_method_window_get_min_size: - :ref:`Vector2i` **window_get_min_size** **(** :ref:`int` window_id=0 **)** |const| +Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size`. + ---- .. _class_DisplayServer_method_window_get_mode: @@ -2031,7 +2136,7 @@ Returns the mode of the given window. Returns internal structure pointers for use in plugins. -\ **Note:** This method is implemented on Android, Linux, macOS and Windows. +\ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. ---- @@ -2055,13 +2160,15 @@ Returns the position of the given window to on the screen. - :ref:`Vector2i` **window_get_real_size** **(** :ref:`int` window_id=0 **)** |const| +Returns the size of the window specified by ``window_id`` (in pixels), including the borders drawn by the operating system. See also :ref:`window_get_size`. + ---- .. _class_DisplayServer_method_window_get_safe_title_margins: -- :ref:`Vector2i` **window_get_safe_title_margins** **(** :ref:`int` window_id=0 **)** |const| +- :ref:`Vector3i` **window_get_safe_title_margins** **(** :ref:`int` window_id=0 **)** |const| -Returns left and right margins of the title that are safe to use (contains no buttons or other elements) when :ref:`WINDOW_FLAG_EXTEND_TO_TITLE` flag is set. +Returns left margins (``x``), right margins (``y``) and height (``z``) of the title that are safe to use (contains no buttons or other elements) when :ref:`WINDOW_FLAG_EXTEND_TO_TITLE` flag is set. ---- @@ -2069,6 +2176,8 @@ Returns left and right margins of the title that are safe to use (contains no bu - :ref:`Vector2i` **window_get_size** **(** :ref:`int` window_id=0 **)** |const| +Returns the size of the window specified by ``window_id`` (in pixels), excluding the borders drawn by the operating system. This is also called the "client area". See also :ref:`window_get_real_size`, :ref:`window_set_size` and :ref:`window_get_position`. + ---- .. _class_DisplayServer_method_window_get_vsync_mode: @@ -2079,6 +2188,14 @@ Returns the V-Sync mode of the given window. ---- +.. _class_DisplayServer_method_window_is_maximize_allowed: + +- :ref:`bool` **window_is_maximize_allowed** **(** :ref:`int` window_id=0 **)** |const| + +Returns ``true`` if the given window can be maximized (the maximize button is enabled). + +---- + .. _class_DisplayServer_method_window_maximize_on_title_dbl_click: - :ref:`bool` **window_maximize_on_title_dbl_click** **(** **)** |const| @@ -2103,24 +2220,34 @@ Returns ``true``, if double-click on a window title should minimize it. - void **window_move_to_foreground** **(** :ref:`int` window_id=0 **)** +Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows. + ---- .. _class_DisplayServer_method_window_request_attention: - void **window_request_attention** **(** :ref:`int` window_id=0 **)** +Makes the window specified by ``window_id`` request attention, which is materialized by the window title and taskbar entry blinking until the window is focused. This usually has no visible effect if the window is currently focused. The exact behavior varies depending on the operating system. + ---- .. _class_DisplayServer_method_window_set_current_screen: - void **window_set_current_screen** **(** :ref:`int` screen, :ref:`int` window_id=0 **)** +Moves the window specified by ``window_id`` to the specified ``screen``. See also :ref:`window_get_current_screen`. + ---- .. _class_DisplayServer_method_window_set_drop_files_callback: - void **window_set_drop_files_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** +Sets the ``callback`` that should be called when files are dropped from the operating system's file manager to the window specified by ``window_id``. + +\ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web. + ---- .. _class_DisplayServer_method_window_set_exclusive: @@ -2147,40 +2274,54 @@ Enables or disables the given window's given ``flag``. See :ref:`WindowFlags` active, :ref:`int` window_id=0 **)** +Sets whether `Input Method Editor `__ should be enabled for the window specified by ``window_id``. See also :ref:`window_set_ime_position`. + ---- .. _class_DisplayServer_method_window_set_ime_position: - void **window_set_ime_position** **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** +Sets the position of the `Input Method Editor `__ popup for the specified ``window_id``. Only effective if :ref:`window_set_ime_active` was set to ``true`` for the specified ``window_id``. + ---- .. _class_DisplayServer_method_window_set_input_event_callback: - void **window_set_input_event_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** +Sets the ``callback`` that should be called when any :ref:`InputEvent` is sent to the window specified by ``window_id``. + ---- .. _class_DisplayServer_method_window_set_input_text_callback: - void **window_set_input_text_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** +Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``. + ---- .. _class_DisplayServer_method_window_set_max_size: - void **window_set_max_size** **(** :ref:`Vector2i` max_size, :ref:`int` window_id=0 **)** +Sets the maximum size of the window specified by ``window_id`` in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also :ref:`window_get_max_size`. + +\ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. + ---- .. _class_DisplayServer_method_window_set_min_size: - void **window_set_min_size** **(** :ref:`Vector2i` min_size, :ref:`int` window_id=0 **)** -Sets the minimum size for the given window to ``min_size`` (in pixels). +Sets the minimum size for the given window to ``min_size`` (in pixels). Normally, the user will not be able to drag the window to make it larger than the specified size. See also :ref:`window_get_min_size`. \ **Note:** By default, the main window has a minimum size of ``Vector2i(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size. +\ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit. + ---- .. _class_DisplayServer_method_window_set_mode: @@ -2228,9 +2369,9 @@ Passing an empty array will disable passthrough support (all mouse events will b -\ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. +\ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is. -\ **Note:** This method is implemented on Linux, macOS and Windows. +\ **Note:** This method is implemented on Linux (X11), macOS and Windows. ---- @@ -2246,7 +2387,18 @@ Sets the bounding box of control, or menu item that was used to open the popup w - void **window_set_position** **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** -Sets the position of the given window to ``position``. +Sets the position of the given window to ``position``. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: + +:: + + * (0, 0) +-------+ + | | + +-------------+ | | + | | | | + | | | | + +-------------+ +-------+ + +See also :ref:`window_get_position` and :ref:`window_set_size`. ---- @@ -2254,13 +2406,15 @@ Sets the position of the given window to ``position``. - void **window_set_rect_changed_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** +Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized. + ---- .. _class_DisplayServer_method_window_set_size: - void **window_set_size** **(** :ref:`Vector2i` size, :ref:`int` window_id=0 **)** -Sets the size of the given window to ``size``. +Sets the size of the given window to ``size`` (in pixels). See also :ref:`window_get_size` and :ref:`window_get_position`. ---- @@ -2270,6 +2424,8 @@ Sets the size of the given window to ``size``. Sets the title of the given window to ``title``. +\ **Note:** Avoid changing the window title every frame, as this can cause performance issues on certain window managers. Try to change the window title only a few times per second at most. + ---- .. _class_DisplayServer_method_window_set_transient: @@ -2308,6 +2464,8 @@ When :ref:`WINDOW_FLAG_EXTEND_TO_TITLE` callback, :ref:`int` window_id=0 **)** +Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_editorcommandpalette.rst b/classes/class_editorcommandpalette.rst index 24d42638c..88bd94683 100644 --- a/classes/class_editorcommandpalette.rst +++ b/classes/class_editorcommandpalette.rst @@ -19,7 +19,7 @@ Description Object that holds all the available Commands and their shortcuts text. These Commands can be accessed through **Editor > Command Palette** menu. -Command key names use slash delimiters to distinguish sections Example: ``"example/command1"`` then ``example`` will be the section name. +Command key names use slash delimiters to distinguish sections, for example: ``"example/command1"`` then ``example`` will be the section name. .. tabs:: diff --git a/classes/class_editorfeatureprofile.rst b/classes/class_editorfeatureprofile.rst index 2a6c91aba..1d3ed28d7 100644 --- a/classes/class_editorfeatureprofile.rst +++ b/classes/class_editorfeatureprofile.rst @@ -67,6 +67,8 @@ Enumerations .. _class_EditorFeatureProfile_constant_FEATURE_IMPORT_DOCK: +.. _class_EditorFeatureProfile_constant_FEATURE_HISTORY_DOCK: + .. _class_EditorFeatureProfile_constant_FEATURE_MAX: enum **Feature**: @@ -85,7 +87,9 @@ enum **Feature**: - **FEATURE_IMPORT_DOCK** = **6** --- The Import dock. If this feature is disabled, the Import dock won't be visible. -- **FEATURE_MAX** = **7** --- Represents the size of the :ref:`Feature` enum. +- **FEATURE_HISTORY_DOCK** = **7** --- The History dock. If this feature is disabled, the History dock won't be visible. + +- **FEATURE_MAX** = **8** --- Represents the size of the :ref:`Feature` enum. Method Descriptions ------------------- @@ -110,7 +114,7 @@ Returns ``true`` if the class specified by ``class_name`` is disabled. When disa - :ref:`bool` **is_class_editor_disabled** **(** :ref:`StringName` class_name **)** |const| -Returns ``true`` if editing for the class specified by ``class_name`` is disabled. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. +Returns ``true`` if editing for the class specified by ``class_name`` is disabled. When disabled, the class will still appear in the Create New Node dialog but the Inspector will be read-only when selecting a node that extends the class. ---- @@ -118,7 +122,7 @@ Returns ``true`` if editing for the class specified by ``class_name`` is disable - :ref:`bool` **is_class_property_disabled** **(** :ref:`StringName` class_name, :ref:`StringName` property **)** |const| -Returns ``true`` if ``property`` is disabled in the class specified by ``class_name``. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by ``class_name``. +Returns ``true`` if ``property`` is disabled in the class specified by ``class_name``. When a property is disabled, it won't appear in the Inspector when selecting a node that extends the class specified by ``class_name``. ---- @@ -158,7 +162,7 @@ If ``disable`` is ``true``, disables the class specified by ``class_name``. When - void **set_disable_class_editor** **(** :ref:`StringName` class_name, :ref:`bool` disable **)** -If ``disable`` is ``true``, disables editing for the class specified by ``class_name``. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. +If ``disable`` is ``true``, disables editing for the class specified by ``class_name``. When disabled, the class will still appear in the Create New Node dialog but the Inspector will be read-only when selecting a node that extends the class. ---- @@ -166,7 +170,7 @@ If ``disable`` is ``true``, disables editing for the class specified by ``class_ - void **set_disable_class_property** **(** :ref:`StringName` class_name, :ref:`StringName` property, :ref:`bool` disable **)** -If ``disable`` is ``true``, disables editing for ``property`` in the class specified by ``class_name``. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by ``class_name``. +If ``disable`` is ``true``, disables editing for ``property`` in the class specified by ``class_name``. When a property is disabled, it won't appear in the Inspector when selecting a node that extends the class specified by ``class_name``. ---- diff --git a/classes/class_editorfiledialog.rst b/classes/class_editorfiledialog.rst index 3327d27d5..7b6d45b44 100644 --- a/classes/class_editorfiledialog.rst +++ b/classes/class_editorfiledialog.rst @@ -14,6 +14,11 @@ EditorFileDialog A modified version of :ref:`FileDialog` used by the editor. +Description +----------- + +``EditorFileDialog`` is an enhanced version of :ref:`FileDialog` available only to editor plugins. Additional features include list of favorited/recent files and ability to see files as thumbnails grid instead of list. + Properties ---------- @@ -257,7 +262,7 @@ The dialog's open or save mode, which affects the selection behavior. See :ref:` | *Getter* | is_showing_hidden_files() | +-----------+------------------------------+ -If ``true``, hidden files and directories will be visible in the ``EditorFileDialog``. +If ``true``, hidden files and directories will be visible in the ``EditorFileDialog``. This property is synchronized with :ref:`EditorSettings.filesystem/file_dialog/show_hidden_files`. Method Descriptions ------------------- diff --git a/classes/class_editorinspector.rst b/classes/class_editorinspector.rst index bc908020e..dcf9d25a5 100644 --- a/classes/class_editorinspector.rst +++ b/classes/class_editorinspector.rst @@ -58,7 +58,7 @@ Emitted when the object being edited by the inspector has changed. - **object_id_selected** **(** :ref:`int` id **)** -Emitted when the Edit button of an :ref:`Object` has been pressed in the inspector. This is mainly used in the remote scene tree inspector. +Emitted when the Edit button of an :ref:`Object` has been pressed in the inspector. This is mainly used in the remote scene tree Inspector. ---- diff --git a/classes/class_editorinspectorplugin.rst b/classes/class_editorinspectorplugin.rst index d3fdc502c..d9c3bc6a6 100644 --- a/classes/class_editorinspectorplugin.rst +++ b/classes/class_editorinspectorplugin.rst @@ -12,7 +12,7 @@ EditorInspectorPlugin **Inherits:** :ref:`RefCounted` **<** :ref:`Object` -Plugin for adding custom property editors on inspector. +Plugin for adding custom property editors on the inspector. Description ----------- diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index 844168602..6f2f7557f 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -74,6 +74,8 @@ Methods +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`inspect_object` **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_movie_maker_enabled` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing_scene` **(** **)** |const| | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_plugin_enabled` **(** :ref:`String` plugin **)** |const| | @@ -100,6 +102,8 @@ Methods +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_main_screen_editor` **(** :ref:`String` name **)** | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_movie_maker_enabled` **(** :ref:`bool` enabled **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_plugin_enabled` **(** :ref:`String` plugin, :ref:`bool` enabled **)** | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`stop_playing_scene` **(** **)** | @@ -197,6 +201,8 @@ Returns the editor control responsible for main screen plugins and tools. Use it - :ref:`EditorPaths` **get_editor_paths** **(** **)** +Returns the :ref:`EditorPaths` singleton. + ---- .. _class_EditorInterface_method_get_editor_scale: @@ -303,6 +309,14 @@ Shows the given property on the given ``object`` in the editor's Inspector dock. ---- +.. _class_EditorInterface_method_is_movie_maker_enabled: + +- :ref:`bool` **is_movie_maker_enabled** **(** **)** |const| + +Returns ``true`` if Movie Maker mode is enabled in the editor. See also :ref:`set_movie_maker_enabled`. See :ref:`MovieWriter` for more information. + +---- + .. _class_EditorInterface_method_is_playing_scene: - :ref:`bool` **is_playing_scene** **(** **)** |const| @@ -379,7 +393,7 @@ Restarts the editor. This closes the editor and then opens the same project. If - :ref:`Error` **save_scene** **(** **)** -Saves the scene. Returns either ``OK`` or ``ERR_CANT_CREATE`` (see :ref:`@GlobalScope` constants). +Saves the scene. Returns either :ref:`@GlobalScope.OK` or :ref:`@GlobalScope.ERR_CANT_CREATE`. ---- @@ -407,6 +421,14 @@ Sets the editor's current main screen to the one specified in ``name``. ``name`` ---- +.. _class_EditorInterface_method_set_movie_maker_enabled: + +- void **set_movie_maker_enabled** **(** :ref:`bool` enabled **)** + +Sets whether Movie Maker mode is enabled in the editor. See also :ref:`is_movie_maker_enabled`. See :ref:`MovieWriter` for more information. + +---- + .. _class_EditorInterface_method_set_plugin_enabled: - void **set_plugin_enabled** **(** :ref:`String` plugin, :ref:`bool` enabled **)** diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index 113ad80af..c6d4a518f 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -172,12 +172,16 @@ Emitted when user changes the workspace (**2D**, **3D**, **Script**, **AssetLib* - **project_settings_changed** **(** **)** +Emitted when any project setting has changed. + ---- .. _class_EditorPlugin_signal_resource_saved: - **resource_saved** **(** :ref:`Resource` resource **)** +Emitted when the given ``resource`` was saved on disc. + ---- .. _class_EditorPlugin_signal_scene_changed: @@ -422,7 +426,9 @@ You need to enable calling of this method by using :ref:`set_force_draw_over_for - :ref:`int` **_forward_3d_gui_input** **(** :ref:`Camera3D` viewport_camera, :ref:`InputEvent` event **)** |virtual| -Called when there is a root node in the current edited scene, :ref:`_handles` is implemented, and an :ref:`InputEvent` happens in the 3D viewport. The return value decides whether the :ref:`InputEvent` is consumed or forwarded to other ``EditorPlugin``\ s. See :ref:`AfterGUIInput` for options. Example: +Called when there is a root node in the current edited scene, :ref:`_handles` is implemented, and an :ref:`InputEvent` happens in the 3D viewport. The return value decides whether the :ref:`InputEvent` is consumed or forwarded to other ``EditorPlugin``\ s. See :ref:`AfterGUIInput` for options. + +\ **Example:**\ .. tabs:: @@ -443,7 +449,9 @@ Called when there is a root node in the current edited scene, :ref:`_handles` to other Editor classes. Example: +Must ``return EditorPlugin.AFTER_GUI_INPUT_PASS`` in order to forward the :ref:`InputEvent` to other Editor classes. + +\ **Example:**\ .. tabs:: @@ -524,7 +532,9 @@ You need to enable calling of this method by using :ref:`set_force_draw_over_for - :ref:`bool` **_forward_canvas_gui_input** **(** :ref:`InputEvent` event **)** |virtual| -Called when there is a root node in the current edited scene, :ref:`_handles` is implemented and an :ref:`InputEvent` happens in the 2D viewport. Intercepts the :ref:`InputEvent`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. Example: +Called when there is a root node in the current edited scene, :ref:`_handles` is implemented and an :ref:`InputEvent` happens in the 2D viewport. Intercepts the :ref:`InputEvent`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. + +\ **Example:**\ .. tabs:: @@ -545,7 +555,9 @@ Called when there is a root node in the current edited scene, :ref:`_handles` to other Editor classes. Example: +Must ``return false`` in order to forward the :ref:`InputEvent` to other Editor classes. + +\ **Example:**\ .. tabs:: diff --git a/classes/class_editorproperty.rst b/classes/class_editorproperty.rst index 44ee9fac6..770c72cbf 100644 --- a/classes/class_editorproperty.rst +++ b/classes/class_editorproperty.rst @@ -326,6 +326,8 @@ Puts the ``editor`` control below the property label. The control must be previo - void **update_property** **(** **)** +Forces refresh of the property display. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_editorscript.rst b/classes/class_editorscript.rst index 2f14ade2d..c8943b393 100644 --- a/classes/class_editorscript.rst +++ b/classes/class_editorscript.rst @@ -52,6 +52,8 @@ Scripts extending this class and implementing its :ref:`_run`, meaning it is destroyed when nothing references it. This can cause errors during asynchronous operations if there are no references to the script. + Methods ------- diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index f06bf0d89..20e677a68 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -220,6 +220,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`filesystem/on_save/safe_save_on_backup_then_rename` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`interface/editor/accept_dialog_cancel_ok_buttons` | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/editor/automatically_open_screenshots` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`interface/editor/code_font` | @@ -597,7 +599,7 @@ The thumbnail size to use in the FileSystem dock (in pixels). See also :ref:`fil - :ref:`float` **docks/property_editor/auto_refresh_interval** -The refresh interval to use for the inspector dock's properties. The effect of this setting is mainly noticeable when adjusting gizmos in the 2D/3D editor and looking at the inspector at the same time. Lower values make the inspector more often, but take up more CPU time. +The refresh interval to use for the Inspector dock's properties. The effect of this setting is mainly noticeable when adjusting gizmos in the 2D/3D editor and looking at the inspector at the same time. Lower values make the inspector more often, but take up more CPU time. ---- @@ -605,7 +607,7 @@ The refresh interval to use for the inspector dock's properties. The effect of t - :ref:`float` **docks/property_editor/subresource_hue_tint** -The tint intensity to use for the subresources background in the inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference. +The tint intensity to use for the subresources background in the Inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference. ---- @@ -1031,7 +1033,7 @@ The color to use for the selection box that surrounds selected nodes in the 3D e - :ref:`Color` **editors/3d_gizmos/gizmo_colors/instantiated** -The color override to use for 3D editor gizmos if the :ref:`Node3D` in question is part of an instanced scene file (from the perspective of the current scene). +The color override to use for 3D editor gizmos if the :ref:`Node3D` in question is part of an instantiated scene file (from the perspective of the current scene). ---- @@ -1277,6 +1279,20 @@ If ``true``, when saving a file, the editor will rename the old file to a differ ---- +.. _class_EditorSettings_property_interface/editor/accept_dialog_cancel_ok_buttons: + +- :ref:`int` **interface/editor/accept_dialog_cancel_ok_buttons** + +How to position the Cancel and OK buttons in the editor's :ref:`AcceptDialog`\ s. Different platforms have different standard behaviors for this, which can be overridden using this setting. This is useful if you use Godot both on Windows and macOS/Linux and your Godot muscle memory is stronger than your OS specific one. + +- **Auto** follows the platform convention: Cancel first on macOS and Linux, OK first on Windows. + +- **Cancel First** forces the ordering Cancel/OK. + +- **OK First** forces the ordering OK/Cancel. + +---- + .. _class_EditorSettings_property_interface/editor/automatically_open_screenshots: - :ref:`bool` **interface/editor/automatically_open_screenshots** @@ -1411,7 +1427,7 @@ If set to **Auto**, the font hinting mode will be set to match the current opera - :ref:`int` **interface/editor/font_subpixel_positioning** -The subpixel positioning mode to use when rendering editor font glyphs. This affects both the main and code fonts. **Disabled** is the fastest to render and uses the least memory. **Auto** only uses subpixel positioning for small font sizes (where the benefit is the most noticeable). **One half of a pixel** and **One quarter of a pixel** force the same subpixel positioning mode for all editor fonts, regardless of their size (with **One quarter of a pixel** being the highest-quality option). +The subpixel positioning mode to use when rendering editor font glyphs. This affects both the main and code fonts. **Disabled** is the fastest to render and uses the least memory. **Auto** only uses subpixel positioning for small font sizes (where the benefit is the most noticeable). **One Half of a Pixel** and **One Quarter of a Pixel** force the same subpixel positioning mode for all editor fonts, regardless of their size (with **One Quarter of a Pixel** being the highest-quality option). ---- @@ -1835,7 +1851,7 @@ If ``true``, displays line length guidelines to help you keep line lengths in ch - :ref:`bool` **text_editor/appearance/gutters/highlight_type_safe_lines** -If ``true``, highlights type-safe lines by displaying their line number color with :ref:`text_editor/theme/highlighting/safe_line_number_color` instead of :ref:`text_editor/theme/highlighting/line_number_color`. Type-safe lines are lines of code where the type of all variables is known at compile-time. These type-safe lines will run faster in Godot 4.0 and later thanks to typed instructions. +If ``true``, highlights type-safe lines by displaying their line number color with :ref:`text_editor/theme/highlighting/safe_line_number_color` instead of :ref:`text_editor/theme/highlighting/line_number_color`. Type-safe lines are lines of code where the type of all variables is known at compile-time. These type-safe lines may run faster thanks to typed instructions. ---- @@ -1851,7 +1867,7 @@ If ``true``, displays line numbers with zero padding (e.g. ``007`` instead of `` - :ref:`bool` **text_editor/appearance/gutters/show_bookmark_gutter** -If ``true``, displays a gutter at the left containing icons for bookmarks. +If ``true``, displays icons for bookmarks in a gutter at the left. Bookmarks remain functional when this setting is disabled. ---- @@ -1867,7 +1883,7 @@ If ``true``, displays a gutter at the left containing icons for methods with sig - :ref:`bool` **text_editor/appearance/gutters/show_line_numbers** -If ``true``, displays line numbers in the gutter at the left. +If ``true``, displays line numbers in a gutter at the left. ---- @@ -2049,7 +2065,7 @@ The number of pixels to scroll with every mouse wheel increment. Higher values m - :ref:`bool` **text_editor/completion/add_type_hints** -If ``true``, adds static typing hints such as ``-> void`` and ``: int`` when performing method definition autocompletion. +If ``true``, adds static typing hints such as ``-> void`` and ``: int`` when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the :kbd:`Ctrl` key. ---- @@ -2183,7 +2199,7 @@ The script editor's background color. If set to a translucent color, the editor - :ref:`Color` **text_editor/theme/highlighting/base_type_color** -The script editor's base type color (used for types like :ref:`Vector2`, :ref:`Vector3`, ...). +The script editor's base type color (used for types like :ref:`Vector2`, :ref:`Vector3`, :ref:`Color`, ...). ---- @@ -2341,7 +2357,7 @@ The script editor's function call color. - :ref:`Color` **text_editor/theme/highlighting/keyword_color** -The script editor's non-control flow keyword color (used for keywords like ``var``, ``func``, some built-in methods, ...). +The script editor's non-control flow keyword color (used for keywords like ``var``, ``func``, ``extends``, ...). ---- @@ -2349,7 +2365,7 @@ The script editor's non-control flow keyword color (used for keywords like ``var - :ref:`Color` **text_editor/theme/highlighting/line_length_guideline_color** -The script editor's color for the line length guideline. The "hard" line length guideline will be drawn with this color, whereas the "soft" line length guideline will be drawn with an opacity twice as low. +The script editor's color for the line length guideline. The "hard" line length guideline will be drawn with this color, whereas the "soft" line length guideline will be drawn with half of its opacity. ---- @@ -2457,7 +2473,7 @@ The script editor's background color for text. This should be set to a transluce - :ref:`Color` **text_editor/theme/highlighting/user_type_color** -The script editor's color for user-defined types (using ``@class_name``). +The script editor's color for user-defined types (using ``class_name``). ---- diff --git a/classes/class_editorspinslider.rst b/classes/class_editorspinslider.rst index 8ae431a8f..9cb448b1d 100644 --- a/classes/class_editorspinslider.rst +++ b/classes/class_editorspinslider.rst @@ -22,17 +22,19 @@ This :ref:`Control` node is used in the editor's Inspector dock t Properties ---------- -+-----------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`flat` | ``false`` | -+-----------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`hide_slider` | ``false`` | -+-----------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`String` | :ref:`label` | ``""`` | -+-----------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`read_only` | ``false`` | -+-----------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`String` | :ref:`suffix` | ``""`` | -+-----------------------------+-----------------------------------------------------------------+-----------+ ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`flat` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`hide_slider` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`String` | :ref:`label` | ``""`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`read_only` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ +| :ref:`String` | :ref:`suffix` | ``""`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ Property Descriptions --------------------- @@ -49,6 +51,8 @@ Property Descriptions | *Getter* | is_flat() | +-----------+-----------------+ +If ``true``, the slider will not draw background. + ---- .. _class_EditorSpinSlider_property_hide_slider: @@ -79,6 +83,8 @@ If ``true``, the slider is hidden. | *Getter* | get_label() | +-----------+------------------+ +The text that displays to the left of the value. + ---- .. _class_EditorSpinSlider_property_read_only: @@ -93,6 +99,8 @@ If ``true``, the slider is hidden. | *Getter* | is_read_only() | +-----------+----------------------+ +If ``true``, the slider can't be interacted with. + ---- .. _class_EditorSpinSlider_property_suffix: diff --git a/classes/class_editorundoredomanager.rst b/classes/class_editorundoredomanager.rst index 5c26c888e..10d4574aa 100644 --- a/classes/class_editorundoredomanager.rst +++ b/classes/class_editorundoredomanager.rst @@ -56,6 +56,23 @@ Methods | :ref:`bool` | :ref:`is_committing_action` **(** **)** |const| | +---------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +Signals +------- + +.. _class_EditorUndoRedoManager_signal_history_changed: + +- **history_changed** **(** **)** + +Emitted when the list of actions in any history has changed, either when an action is commited or a history is cleared. + +---- + +.. _class_EditorUndoRedoManager_signal_version_changed: + +- **version_changed** **(** **)** + +Emitted when the version of any history has changed as a result of undo or redo call. + Enumerations ------------ diff --git a/classes/class_enetmultiplayerpeer.rst b/classes/class_enetmultiplayerpeer.rst index 230a1593c..7597346f4 100644 --- a/classes/class_enetmultiplayerpeer.rst +++ b/classes/class_enetmultiplayerpeer.rst @@ -31,11 +31,9 @@ Tutorials Properties ---------- -+---------------------------------------------+----------------------------------------------------------------------+----------+ -| :ref:`ENetConnection` | :ref:`host` | | -+---------------------------------------------+----------------------------------------------------------------------+----------+ -| :ref:`bool` | :ref:`server_relay` | ``true`` | -+---------------------------------------------+----------------------------------------------------------------------+----------+ ++---------------------------------------------+------------------------------------------------------+ +| :ref:`ENetConnection` | :ref:`host` | ++---------------------------------------------+------------------------------------------------------+ Methods ------- @@ -43,8 +41,6 @@ Methods +---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`add_mesh_peer` **(** :ref:`int` peer_id, :ref:`ENetConnection` host **)** | +---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`close_connection` **(** :ref:`int` wait_usec=100 **)** | -+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`create_client` **(** :ref:`String` address, :ref:`int` port, :ref:`int` channel_count=0, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0, :ref:`int` local_port=0 **)** | +---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`create_mesh` **(** :ref:`int` unique_id **)** | @@ -69,22 +65,6 @@ Property Descriptions The underlying :ref:`ENetConnection` created after :ref:`create_client` and :ref:`create_server`. ----- - -.. _class_ENetMultiplayerPeer_property_server_relay: - -- :ref:`bool` **server_relay** - -+-----------+---------------------------------+ -| *Default* | ``true`` | -+-----------+---------------------------------+ -| *Setter* | set_server_relay_enabled(value) | -+-----------+---------------------------------+ -| *Getter* | is_server_relay_enabled() | -+-----------+---------------------------------+ - -Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is ``false``, clients won't be automatically notified of other peers and won't be able to send them packets through the server. - Method Descriptions ------------------- @@ -98,19 +78,11 @@ Add a new remote peer with the given ``peer_id`` connected to the given ``host`` ---- -.. _class_ENetMultiplayerPeer_method_close_connection: - -- void **close_connection** **(** :ref:`int` wait_usec=100 **)** - -Closes the connection. Ignored if no connection is currently established. If this is a server it tries to notify all clients before forcibly disconnecting them. If this is a client it simply closes the connection to the server. - ----- - .. _class_ENetMultiplayerPeer_method_create_client: - :ref:`Error` **create_client** **(** :ref:`String` address, :ref:`int` port, :ref:`int` channel_count=0, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0, :ref:`int` local_port=0 **)** -Create client that connects to a server at ``address`` using specified ``port``. The given address needs to be either a fully qualified domain name (e.g. ``"www.example.com"``) or an IP address in IPv4 or IPv6 format (e.g. ``"192.168.1.1"``). The ``port`` is the port the server is listening on. The ``channel_count`` parameter can be used to specify the number of ENet channels allocated for the connection. The ``in_bandwidth`` and ``out_bandwidth`` parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns :ref:`@GlobalScope.OK` if a client was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call :ref:`close_connection` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the client could not be created. If ``local_port`` is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques. +Create client that connects to a server at ``address`` using specified ``port``. The given address needs to be either a fully qualified domain name (e.g. ``"www.example.com"``) or an IP address in IPv4 or IPv6 format (e.g. ``"192.168.1.1"``). The ``port`` is the port the server is listening on. The ``channel_count`` parameter can be used to specify the number of ENet channels allocated for the connection. The ``in_bandwidth`` and ``out_bandwidth`` parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns :ref:`@GlobalScope.OK` if a client was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call :ref:`MultiplayerPeer.close` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the client could not be created. If ``local_port`` is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques. ---- @@ -126,7 +98,7 @@ Initialize this :ref:`MultiplayerPeer` in mesh mode. The - :ref:`Error` **create_server** **(** :ref:`int` port, :ref:`int` max_clients=32, :ref:`int` max_channels=0, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0 **)** -Create server that listens to connections via ``port``. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use :ref:`set_bind_ip`. The default IP is the wildcard ``"*"``, which listens on all available interfaces. ``max_clients`` is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see :ref:`create_client`. Returns :ref:`@GlobalScope.OK` if a server was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call :ref:`close_connection` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the server could not be created. +Create server that listens to connections via ``port``. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use :ref:`set_bind_ip`. The default IP is the wildcard ``"*"``, which listens on all available interfaces. ``max_clients`` is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see :ref:`create_client`. Returns :ref:`@GlobalScope.OK` if a server was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call :ref:`MultiplayerPeer.close` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the server could not be created. ---- diff --git a/classes/class_enetpacketpeer.rst b/classes/class_enetpacketpeer.rst index 39ffa6afd..ee43b13b9 100644 --- a/classes/class_enetpacketpeer.rst +++ b/classes/class_enetpacketpeer.rst @@ -90,25 +90,25 @@ Enumerations enum **PeerState**: -- **STATE_DISCONNECTED** = **0** +- **STATE_DISCONNECTED** = **0** --- The peer is disconnected. -- **STATE_CONNECTING** = **1** +- **STATE_CONNECTING** = **1** --- The peer is currently attempting to connect. -- **STATE_ACKNOWLEDGING_CONNECT** = **2** +- **STATE_ACKNOWLEDGING_CONNECT** = **2** --- The peer has acknowledged the connection request. -- **STATE_CONNECTION_PENDING** = **3** +- **STATE_CONNECTION_PENDING** = **3** --- The peer is currently connecting. -- **STATE_CONNECTION_SUCCEEDED** = **4** +- **STATE_CONNECTION_SUCCEEDED** = **4** --- The peer has successfully connected, but is not ready to communicate with yet (:ref:`STATE_CONNECTED`). -- **STATE_CONNECTED** = **5** +- **STATE_CONNECTED** = **5** --- The peer is currently connected and ready to communicate with. -- **STATE_DISCONNECT_LATER** = **6** +- **STATE_DISCONNECT_LATER** = **6** --- The peer is slated to disconnect after it has no more outgoing packets to send. -- **STATE_DISCONNECTING** = **7** +- **STATE_DISCONNECTING** = **7** --- The peer is currently disconnecting. -- **STATE_ACKNOWLEDGING_DISCONNECT** = **8** +- **STATE_ACKNOWLEDGING_DISCONNECT** = **8** --- The peer has acknowledged the disconnection request. -- **STATE_ZOMBIE** = **9** +- **STATE_ZOMBIE** = **9** --- The peer has lost connection, but is not considered truly disconnected (as the peer didn't acknowledge the disconnection request). ---- @@ -148,7 +148,7 @@ enum **PeerStatistic**: - **PEER_PACKET_LOSS_VARIANCE** = **1** --- Packet loss variance. -- **PEER_PACKET_LOSS_EPOCH** = **2** +- **PEER_PACKET_LOSS_EPOCH** = **2** --- The time at which packet loss statistics were last updated (in milliseconds since the connection started). The interval for packet loss statistics updates is 10 seconds, and at least one packet must have been sent since the last statistics update. - **PEER_ROUND_TRIP_TIME** = **3** --- Mean packet round trip time for reliable packets. @@ -158,19 +158,19 @@ enum **PeerStatistic**: - **PEER_LAST_ROUND_TRIP_TIME_VARIANCE** = **6** --- Variance of the last trip time recorded. -- **PEER_PACKET_THROTTLE** = **7** +- **PEER_PACKET_THROTTLE** = **7** --- The peer's current throttle status. -- **PEER_PACKET_THROTTLE_LIMIT** = **8** +- **PEER_PACKET_THROTTLE_LIMIT** = **8** --- The maximum number of unreliable packets that should not be dropped. This value is always greater than or equal to ``1``. The initial value is equal to :ref:`PACKET_THROTTLE_SCALE`. -- **PEER_PACKET_THROTTLE_COUNTER** = **9** +- **PEER_PACKET_THROTTLE_COUNTER** = **9** --- Internal value used to increment the packet throttle counter. The value is hardcoded to ``7`` and cannot be changed. You probably want to look at :ref:`PEER_PACKET_THROTTLE_ACCELERATION` instead. -- **PEER_PACKET_THROTTLE_EPOCH** = **10** +- **PEER_PACKET_THROTTLE_EPOCH** = **10** --- The time at which throttle statistics were last updated (in milliseconds since the connection started). The interval for throttle statistics updates is :ref:`PEER_PACKET_THROTTLE_INTERVAL`. -- **PEER_PACKET_THROTTLE_ACCELERATION** = **11** +- **PEER_PACKET_THROTTLE_ACCELERATION** = **11** --- The throttle's acceleration factor. Higher values will make ENet adapt to fluctuating network conditions faster, causing unrelaible packets to be sent *more* often. The default value is ``2``. -- **PEER_PACKET_THROTTLE_DECELERATION** = **12** +- **PEER_PACKET_THROTTLE_DECELERATION** = **12** --- The throttle's deceleration factor. Higher values will make ENet adapt to fluctuating network conditions faster, causing unrelaible packets to be sent *less* often. The default value is ``2``. -- **PEER_PACKET_THROTTLE_INTERVAL** = **13** +- **PEER_PACKET_THROTTLE_INTERVAL** = **13** --- The interval over which the lowest mean round trip time should be measured for use by the throttle mechanism (in milliseconds). The default value is ``5000``. Constants --------- @@ -187,7 +187,7 @@ Constants - **PACKET_LOSS_SCALE** = **65536** --- The reference scale for packet loss. See :ref:`get_statistic` and :ref:`PEER_PACKET_LOSS`. -- **PACKET_THROTTLE_SCALE** = **32** --- The reference value for throttle configuration. See :ref:`throttle_configure`. +- **PACKET_THROTTLE_SCALE** = **32** --- The reference value for throttle configuration. The default value is ``32``. See :ref:`throttle_configure`. - **FLAG_RELIABLE** = **1** --- Mark the packet to be sent as reliable. @@ -282,7 +282,7 @@ Sends a ping request to a peer. ENet automatically pings all connected peers at - void **ping_interval** **(** :ref:`int` ping_interval **)** -Sets the ``ping_interval`` in milliseconds at which pings will be sent to a peer. Pings are used both to monitor the liveness of the connection and also to dynamically adjust the throttle during periods of low traffic so that the throttle has reasonable responsiveness during traffic spikes. +Sets the ``ping_interval`` in milliseconds at which pings will be sent to a peer. Pings are used both to monitor the liveness of the connection and also to dynamically adjust the throttle during periods of low traffic so that the throttle has reasonable responsiveness during traffic spikes. The default ping interval is ``500`` milliseconds. ---- @@ -318,11 +318,11 @@ The ``timeout_limit`` is a factor that, multiplied by a value based on the avera Configures throttle parameter for a peer. -Unreliable packets are dropped by ENet in response to the varying conditions of the Internet connection to the peer. The throttle represents a probability that an unreliable packet should not be dropped and thus sent by ENet to the peer. By measuring fluctuations in round trip times of reliable packets over the specified ``interval``, ENet will either increase the probably by the amount specified in the ``acceleration`` parameter, or decrease it by the amount specified in the ``deceleration`` parameter (both are ratios to :ref:`PACKET_THROTTLE_SCALE`). +Unreliable packets are dropped by ENet in response to the varying conditions of the Internet connection to the peer. The throttle represents a probability that an unreliable packet should not be dropped and thus sent by ENet to the peer. By measuring fluctuations in round trip times of reliable packets over the specified ``interval``, ENet will either increase the probability by the amount specified in the ``acceleration`` parameter, or decrease it by the amount specified in the ``deceleration`` parameter (both are ratios to :ref:`PACKET_THROTTLE_SCALE`). When the throttle has a value of :ref:`PACKET_THROTTLE_SCALE`, no unreliable packets are dropped by ENet, and so 100% of all unreliable packets will be sent. -When the throttle has a value of 0, all unreliable packets are dropped by ENet, and so 0% of all unreliable packets will be sent. +When the throttle has a value of ``0``, all unreliable packets are dropped by ENet, and so 0% of all unreliable packets will be sent. Intermediate values for the throttle represent intermediate probabilities between 0% and 100% of unreliable packets being sent. The bandwidth limits of the local and foreign hosts are taken into account to determine a sensible limit for the throttle probability above which it should not raise even in the best of conditions. diff --git a/classes/class_engine.rst b/classes/class_engine.rst index 95307acf5..5dece51f7 100644 --- a/classes/class_engine.rst +++ b/classes/class_engine.rst @@ -376,12 +376,16 @@ Returns the total number of frames passed since engine initialization which is a - :ref:`ScriptLanguage` **get_script_language** **(** :ref:`int` index **)** |const| +Returns an instance of a :ref:`ScriptLanguage` with the given index. + ---- .. _class_Engine_method_get_script_language_count: - :ref:`int` **get_script_language_count** **(** **)** +Returns the number of available script languages. Use with :ref:`get_script_language`. + ---- .. _class_Engine_method_get_singleton: @@ -396,6 +400,8 @@ Returns a global singleton with given ``name``. Often used for plugins, e.g. God - :ref:`PackedStringArray` **get_singleton_list** **(** **)** |const| +Returns a list of available global singletons. + ---- .. _class_Engine_method_get_version_info: @@ -508,18 +514,24 @@ Returns ``true`` if the game is inside the fixed process and physics phase of th - void **register_script_language** **(** :ref:`ScriptLanguage` language **)** +Registers a :ref:`ScriptLanguage` instance to be available with ``ScriptServer``. + ---- .. _class_Engine_method_register_singleton: - void **register_singleton** **(** :ref:`StringName` name, :ref:`Object` instance **)** +Registers the given object as a singleton, globally available under ``name``. + ---- .. _class_Engine_method_unregister_singleton: - void **unregister_singleton** **(** :ref:`StringName` name **)** +Unregisters the singleton registered under ``name``. The singleton object is not freed. Only works with user-defined singletons created with :ref:`register_singleton`. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_environment.rst b/classes/class_environment.rst index 62e1b4824..ae67f2c73 100644 --- a/classes/class_environment.rst +++ b/classes/class_environment.rst @@ -1764,6 +1764,8 @@ The base *exponential* density of the volumetric fog. Set this to the lowest den A value of ``0.0`` disables global volumetric fog while allowing :ref:`FogVolume`\ s to display volumetric fog in specific areas. +To make volumetric fog work as a volumetric *lighting* solution, set :ref:`volumetric_fog_density` to the lowest non-zero value (``0.0001``) then increase lights' :ref:`Light3D.light_volumetric_fog_energy` to values between ``10000`` and ``100000`` to compensate for the very low density. + ---- .. _class_Environment_property_volumetric_fog_detail_spread: diff --git a/classes/class_expression.rst b/classes/class_expression.rst index 754994549..d835b692a 100644 --- a/classes/class_expression.rst +++ b/classes/class_expression.rst @@ -31,7 +31,7 @@ In the following example we use a :ref:`LineEdit` node to write var expression = Expression.new() func _ready(): - $LineEdit.connect("text_submitted", self, "_on_text_submitted") + $LineEdit.text_submitted.connect(self._on_text_submitted) func _on_text_submitted(command): var error = expression.parse(command) @@ -48,7 +48,7 @@ In the following example we use a :ref:`LineEdit` node to write public override void _Ready() { - GetNode("LineEdit").Connect("text_submitted", this, nameof(OnTextEntered)); + GetNode("LineEdit").TextSubmitted += OnTextEntered; } private void OnTextEntered(string command) diff --git a/classes/class_float.rst b/classes/class_float.rst index d05d73b1b..7c32700d9 100644 --- a/classes/class_float.rst +++ b/classes/class_float.rst @@ -210,10 +210,18 @@ Multiplies each component of the :ref:`Vector3i` by the given `` - :ref:`Vector4` **operator *** **(** :ref:`Vector4` right **)** +Multiplies each component of the :ref:`Vector4` by the given ``float``. + ---- - :ref:`Vector4` **operator *** **(** :ref:`Vector4i` right **)** +Multiplies each component of the :ref:`Vector4i` by the given ``float``. Returns a :ref:`Vector4`. + +:: + + print(0.9 * Vector4i(10, 15, 20, -10)) # Prints "(9, 13.5, 18, -9)" + ---- - :ref:`float` **operator *** **(** :ref:`float` right **)** @@ -232,10 +240,22 @@ Multiplies a ``float`` and an :ref:`int`. The result is a ``float``. - :ref:`float` **operator **** **(** :ref:`float` right **)** +Raises a ``float`` to a power of a ``float``. + +:: + + print(39.0625**0.25) # 2.5 + ---- - :ref:`float` **operator **** **(** :ref:`int` right **)** +Raises a ``float`` to a power of an :ref:`int`. The result is a ``float``. + +:: + + print(0.9**3) # 0.729 + ---- .. _class_float_operator_sum_float: @@ -284,7 +304,7 @@ Divides a ``float`` by an :ref:`int`. The result is a ``float``. - :ref:`bool` **operator <** **(** :ref:`float` right **)** -Returns ``true`` the left float is less than the right one. +Returns ``true`` if the left float is less than the right one. ---- @@ -298,7 +318,7 @@ Returns ``true`` if this ``float`` is less than the given :ref:`int`. - :ref:`bool` **operator <=** **(** :ref:`float` right **)** -Returns ``true`` the left integer is less than or equal to the right one. +Returns ``true`` if the left float is less than or equal to the right one. ---- @@ -328,7 +348,7 @@ Returns ``true`` if the ``float`` and the given :ref:`int` are equal. - :ref:`bool` **operator >** **(** :ref:`float` right **)** -Returns ``true`` the left float is greater than the right one. +Returns ``true`` if the left float is greater than the right one. ---- @@ -342,7 +362,7 @@ Returns ``true`` if this ``float`` is greater than the given :ref:`int` **operator >=** **(** :ref:`float` right **)** -Returns ``true`` the left float is greater than or equal to the right one. +Returns ``true`` if the left float is greater than or equal to the right one. ---- diff --git a/classes/class_flowcontainer.rst b/classes/class_flowcontainer.rst index 99153a4b8..a26dc9690 100644 --- a/classes/class_flowcontainer.rst +++ b/classes/class_flowcontainer.rst @@ -26,9 +26,11 @@ A line is filled with :ref:`Control` nodes until no more fit on t Properties ---------- -+-------------------------+--------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`vertical` | ``false`` | -+-------------------------+--------------------------------------------------------+-----------+ ++--------------------------------------------------------+----------------------------------------------------------+-----------+ +| :ref:`AlignmentMode` | :ref:`alignment` | ``0`` | ++--------------------------------------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`vertical` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------+-----------+ Methods ------- @@ -46,9 +48,44 @@ Theme Properties | :ref:`int` | :ref:`v_separation` | ``4`` | +-----------------------+----------------------------------------------------------------------+-------+ +Enumerations +------------ + +.. _enum_FlowContainer_AlignmentMode: + +.. _class_FlowContainer_constant_ALIGNMENT_BEGIN: + +.. _class_FlowContainer_constant_ALIGNMENT_CENTER: + +.. _class_FlowContainer_constant_ALIGNMENT_END: + +enum **AlignmentMode**: + +- **ALIGNMENT_BEGIN** = **0** --- The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). + +- **ALIGNMENT_CENTER** = **1** --- The child controls will be centered in the container. + +- **ALIGNMENT_END** = **2** --- The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). + Property Descriptions --------------------- +.. _class_FlowContainer_property_alignment: + +- :ref:`AlignmentMode` **alignment** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_alignment(value) | ++-----------+----------------------+ +| *Getter* | get_alignment() | ++-----------+----------------------+ + +The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN`, :ref:`ALIGNMENT_CENTER`, or :ref:`ALIGNMENT_END`). + +---- + .. _class_FlowContainer_property_vertical: - :ref:`bool` **vertical** diff --git a/classes/class_fogmaterial.rst b/classes/class_fogmaterial.rst index 78a26da79..7cd9c8d45 100644 --- a/classes/class_fogmaterial.rst +++ b/classes/class_fogmaterial.rst @@ -71,6 +71,8 @@ The single-scattering :ref:`Color` of the :ref:`FogVolume`. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other :ref:`FogVolume`\ s or global volumetric fog. +\ **Note:** Due to limited precision, :ref:`density` values between ``-0.001`` and ``0.001`` (exclusive) act like ``0.0``. This does not apply to :ref:`Environment.volumetric_fog_density`. + ---- .. _class_FogMaterial_property_density_texture: diff --git a/classes/class_fontfile.rst b/classes/class_fontfile.rst index b82219007..6cf80ac27 100644 --- a/classes/class_fontfile.rst +++ b/classes/class_fontfile.rst @@ -38,8 +38,6 @@ Supported font formats: \ **Note:** 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. - - .. tabs:: .. code-tab:: gdscript @@ -477,7 +475,7 @@ Font style name. | *Getter* | get_subpixel_positioning() | +-----------+---------------------------------+ -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 :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO` to automatically enable it based on the font size. +Font glyph subpixel 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 :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO` to automatically enable it based on the font size. Method Descriptions ------------------- @@ -716,7 +714,7 @@ Returns a copy of the font cache texture image. - :ref:`PackedInt32Array` **get_texture_offsets** **(** :ref:`int` cache_index, :ref:`Vector2i` size, :ref:`int` texture_index **)** |const| -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. +Returns a copy of the array containing glyph packing data. ---- @@ -956,7 +954,7 @@ Sets font cache texture image. - void **set_texture_offsets** **(** :ref:`int` cache_index, :ref:`Vector2i` size, :ref:`int` texture_index, :ref:`PackedInt32Array` offset **)** -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). +Sets array containing glyph packing data. ---- diff --git a/classes/class_fontvariation.rst b/classes/class_fontvariation.rst index 4e802df40..957ee54fd 100644 --- a/classes/class_fontvariation.rst +++ b/classes/class_fontvariation.rst @@ -19,8 +19,6 @@ Description OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing. - - To use simulated bold font variant: diff --git a/classes/class_gdscript.rst b/classes/class_gdscript.rst index 7e08a7330..03bfb5ad1 100644 --- a/classes/class_gdscript.rst +++ b/classes/class_gdscript.rst @@ -17,7 +17,7 @@ A script implemented in the GDScript programming language. Description ----------- -A script implemented in the GDScript programming language. The script extends the functionality of all objects that instance it. +A script implemented in the GDScript programming language. The script extends the functionality of all objects that instantiate it. \ :ref:`new` creates a new instance of the script. :ref:`Object.set_script` extends an existing object, if that object's class matches one of the script's base classes. diff --git a/classes/class_geometryinstance3d.rst b/classes/class_geometryinstance3d.rst index b424446a0..9bea58ecf 100644 --- a/classes/class_geometryinstance3d.rst +++ b/classes/class_geometryinstance3d.rst @@ -24,35 +24,35 @@ Base node for geometry-based visual instances. Shares some common functionality Properties ---------- -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`ShadowCastingSetting` | :ref:`cast_shadow` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`extra_cull_margin` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`LightmapScale` | :ref:`gi_lightmap_scale` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`GIMode` | :ref:`gi_mode` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`ignore_occlusion_culling` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`lod_bias` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`Material` | :ref:`material_overlay` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`Material` | :ref:`material_override` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`transparency` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`visibility_range_begin` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`visibility_range_begin_margin` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`visibility_range_end` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`visibility_range_end_margin` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ -| :ref:`VisibilityRangeFadeMode` | :ref:`visibility_range_fade_mode` | -+---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`ShadowCastingSetting` | :ref:`cast_shadow` | ``1`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`extra_cull_margin` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`LightmapScale` | :ref:`gi_lightmap_scale` | ``0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`GIMode` | :ref:`gi_mode` | ``1`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`ignore_occlusion_culling` | ``false`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`lod_bias` | ``1.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Material` | :ref:`material_overlay` | | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Material` | :ref:`material_override` | | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`transparency` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`visibility_range_begin` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`visibility_range_begin_margin` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`visibility_range_end` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`visibility_range_end_margin` | ``0.0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`VisibilityRangeFadeMode` | :ref:`visibility_range_fade_mode` | ``0`` | ++---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ Methods ------- @@ -163,11 +163,13 @@ Property Descriptions - :ref:`ShadowCastingSetting` **cast_shadow** -+----------+---------------------------------+ -| *Setter* | set_cast_shadows_setting(value) | -+----------+---------------------------------+ -| *Getter* | get_cast_shadows_setting() | -+----------+---------------------------------+ ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_cast_shadows_setting(value) | ++-----------+---------------------------------+ +| *Getter* | get_cast_shadows_setting() | ++-----------+---------------------------------+ The selected shadow casting flag. See :ref:`ShadowCastingSetting` for possible values. @@ -177,11 +179,13 @@ The selected shadow casting flag. See :ref:`ShadowCastingSetting` **extra_cull_margin** -+----------+------------------------------+ -| *Setter* | set_extra_cull_margin(value) | -+----------+------------------------------+ -| *Getter* | get_extra_cull_margin() | -+----------+------------------------------+ ++-----------+------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------+ +| *Setter* | set_extra_cull_margin(value) | ++-----------+------------------------------+ +| *Getter* | get_extra_cull_margin() | ++-----------+------------------------------+ The extra distance added to the GeometryInstance3D's bounding box (:ref:`AABB`) to increase its cull box. @@ -191,11 +195,13 @@ The extra distance added to the GeometryInstance3D's bounding box (:ref:`AABB` **gi_lightmap_scale** -+----------+---------------------------+ -| *Setter* | set_lightmap_scale(value) | -+----------+---------------------------+ -| *Getter* | get_lightmap_scale() | -+----------+---------------------------+ ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_lightmap_scale(value) | ++-----------+---------------------------+ +| *Getter* | get_lightmap_scale() | ++-----------+---------------------------+ The texel density to use for lightmapping in :ref:`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. @@ -205,11 +211,13 @@ The texel density to use for lightmapping in :ref:`LightmapGI` - :ref:`GIMode` **gi_mode** -+----------+--------------------+ -| *Setter* | set_gi_mode(value) | -+----------+--------------------+ -| *Getter* | get_gi_mode() | -+----------+--------------------+ ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_gi_mode(value) | ++-----------+--------------------+ +| *Getter* | get_gi_mode() | ++-----------+--------------------+ 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). @@ -221,11 +229,13 @@ The global illumination mode to use for the whole geometry. To avoid inconsisten - :ref:`bool` **ignore_occlusion_culling** -+----------+-------------------------------------+ -| *Setter* | set_ignore_occlusion_culling(value) | -+----------+-------------------------------------+ -| *Getter* | is_ignoring_occlusion_culling() | -+----------+-------------------------------------+ ++-----------+-------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------+ +| *Setter* | set_ignore_occlusion_culling(value) | ++-----------+-------------------------------------+ +| *Getter* | is_ignoring_occlusion_culling() | ++-----------+-------------------------------------+ ---- @@ -233,11 +243,13 @@ The global illumination mode to use for the whole geometry. To avoid inconsisten - :ref:`float` **lod_bias** -+----------+---------------------+ -| *Setter* | set_lod_bias(value) | -+----------+---------------------+ -| *Getter* | get_lod_bias() | -+----------+---------------------+ ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_lod_bias(value) | ++-----------+---------------------+ +| *Getter* | get_lod_bias() | ++-----------+---------------------+ ---- @@ -277,11 +289,13 @@ If a material is assigned to this property, it will be used instead of any mater - :ref:`float` **transparency** -+----------+-------------------------+ -| *Setter* | set_transparency(value) | -+----------+-------------------------+ -| *Getter* | get_transparency() | -+----------+-------------------------+ ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_transparency(value) | ++-----------+-------------------------+ +| *Getter* | get_transparency() | ++-----------+-------------------------+ The transparency applied to the whole geometry (as a multiplier of the materials' existing transparency). ``0.0`` is fully opaque, while ``1.0`` is fully transparent. Values greater than ``0.0`` (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 :ref:`transparency` to a value greater than ``0.0`` (exclusive) will *not* disable shadow rendering. @@ -295,11 +309,13 @@ In spatial shaders, ``1.0 - transparency`` is set as the default value of the `` - :ref:`float` **visibility_range_begin** -+----------+-----------------------------------+ -| *Setter* | set_visibility_range_begin(value) | -+----------+-----------------------------------+ -| *Getter* | get_visibility_range_begin() | -+----------+-----------------------------------+ ++-----------+-----------------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_visibility_range_begin(value) | ++-----------+-----------------------------------+ +| *Getter* | get_visibility_range_begin() | ++-----------+-----------------------------------+ Starting distance from which the GeometryInstance3D will be visible, taking :ref:`visibility_range_begin_margin` into account as well. The default value of 0 is used to disable the range check. @@ -309,11 +325,13 @@ Starting distance from which the GeometryInstance3D will be visible, taking :ref - :ref:`float` **visibility_range_begin_margin** -+----------+------------------------------------------+ -| *Setter* | set_visibility_range_begin_margin(value) | -+----------+------------------------------------------+ -| *Getter* | get_visibility_range_begin_margin() | -+----------+------------------------------------------+ ++-----------+------------------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------------------+ +| *Setter* | set_visibility_range_begin_margin(value) | ++-----------+------------------------------------------+ +| *Getter* | get_visibility_range_begin_margin() | ++-----------+------------------------------------------+ Margin for the :ref:`visibility_range_begin` threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the :ref:`visibility_range_begin` threshold by this amount. @@ -325,11 +343,13 @@ If :ref:`visibility_range_fade_mode` **visibility_range_end** -+----------+---------------------------------+ -| *Setter* | set_visibility_range_end(value) | -+----------+---------------------------------+ -| *Getter* | get_visibility_range_end() | -+----------+---------------------------------+ ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Setter* | set_visibility_range_end(value) | ++-----------+---------------------------------+ +| *Getter* | get_visibility_range_end() | ++-----------+---------------------------------+ Distance from which the GeometryInstance3D will be hidden, taking :ref:`visibility_range_end_margin` into account as well. The default value of 0 is used to disable the range check. @@ -339,11 +359,13 @@ Distance from which the GeometryInstance3D will be hidden, taking :ref:`visibili - :ref:`float` **visibility_range_end_margin** -+----------+----------------------------------------+ -| *Setter* | set_visibility_range_end_margin(value) | -+----------+----------------------------------------+ -| *Getter* | get_visibility_range_end_margin() | -+----------+----------------------------------------+ ++-----------+----------------------------------------+ +| *Default* | ``0.0`` | ++-----------+----------------------------------------+ +| *Setter* | set_visibility_range_end_margin(value) | ++-----------+----------------------------------------+ +| *Getter* | get_visibility_range_end_margin() | ++-----------+----------------------------------------+ Margin for the :ref:`visibility_range_end` threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the :ref:`visibility_range_end` threshold by this amount. @@ -355,11 +377,13 @@ If :ref:`visibility_range_fade_mode` **visibility_range_fade_mode** -+----------+---------------------------------------+ -| *Setter* | set_visibility_range_fade_mode(value) | -+----------+---------------------------------------+ -| *Getter* | get_visibility_range_fade_mode() | -+----------+---------------------------------------+ ++-----------+---------------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------------+ +| *Setter* | set_visibility_range_fade_mode(value) | ++-----------+---------------------------------------+ +| *Getter* | get_visibility_range_fade_mode() | ++-----------+---------------------------------------+ Controls which instances will be faded when approaching the limits of the visibility range. See :ref:`VisibilityRangeFadeMode` for possible values. diff --git a/classes/class_gltfnode.rst b/classes/class_gltfnode.rst index 78bd7f4e0..c04187969 100644 --- a/classes/class_gltfnode.rst +++ b/classes/class_gltfnode.rst @@ -55,6 +55,15 @@ Properties | :ref:`Transform3D` | :ref:`xform` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` | +-------------------------------------------------+---------------------------------------------------+-----------------------------------------------------+ +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_additional_data` **(** :ref:`StringName` extension_name **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_additional_data` **(** :ref:`StringName` extension_name, :ref:`Variant` additional_data **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + Property Descriptions --------------------- @@ -238,6 +247,27 @@ Property Descriptions | *Getter* | get_xform() | +-----------+-----------------------------------------------------+ +Method Descriptions +------------------- + +.. _class_GLTFNode_method_get_additional_data: + +- :ref:`Variant` **get_additional_data** **(** :ref:`StringName` extension_name **)** + +Gets additional arbitrary data in this ``GLTFNode`` instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. + +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. + +---- + +.. _class_GLTFNode_method_set_additional_data: + +- void **set_additional_data** **(** :ref:`StringName` extension_name, :ref:`Variant` additional_data **)** + +Sets additional arbitrary data in this ``GLTFNode`` instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. + +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_gltfstate.rst b/classes/class_gltfstate.rst index 52fe48942..df139e163 100644 --- a/classes/class_gltfstate.rst +++ b/classes/class_gltfstate.rst @@ -42,79 +42,83 @@ Properties Methods ------- -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_used_extension` **(** :ref:`String` extension_name, :ref:`bool` required **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFAccessor[]` | :ref:`get_accessors` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationPlayer` | :ref:`get_animation_player` **(** :ref:`int` idx **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_animation_players_count` **(** :ref:`int` idx **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFAnimation[]` | :ref:`get_animations` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFBufferView[]` | :ref:`get_buffer_views` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFCamera[]` | :ref:`get_cameras` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Texture2D[]` | :ref:`get_images` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFLight[]` | :ref:`get_lights` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`BaseMaterial3D[]` | :ref:`get_materials` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFMesh[]` | :ref:`get_meshes` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFNode[]` | :ref:`get_nodes` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Node` | :ref:`get_scene_node` **(** :ref:`int` idx **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_skeleton_to_node` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFSkeleton[]` | :ref:`get_skeletons` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFSkin[]` | :ref:`get_skins` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFTextureSampler[]` | :ref:`get_texture_samplers` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GLTFTexture[]` | :ref:`get_textures` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String[]` | :ref:`get_unique_animation_names` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String[]` | :ref:`get_unique_names` **(** **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_accessors` **(** :ref:`GLTFAccessor[]` accessors **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_animations` **(** :ref:`GLTFAnimation[]` animations **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_buffer_views` **(** :ref:`GLTFBufferView[]` buffer_views **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_cameras` **(** :ref:`GLTFCamera[]` cameras **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_images` **(** :ref:`Texture2D[]` images **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_lights` **(** :ref:`GLTFLight[]` lights **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_materials` **(** :ref:`BaseMaterial3D[]` materials **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_meshes` **(** :ref:`GLTFMesh[]` meshes **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_nodes` **(** :ref:`GLTFNode[]` nodes **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_skeleton_to_node` **(** :ref:`Dictionary` skeleton_to_node **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_skeletons` **(** :ref:`GLTFSkeleton[]` skeletons **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_skins` **(** :ref:`GLTFSkin[]` skins **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_texture_samplers` **(** :ref:`GLTFTextureSampler[]` texture_samplers **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_textures` **(** :ref:`GLTFTexture[]` textures **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_unique_animation_names` **(** :ref:`String[]` unique_animation_names **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_unique_names` **(** :ref:`String[]` unique_names **)** | -+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_used_extension` **(** :ref:`String` extension_name, :ref:`bool` required **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFAccessor[]` | :ref:`get_accessors` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_additional_data` **(** :ref:`StringName` extension_name **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationPlayer` | :ref:`get_animation_player` **(** :ref:`int` idx **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_animation_players_count` **(** :ref:`int` idx **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFAnimation[]` | :ref:`get_animations` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFBufferView[]` | :ref:`get_buffer_views` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFCamera[]` | :ref:`get_cameras` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture2D[]` | :ref:`get_images` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFLight[]` | :ref:`get_lights` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BaseMaterial3D[]` | :ref:`get_materials` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFMesh[]` | :ref:`get_meshes` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFNode[]` | :ref:`get_nodes` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_scene_node` **(** :ref:`int` idx **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_skeleton_to_node` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFSkeleton[]` | :ref:`get_skeletons` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFSkin[]` | :ref:`get_skins` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFTextureSampler[]` | :ref:`get_texture_samplers` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GLTFTexture[]` | :ref:`get_textures` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String[]` | :ref:`get_unique_animation_names` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String[]` | :ref:`get_unique_names` **(** **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_accessors` **(** :ref:`GLTFAccessor[]` accessors **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_additional_data` **(** :ref:`StringName` extension_name, :ref:`Variant` additional_data **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_animations` **(** :ref:`GLTFAnimation[]` animations **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_buffer_views` **(** :ref:`GLTFBufferView[]` buffer_views **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cameras` **(** :ref:`GLTFCamera[]` cameras **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_images` **(** :ref:`Texture2D[]` images **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_lights` **(** :ref:`GLTFLight[]` lights **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_materials` **(** :ref:`BaseMaterial3D[]` materials **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_meshes` **(** :ref:`GLTFMesh[]` meshes **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_nodes` **(** :ref:`GLTFNode[]` nodes **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skeleton_to_node` **(** :ref:`Dictionary` skeleton_to_node **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skeletons` **(** :ref:`GLTFSkeleton[]` skeletons **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skins` **(** :ref:`GLTFSkin[]` skins **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_texture_samplers` **(** :ref:`GLTFTextureSampler[]` texture_samplers **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_textures` **(** :ref:`GLTFTexture[]` textures **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_unique_animation_names` **(** :ref:`String[]` unique_animation_names **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_unique_names` **(** :ref:`String[]` unique_names **)** | ++-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -274,6 +278,16 @@ Appends an extension to the list of extensions used by this GLTF file during ser ---- +.. _class_GLTFState_method_get_additional_data: + +- :ref:`Variant` **get_additional_data** **(** :ref:`StringName` extension_name **)** + +Gets additional arbitrary data in this ``GLTFState`` instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. + +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. + +---- + .. _class_GLTFState_method_get_animation_player: - :ref:`AnimationPlayer` **get_animation_player** **(** :ref:`int` idx **)** @@ -390,6 +404,16 @@ Retrieves the array of texture samplers that are used by the textures contained ---- +.. _class_GLTFState_method_set_additional_data: + +- void **set_additional_data** **(** :ref:`StringName` extension_name, :ref:`Variant` additional_data **)** + +Sets additional arbitrary data in this ``GLTFState`` instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. + +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. + +---- + .. _class_GLTFState_method_set_animations: - void **set_animations** **(** :ref:`GLTFAnimation[]` animations **)** diff --git a/classes/class_gpuparticles2d.rst b/classes/class_gpuparticles2d.rst index 4dbd12999..ff93c319d 100644 --- a/classes/class_gpuparticles2d.rst +++ b/classes/class_gpuparticles2d.rst @@ -26,7 +26,9 @@ Tutorials - :doc:`Particle systems (2D) <../tutorials/2d/particle_systems_2d>` -- `2D Dodge The Creeps Demo `__ +- `2D Particles Demo `__ + +- `2D Dodge The Creeps Demo (uses GPUParticles2D for the trail behind the player) `__ Properties ---------- @@ -226,7 +228,7 @@ How rapidly particles in an emission cycle are emitted. If greater than ``0``, t | *Getter* | get_fixed_fps() | +-----------+----------------------+ -The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. +The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. ---- diff --git a/classes/class_gpuparticles3d.rst b/classes/class_gpuparticles3d.rst index 8efcdb9eb..0a3c92a94 100644 --- a/classes/class_gpuparticles3d.rst +++ b/classes/class_gpuparticles3d.rst @@ -355,7 +355,7 @@ Time ratio between each emission. If ``0``, particles are emitted continuously. | *Getter* | get_fixed_fps() | +-----------+----------------------+ -The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. +The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. ---- diff --git a/classes/class_httprequest.rst b/classes/class_httprequest.rst index ea542f180..f1fa35f23 100644 --- a/classes/class_httprequest.rst +++ b/classes/class_httprequest.rst @@ -51,7 +51,6 @@ Can be used to make HTTP requests, i.e. download or upload files or web content if error != OK: push_error("An error occurred in the HTTP request.") - # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): var json = JSON.new() @@ -122,7 +121,6 @@ Can be used to make HTTP requests, i.e. download or upload files or web content if error != OK: push_error("An error occurred in the HTTP request.") - # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): if result != HTTPRequest.RESULT_SUCCESS: diff --git a/classes/class_image.rst b/classes/class_image.rst index a98f4e86b..c12214c0b 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -38,135 +38,137 @@ Properties Methods ------- -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`adjust_bcs` **(** :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`blend_rect` **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`blend_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`blit_rect` **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`blit_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`bump_map_to_normal_map` **(** :ref:`float` bump_scale=1.0 **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_mipmaps` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`compress` **(** :ref:`CompressMode` mode, :ref:`CompressSource` source=0, :ref:`float` lossy_quality=0.7 **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`compress_from_channels` **(** :ref:`CompressMode` mode, :ref:`UsedChannels` channels, :ref:`float` lossy_quality=0.7 **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`compute_image_metrics` **(** :ref:`Image` compared_image, :ref:`bool` use_luma **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`convert` **(** :ref:`Format` format **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`copy_from` **(** :ref:`Image` src **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`create_from_data` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`crop` **(** :ref:`int` width, :ref:`int` height **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`decompress` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AlphaMode` | :ref:`detect_alpha` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`UsedChannels` | :ref:`detect_used_channels` **(** :ref:`CompressSource` source=0 **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`fill` **(** :ref:`Color` color **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`fill_rect` **(** :ref:`Rect2i` rect, :ref:`Color` color **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`fix_alpha_edges` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`flip_x` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`flip_y` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`generate_mipmaps` **(** :ref:`bool` renormalize=false **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`get_data` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Format` | :ref:`get_format` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_height` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_mipmap_offset` **(** :ref:`int` mipmap **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_pixel` **(** :ref:`int` x, :ref:`int` y **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`get_pixelv` **(** :ref:`Vector2i` point **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Image` | :ref:`get_rect` **(** :ref:`Rect2i` rect **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2i` | :ref:`get_size` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Rect2i` | :ref:`get_used_rect` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_width` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_mipmaps` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_compressed` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_invisible` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_bmp_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Image` | :ref:`load_from_file` **(** :ref:`String` path **)** |static| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_jpg_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_png_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_tga_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`load_webp_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`normal_map_to_xy` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`premultiply_alpha` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`resize` **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`resize_to_po2` **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Image` | :ref:`rgbe_to_srgb` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`rotate_180` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`rotate_90` **(** :ref:`ClockDirection` direction **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_exr` **(** :ref:`String` path, :ref:`bool` grayscale=false **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`save_exr_to_buffer` **(** :ref:`bool` grayscale=false **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_jpg` **(** :ref:`String` path, :ref:`float` quality=0.75 **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`save_jpg_to_buffer` **(** :ref:`float` quality=0.75 **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_png` **(** :ref:`String` path **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`save_png_to_buffer` **(** **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`save_webp` **(** :ref:`String` path, :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`save_webp_to_buffer` **(** :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_pixel` **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_pixelv` **(** :ref:`Vector2i` point, :ref:`Color` color **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`shrink_x2` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`srgb_to_linear` **(** **)** | -+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`adjust_bcs` **(** :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_rect` **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blit_rect` **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blit_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bump_map_to_normal_map` **(** :ref:`float` bump_scale=1.0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_mipmaps` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`compress` **(** :ref:`CompressMode` mode, :ref:`CompressSource` source=0, :ref:`float` lossy_quality=0.7 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`compress_from_channels` **(** :ref:`CompressMode` mode, :ref:`UsedChannels` channels, :ref:`float` lossy_quality=0.7 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`compute_image_metrics` **(** :ref:`Image` compared_image, :ref:`bool` use_luma **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`convert` **(** :ref:`Format` format **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_from` **(** :ref:`Image` src **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** |static| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`create_from_data` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** |static| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`crop` **(** :ref:`int` width, :ref:`int` height **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`decompress` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AlphaMode` | :ref:`detect_alpha` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UsedChannels` | :ref:`detect_used_channels` **(** :ref:`CompressSource` source=0 **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fill` **(** :ref:`Color` color **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fill_rect` **(** :ref:`Rect2i` rect, :ref:`Color` color **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fix_alpha_edges` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flip_x` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flip_y` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`generate_mipmaps` **(** :ref:`bool` renormalize=false **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`get_data` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Format` | :ref:`get_format` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_height` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_mipmap_offset` **(** :ref:`int` mipmap **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_pixel` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_pixelv` **(** :ref:`Vector2i` point **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_region` **(** :ref:`Rect2i` region **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2i` | :ref:`get_size` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2i` | :ref:`get_used_rect` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_width` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_mipmaps` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_compressed` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_invisible` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_bmp_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`load_from_file` **(** :ref:`String` path **)** |static| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_jpg_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_png_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_tga_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_webp_from_buffer` **(** :ref:`PackedByteArray` buffer **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`normal_map_to_xy` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`premultiply_alpha` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize_to_po2` **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`rgbe_to_srgb` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_180` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_90` **(** :ref:`ClockDirection` direction **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_exr` **(** :ref:`String` path, :ref:`bool` grayscale=false **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`save_exr_to_buffer` **(** :ref:`bool` grayscale=false **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_jpg` **(** :ref:`String` path, :ref:`float` quality=0.75 **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`save_jpg_to_buffer` **(** :ref:`float` quality=0.75 **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_png` **(** :ref:`String` path **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`save_png_to_buffer` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_webp` **(** :ref:`String` path, :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`save_webp_to_buffer` **(** :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_data` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_pixel` **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_pixelv` **(** :ref:`Vector2i` point, :ref:`Color` color **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shrink_x2` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`srgb_to_linear` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ @@ -496,7 +498,7 @@ Method Descriptions - void **blend_rect** **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** -Alpha-blends ``src_rect`` from ``src`` image to this image at coordinates ``dst``, clipped accordingly to both image bounds. This image and ``src`` image **must** have the same format. ``src_rect`` with not positive size is treated as empty. +Alpha-blends ``src_rect`` from ``src`` image to this image at coordinates ``dst``, clipped accordingly to both image bounds. This image and ``src`` image **must** have the same format. ``src_rect`` with non-positive size is treated as empty. ---- @@ -504,7 +506,7 @@ Alpha-blends ``src_rect`` from ``src`` image to this image at coordinates ``dst` - void **blend_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** -Alpha-blends ``src_rect`` from ``src`` image to this image using ``mask`` image at coordinates ``dst``, clipped accordingly to both image bounds. Alpha channels are required for both ``src`` and ``mask``. ``dst`` pixels and ``src`` pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with not positive size is treated as empty. +Alpha-blends ``src_rect`` from ``src`` image to this image using ``mask`` image at coordinates ``dst``, clipped accordingly to both image bounds. Alpha channels are required for both ``src`` and ``mask``. ``dst`` pixels and ``src`` pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with non-positive size is treated as empty. ---- @@ -512,7 +514,7 @@ Alpha-blends ``src_rect`` from ``src`` image to this image using ``mask`` image - void **blit_rect** **(** :ref:`Image` src, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** -Copies ``src_rect`` from ``src`` image to this image at coordinates ``dst``, clipped accordingly to both image bounds. This image and ``src`` image **must** have the same format. ``src_rect`` with not positive size is treated as empty. +Copies ``src_rect`` from ``src`` image to this image at coordinates ``dst``, clipped accordingly to both image bounds. This image and ``src`` image **must** have the same format. ``src_rect`` with non-positive size is treated as empty. ---- @@ -520,7 +522,7 @@ Copies ``src_rect`` from ``src`` image to this image at coordinates ``dst``, cli - void **blit_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2i` src_rect, :ref:`Vector2i` dst **)** -Blits ``src_rect`` area from ``src`` image to this image at the coordinates given by ``dst``, clipped accordingly to both image bounds. ``src`` pixel is copied onto ``dst`` if the corresponding ``mask`` pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with not positive size is treated as empty. +Blits ``src_rect`` area from ``src`` image to this image at the coordinates given by ``dst``, clipped accordingly to both image bounds. ``src`` pixel is copied onto ``dst`` if the corresponding ``mask`` pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with non-positive size is treated as empty. ---- @@ -582,7 +584,7 @@ Copies ``src`` image to this image. .. _class_Image_method_create: -- void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** +- :ref:`Image` **create** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** |static| Creates an empty image of given size and format. See :ref:`Format` constants. If ``use_mipmaps`` is ``true`` then generate mipmaps for this image. See the :ref:`generate_mipmaps`. @@ -590,7 +592,7 @@ Creates an empty image of given size and format. See :ref:`Format` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** +- :ref:`Image` **create_from_data** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** |static| Creates a new image of given size and format. See :ref:`Format` constants. Fills the image with the given raw data. If ``use_mipmaps`` is ``true`` then loads mipmaps for this image from ``data``. See :ref:`generate_mipmaps`. @@ -728,11 +730,11 @@ This is the same as :ref:`get_pixel`, but with a : ---- -.. _class_Image_method_get_rect: +.. _class_Image_method_get_region: -- :ref:`Image` **get_rect** **(** :ref:`Rect2i` rect **)** |const| +- :ref:`Image` **get_region** **(** :ref:`Rect2i` region **)** |const| -Returns a new image that is a copy of the image's area specified with ``rect``. +Returns a new ``Image`` that is a copy of this ``Image``'s area specified with ``region``. ---- @@ -982,11 +984,21 @@ Saves the image as a WebP (Web Picture) file to a byte array. By default it will ---- +.. _class_Image_method_set_data: + +- void **set_data** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PackedByteArray` data **)** + +Overwrites data of an existing ``Image``. Non-static equivalent of :ref:`create_from_data`. + +---- + .. _class_Image_method_set_pixel: - void **set_pixel** **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color **)** -Sets the :ref:`Color` of the pixel at ``(x, y)`` to ``color``. Example: +Sets the :ref:`Color` of the pixel at ``(x, y)`` to ``color``. + +\ **Example:**\ .. tabs:: @@ -1019,7 +1031,9 @@ This is the same as :ref:`set_pixelv`, but with a - void **set_pixelv** **(** :ref:`Vector2i` point, :ref:`Color` color **)** -Sets the :ref:`Color` of the pixel at ``point`` to ``color``. Example: +Sets the :ref:`Color` of the pixel at ``point`` to ``color``. + +\ **Example:**\ .. tabs:: diff --git a/classes/class_importermesh.rst b/classes/class_importermesh.rst index 19baaac9e..26118556f 100644 --- a/classes/class_importermesh.rst +++ b/classes/class_importermesh.rst @@ -19,8 +19,6 @@ Description ImporterMesh is a type of :ref:`Resource` analogous to :ref:`ArrayMesh`. It contains vertex array-based geometry, divided in *surfaces*. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. - - Unlike its runtime counterpart, ``ImporterMesh`` contains mesh data before various import steps, such as lod and shadow mesh generation, have taken place. Modify surface data by calling :ref:`clear`, followed by :ref:`add_surface` for each surface. Properties diff --git a/classes/class_input.rst b/classes/class_input.rst index 8d3dcc4f2..7fc495fde 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -454,7 +454,7 @@ Returns the magnetic field strength in micro-Tesla for all axes of the device's - :ref:`MouseButton` **get_mouse_button_mask** **(** **)** |const| -Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. +Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to :ref:`DisplayServer.mouse_get_button_state`. ---- @@ -568,7 +568,7 @@ Returns ``true`` if you are pressing the key in the physical location on the 101 Feeds an :ref:`InputEvent` to the game. Can be used to artificially trigger input events from code. Also generates :ref:`Node._input` calls. -Example: +\ **Example:**\ .. tabs:: @@ -707,7 +707,7 @@ Vibrate handheld devices. 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 :ref:`MouseMode` is set to ``MOUSE_MODE_CONFINED`` or ``MOUSE_MODE_CONFINED_HIDDEN``. +Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if :ref:`MouseMode` is set to :ref:`MOUSE_MODE_CONFINED` or :ref:`MOUSE_MODE_CONFINED_HIDDEN`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_inputeventmidi.rst b/classes/class_inputeventmidi.rst index 9bb4c7bbc..275f6a5b8 100644 --- a/classes/class_inputeventmidi.rst +++ b/classes/class_inputeventmidi.rst @@ -141,7 +141,7 @@ The MIDI channel of this input event. There are 16 channels, so this value range | *Getter* | get_controller_number() | +-----------+------------------------------+ -If the message is ``MIDI_MESSAGE_CONTROL_CHANGE``, this indicates the controller number, otherwise this is zero. Controllers include devices such as pedals and levers. +If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, this indicates the controller number, otherwise this is zero. Controllers include devices such as pedals and levers. ---- @@ -157,7 +157,7 @@ If the message is ``MIDI_MESSAGE_CONTROL_CHANGE``, this indicates the controller | *Getter* | get_controller_value() | +-----------+-----------------------------+ -If the message is ``MIDI_MESSAGE_CONTROL_CHANGE``, this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers. +If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers. ---- @@ -193,7 +193,7 @@ Returns a value indicating the type of message for this MIDI signal. This is a m For MIDI messages between 0x80 and 0xEF, only the left half of the bits are returned as this value, as the other part is the channel (ex: 0x94 becomes 0x9). For MIDI messages from 0xF0 to 0xFF, the value is returned as-is. -Notes will return ``MIDI_MESSAGE_NOTE_ON`` when activated, but they might not always return ``MIDI_MESSAGE_NOTE_OFF`` when deactivated, therefore your code should treat the input as stopped if some period of time has passed. +Notes will return :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` when activated, but they might not always return :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF` when deactivated, therefore your code should treat the input as stopped if some period of time has passed. For more information, see the MIDI message status byte list chart linked above. @@ -243,7 +243,7 @@ The pressure of the MIDI signal. This value ranges from 0 to 127. For many devic | *Getter* | get_velocity() | +-----------+---------------------+ -The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. +The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. Note that some MIDI devices may send a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` message with zero velocity and expect this to be treated the same as a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF` message, but device implementations vary so Godot reports event data exactly as received. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_inputeventscreentouch.rst b/classes/class_inputeventscreentouch.rst index 7de58c6f1..b9f2738b1 100644 --- a/classes/class_inputeventscreentouch.rst +++ b/classes/class_inputeventscreentouch.rst @@ -29,17 +29,35 @@ Tutorials Properties ---------- -+-------------------------------+----------------------------------------------------------------+-------------------+ -| :ref:`int` | :ref:`index` | ``0`` | -+-------------------------------+----------------------------------------------------------------+-------------------+ -| :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | -+-------------------------------+----------------------------------------------------------------+-------------------+ -| :ref:`bool` | :ref:`pressed` | ``false`` | -+-------------------------------+----------------------------------------------------------------+-------------------+ ++-------------------------------+--------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`double_tap` | ``false`` | ++-------------------------------+--------------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`index` | ``0`` | ++-------------------------------+--------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | ++-------------------------------+--------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++-------------------------------+--------------------------------------------------------------------+-------------------+ Property Descriptions --------------------- +.. _class_InputEventScreenTouch_property_double_tap: + +- :ref:`bool` **double_tap** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_double_tap(value) | ++-----------+-----------------------+ +| *Getter* | is_double_tap() | ++-----------+-----------------------+ + +If ``true``, the touch's state is a double tap. + +---- + .. _class_InputEventScreenTouch_property_index: - :ref:`int` **index** diff --git a/classes/class_int.rst b/classes/class_int.rst index 8f106da5d..c26c599e6 100644 --- a/classes/class_int.rst +++ b/classes/class_int.rst @@ -103,8 +103,6 @@ Operators +-------------------------------------+------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`operator **` **(** :ref:`int` right **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`operator +` **(** :ref:`String` right **)** | -+-------------------------------------+------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`operator +` **(** :ref:`float` right **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`operator +` **(** :ref:`int` right **)** | @@ -186,13 +184,13 @@ Operator Descriptions - :ref:`bool` **operator !=** **(** :ref:`float` right **)** -Returns ``true`` if operands are different from each other. +Returns ``true`` if this ``int`` is not equivalent to the given :ref:`float`. ---- - :ref:`bool` **operator !=** **(** :ref:`int` right **)** -Returns ``true`` if operands are different from each other. +Returns ``true`` if the integers are not equal. ---- @@ -276,10 +274,14 @@ Multiplies each component of the :ref:`Vector3i` by the given `` - :ref:`Vector4` **operator *** **(** :ref:`Vector4` right **)** +Multiplies each component of the :ref:`Vector4` by the given ``int``. + ---- - :ref:`Vector4i` **operator *** **(** :ref:`Vector4i` right **)** +Multiplies each component of the :ref:`Vector4i` by the given ``int``. + ---- - :ref:`float` **operator *** **(** :ref:`float` right **)** @@ -298,20 +300,26 @@ Multiplies two ``int``\ s. - :ref:`float` **operator **** **(** :ref:`float` right **)** +Raises an ``int`` to a power of a :ref:`float`. The result is a :ref:`float`. + +:: + + print(8**0.25) # 1.68179283050743 + ---- - :ref:`int` **operator **** **(** :ref:`int` right **)** ----- +Raises an ``int`` to a power of a ``int``. -.. _class_int_operator_sum_String: +:: -- :ref:`String` **operator +** **(** :ref:`String` right **)** - -Adds Unicode character with code ``int`` to the :ref:`String`. + print(5**5) # 3125 ---- +.. _class_int_operator_sum_float: + - :ref:`float` **operator +** **(** :ref:`float` right **)** Adds an ``int`` and a :ref:`float`. The result is a :ref:`float`. @@ -371,7 +379,7 @@ Returns ``true`` if this ``int`` is less than the given :ref:`float - :ref:`bool` **operator <** **(** :ref:`int` right **)** -Returns ``true`` the left integer is less than the right one. +Returns ``true`` if the left integer is less than the right one. ---- @@ -398,7 +406,7 @@ Returns ``true`` if this ``int`` is less than or equal to the given :ref:`float< - :ref:`bool` **operator <=** **(** :ref:`int` right **)** -Returns ``true`` the left integer is less than or equal to the right one. +Returns ``true`` if the left integer is less than or equal to the right one. ---- @@ -426,7 +434,7 @@ Returns ``true`` if this ``int`` is greater than the given :ref:`float` **operator >** **(** :ref:`int` right **)** -Returns ``true`` the left integer is greater than the right one. +Returns ``true`` if the left integer is greater than the right one. ---- @@ -440,7 +448,7 @@ Returns ``true`` if this ``int`` is greater than or equal to the given :ref:`flo - :ref:`bool` **operator >=** **(** :ref:`int` right **)** -Returns ``true`` the left integer is greater than or equal to the right one. +Returns ``true`` if the left integer is greater than or equal to the right one. ---- diff --git a/classes/class_javascriptobject.rst b/classes/class_javascriptobject.rst index a5335a8c9..9eda2a001 100644 --- a/classes/class_javascriptobject.rst +++ b/classes/class_javascriptobject.rst @@ -19,7 +19,7 @@ Description JavaScriptObject is used to interact with JavaScript objects retrieved or created via :ref:`JavaScriptBridge.get_interface`, :ref:`JavaScriptBridge.create_object`, or :ref:`JavaScriptBridge.create_callback`. -Example: +\ **Example:**\ :: diff --git a/classes/class_json.rst b/classes/class_json.rst index fccc75c40..fc5ce6cf4 100644 --- a/classes/class_json.rst +++ b/classes/class_json.rst @@ -122,7 +122,7 @@ Returns an empty string if the last call to :ref:`parse Attempts to parse the ``json_string`` provided. -Returns an :ref:`Error`. If the parse was successful, it returns ``OK`` and the result can be retrieved using :ref:`data`. If unsuccessful, use :ref:`get_error_line` and :ref:`get_error_message` for identifying the source of the failure. +Returns an :ref:`Error`. If the parse was successful, it returns :ref:`@GlobalScope.OK` and the result can be retrieved using :ref:`data`. If unsuccessful, use :ref:`get_error_line` and :ref:`get_error_message` for identifying the source of the failure. Non-static variant of :ref:`parse_string`, if you want custom error handling. diff --git a/classes/class_label3d.rst b/classes/class_label3d.rst index 651efb38b..f04e94af3 100644 --- a/classes/class_label3d.rst +++ b/classes/class_label3d.rst @@ -22,63 +22,67 @@ Label3D displays plain text in a 3D world. It gives you control over the horizon Properties ---------- -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`alpha_scissor_threshold` | ``0.5`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`AutowrapMode` | :ref:`autowrap_mode` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`double_sided` | ``true`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`fixed_size` | ``false`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Font` | :ref:`font` | | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`font_size` | ``32`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`HorizontalAlignment` | :ref:`horizontal_alignment` | ``1`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`String` | :ref:`language` | ``""`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`line_spacing` | ``0.0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`modulate` | ``Color(1, 1, 1, 1)`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`no_depth_test` | ``false`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`outline_modulate` | ``Color(0, 0, 0, 1)`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`outline_render_priority` | ``-1`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`outline_size` | ``12`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`pixel_size` | ``0.005`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`render_priority` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`shaded` | ``false`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`StructuredTextParser` | :ref:`structured_text_bidi_override` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Array` | :ref:`structured_text_bidi_override_options` | ``[]`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`String` | :ref:`text` | ``""`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Direction` | :ref:`text_direction` | ``0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`TextureFilter` | :ref:`texture_filter` | ``3`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`uppercase` | ``false`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`VerticalAlignment` | :ref:`vertical_alignment` | ``1`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`width` | ``500.0`` | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------+ ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`alpha_scissor_threshold` | ``0.5`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`AutowrapMode` | :ref:`autowrap_mode` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`ShadowCastingSetting` | cast_shadow | ``0`` (overrides :ref:`GeometryInstance3D`) | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`double_sided` | ``true`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`fixed_size` | ``false`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`font_size` | ``32`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`GIMode` | gi_mode | ``0`` (overrides :ref:`GeometryInstance3D`) | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`HorizontalAlignment` | :ref:`horizontal_alignment` | ``1`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`language` | ``""`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`line_spacing` | ``0.0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color(1, 1, 1, 1)`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`no_depth_test` | ``false`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`outline_modulate` | ``Color(0, 0, 0, 1)`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`outline_render_priority` | ``-1`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`outline_size` | ``12`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`pixel_size` | ``0.005`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`render_priority` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`shaded` | ``false`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`StructuredTextParser` | :ref:`structured_text_bidi_override` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`structured_text_bidi_override_options` | ``[]`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`Direction` | :ref:`text_direction` | ``0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`TextureFilter` | :ref:`texture_filter` | ``3`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`uppercase` | ``false`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`VerticalAlignment` | :ref:`vertical_alignment` | ``1`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`width` | ``500.0`` | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ Methods ------- diff --git a/classes/class_light3d.rst b/classes/class_light3d.rst index 35d7aa3f4..0f3628257 100644 --- a/classes/class_light3d.rst +++ b/classes/class_light3d.rst @@ -316,6 +316,8 @@ If ``true``, the light only appears in the editor and will not be visible at run The light's angular size in degrees. Increasing this will make shadows softer at greater distances. Only available for :ref:`DirectionalLight3D`\ s. For reference, the Sun from the Earth is approximately ``0.5``. +\ **Note:** :ref:`light_angular_distance` is not affected by :ref:`Node3D.scale` (the light's scale or its parent's scale). + ---- .. _class_Light3D_property_light_bake_mode: @@ -482,6 +484,8 @@ If ``true``, the light's effect is reversed, darkening areas and casting bright The size of the light in Godot units. Only available for :ref:`OmniLight3D`\ s and :ref:`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. +\ **Note:** :ref:`light_size` is not affected by :ref:`Node3D.scale` (the light's scale or its parent's scale). + ---- .. _class_Light3D_property_light_specular: diff --git a/classes/class_lineedit.rst b/classes/class_lineedit.rst index cf051e480..8d813b4fc 100644 --- a/classes/class_lineedit.rst +++ b/classes/class_lineedit.rst @@ -111,6 +111,8 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`secret_character` | ``"•"`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`select_all_on_focus` | ``false`` | ++-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`selecting_enabled` | ``true`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`shortcut_keys_enabled` | ``true`` | @@ -746,6 +748,22 @@ The character to use to mask secret input (defaults to "•"). Only a single cha ---- +.. _class_LineEdit_property_select_all_on_focus: + +- :ref:`bool` **select_all_on_focus** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_select_all_on_focus(value) | ++-----------+--------------------------------+ +| *Getter* | is_select_all_on_focus() | ++-----------+--------------------------------+ + +If ``true``, the ``LineEdit`` will select the whole text when it gains focus. + +---- + .. _class_LineEdit_property_selecting_enabled: - :ref:`bool` **selecting_enabled** diff --git a/classes/class_linkbutton.rst b/classes/class_linkbutton.rst index 056137207..5f9e19f55 100644 --- a/classes/class_linkbutton.rst +++ b/classes/class_linkbutton.rst @@ -24,19 +24,23 @@ See also :ref:`BaseButton` which contains common properties an Properties ---------- -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`String` | :ref:`language` | ``""`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`StructuredTextParser` | :ref:`structured_text_bidi_override` | ``0`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`Array` | :ref:`structured_text_bidi_override_options` | ``[]`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`String` | :ref:`text` | ``""`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`TextDirection` | :ref:`text_direction` | ``0`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ -| :ref:`UnderlineMode` | :ref:`underline` | ``0`` | -+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------+ ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`FocusMode` | focus_mode | ``0`` (overrides :ref:`Control`) | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`language` | ``""`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`CursorShape` | mouse_default_cursor_shape | ``2`` (overrides :ref:`Control`) | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`StructuredTextParser` | :ref:`structured_text_bidi_override` | ``0`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`structured_text_bidi_override_options` | ``[]`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`TextDirection` | :ref:`text_direction` | ``0`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`UnderlineMode` | :ref:`underline` | ``0`` | ++-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ Theme Properties ---------------- diff --git a/classes/class_marker3d.rst b/classes/class_marker3d.rst index 28dc771e6..cbe33749c 100644 --- a/classes/class_marker3d.rst +++ b/classes/class_marker3d.rst @@ -19,6 +19,30 @@ Description Generic 3D position hint for editing. It's just like a plain :ref:`Node3D`, but it displays as a cross in the 3D editor at all times. +Properties +---------- + ++---------------------------+-------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`gizmo_extents` | ``0.25`` | ++---------------------------+-------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_Marker3D_property_gizmo_extents: + +- :ref:`float` **gizmo_extents** + ++-----------+--------------------------+ +| *Default* | ``0.25`` | ++-----------+--------------------------+ +| *Setter* | set_gizmo_extents(value) | ++-----------+--------------------------+ +| *Getter* | get_gizmo_extents() | ++-----------+--------------------------+ + +Size of the gizmo cross that appears in the editor. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_menubar.rst b/classes/class_menubar.rst index 868e94621..bd237ccf7 100644 --- a/classes/class_menubar.rst +++ b/classes/class_menubar.rst @@ -29,8 +29,6 @@ Properties +--------------------------------------------------+----------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`prefer_global_menu` | ``true`` | +--------------------------------------------------+----------------------------------------------------------------------+-----------+ -| :ref:`Node` | :ref:`shortcut_context` | | -+--------------------------------------------------+----------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`start_index` | ``-1`` | +--------------------------------------------------+----------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`switch_on_hover` | ``true`` | @@ -155,20 +153,6 @@ If ``true``, ``MenuBar`` will use system global menu when supported. ---- -.. _class_MenuBar_property_shortcut_context: - -- :ref:`Node` **shortcut_context** - -+----------+-----------------------------+ -| *Setter* | set_shortcut_context(value) | -+----------+-----------------------------+ -| *Getter* | get_shortcut_context() | -+----------+-----------------------------+ - -The :ref:`Node` which must be a parent of the focused GUI :ref:`Control` for the shortcut to be activated. If ``null``, 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. - ----- - .. _class_MenuBar_property_start_index: - :ref:`int` **start_index** diff --git a/classes/class_mesh.rst b/classes/class_mesh.rst index 8b3e9a14f..8bcde5031 100644 --- a/classes/class_mesh.rst +++ b/classes/class_mesh.rst @@ -35,9 +35,9 @@ Tutorials Properties ---------- -+---------------------------------+-------------------------------------------------------------------+ -| :ref:`Vector2i` | :ref:`lightmap_size_hint` | -+---------------------------------+-------------------------------------------------------------------+ ++---------------------------------+-------------------------------------------------------------------+--------------------+ +| :ref:`Vector2i` | :ref:`lightmap_size_hint` | ``Vector2i(0, 0)`` | ++---------------------------------+-------------------------------------------------------------------+--------------------+ Methods ------- @@ -354,11 +354,13 @@ Property Descriptions - :ref:`Vector2i` **lightmap_size_hint** -+----------+-------------------------------+ -| *Setter* | set_lightmap_size_hint(value) | -+----------+-------------------------------+ -| *Getter* | get_lightmap_size_hint() | -+----------+-------------------------------+ ++-----------+-------------------------------+ +| *Default* | ``Vector2i(0, 0)`` | ++-----------+-------------------------------+ +| *Setter* | set_lightmap_size_hint(value) | ++-----------+-------------------------------+ +| *Getter* | get_lightmap_size_hint() | ++-----------+-------------------------------+ Sets a hint to be used for lightmap resolution. @@ -491,7 +493,7 @@ Generate a :ref:`TriangleMesh` from the mesh. Considers only - :ref:`AABB` **get_aabb** **(** **)** |const| -Returns the smallest :ref:`AABB` enclosing this mesh in local space. Not affected by ``custom_aabb``. See also :ref:`VisualInstance3D.get_transformed_aabb`. +Returns the smallest :ref:`AABB` enclosing this mesh in local space. Not affected by ``custom_aabb``. \ **Note:** This is only implemented for :ref:`ArrayMesh` and :ref:`PrimitiveMesh`. diff --git a/classes/class_mobilevrinterface.rst b/classes/class_mobilevrinterface.rst index 4ca72d292..4212c9911 100644 --- a/classes/class_mobilevrinterface.rst +++ b/classes/class_mobilevrinterface.rst @@ -21,7 +21,7 @@ This is a generic mobile VR implementation where you need to provide details abo Note that even though there is no positional tracking, the camera will assume the headset is at a height of 1.85 meters. You can change this by setting :ref:`eye_height`. -You can initialise this interface as follows: +You can initialize this interface as follows: :: diff --git a/classes/class_moviewriter.rst b/classes/class_moviewriter.rst index f5fbccdfd..9cce7b810 100644 --- a/classes/class_moviewriter.rst +++ b/classes/class_moviewriter.rst @@ -17,7 +17,7 @@ Abstract class for non-real-time video recording encoders. Description ----------- -Godot can record videos with non-real-time simulation. Like the ``--fixed-fps`` command line argument, this forces the reported ``delta`` in :ref:`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 can record videos with non-real-time simulation. Like the ``--fixed-fps`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`, this forces the reported ``delta`` in :ref:`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: @@ -88,7 +88,7 @@ Called when the engine determines whether this ``MovieWriter`` is able to handle - :ref:`Error` **_write_begin** **(** :ref:`Vector2i` movie_size, :ref:`int` fps, :ref:`String` base_path **)** |virtual| -Called once before the engine starts writing video and audio data. ``movie_size`` is the width and height of the video to save. ``fps`` is the number of frames per second specified in the project settings or using the ``--fixed-fps `` command line argument. +Called once before the engine starts writing video and audio data. ``movie_size`` is the width and height of the video to save. ``fps`` is the number of frames per second specified in the project settings or using the ``--fixed-fps `` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. ---- diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst index e716a7ba4..7458be10a 100644 --- a/classes/class_multimesh.rst +++ b/classes/class_multimesh.rst @@ -253,7 +253,7 @@ Method Descriptions - :ref:`AABB` **get_aabb** **(** **)** |const| -Returns the visibility axis-aligned bounding box in local space. See also :ref:`VisualInstance3D.get_transformed_aabb`. +Returns the visibility axis-aligned bounding box in local space. ---- diff --git a/classes/class_multiplayerpeer.rst b/classes/class_multiplayerpeer.rst index cce6f3096..577650a2e 100644 --- a/classes/class_multiplayerpeer.rst +++ b/classes/class_multiplayerpeer.rst @@ -14,14 +14,14 @@ MultiplayerPeer **Inherited By:** :ref:`ENetMultiplayerPeer`, :ref:`MultiplayerPeerExtension`, :ref:`WebRTCMultiplayerPeer`, :ref:`WebSocketMultiplayerPeer` -A high-level network interface to simplify multiplayer interactions. +Abstract class for specialized :ref:`PacketPeer`\ s used by the :ref:`MultiplayerAPI`. Description ----------- -Manages the connection to multiplayer peers. Assigns unique IDs to each client connected to the server. See also :ref:`MultiplayerAPI`. +Manages the connection with one or more remote peers acting as server or client and assigning unique IDs to each of them. See also :ref:`MultiplayerAPI`. -\ **Note:** 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. +\ **Note:** The :ref:`MultiplayerAPI` protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. \ **Note:** When exporting to Android, make sure to enable the ``INTERNET`` 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. @@ -46,44 +46,38 @@ Properties Methods ------- -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`generate_unique_id` **(** **)** |const| | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| :ref:`ConnectionStatus` | :ref:`get_connection_status` **(** **)** |const| | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_packet_peer` **(** **)** |const| | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_unique_id` **(** **)** |const| | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| void | :ref:`poll` **(** **)** | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_target_peer` **(** :ref:`int` id **)** | -+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_peer` **(** :ref:`int` peer, :ref:`bool` force=false **)** | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`generate_unique_id` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ConnectionStatus` | :ref:`get_connection_status` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_packet_channel` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TransferMode` | :ref:`get_packet_mode` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_packet_peer` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unique_id` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_server_relay_supported` **(** **)** |const| | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_target_peer` **(** :ref:`int` id **)** | ++----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- -.. _class_MultiplayerPeer_signal_connection_failed: - -- **connection_failed** **(** **)** - -Emitted when a connection attempt fails. - ----- - -.. _class_MultiplayerPeer_signal_connection_succeeded: - -- **connection_succeeded** **(** **)** - -Emitted when a connection attempt succeeds. - ----- - .. _class_MultiplayerPeer_signal_peer_connected: - **peer_connected** **(** :ref:`int` id **)** -Emitted by the server when a client connects. +Emitted when a remote peer connects. ---- @@ -91,15 +85,7 @@ Emitted by the server when a client connects. - **peer_disconnected** **(** :ref:`int` id **)** -Emitted by the server when a client disconnects. - ----- - -.. _class_MultiplayerPeer_signal_server_disconnected: - -- **server_disconnected** **(** **)** - -Emitted by clients when the server disconnects. +Emitted when a remote peer has disconnected. Enumerations ------------ @@ -114,11 +100,11 @@ Enumerations enum **ConnectionStatus**: -- **CONNECTION_DISCONNECTED** = **0** --- The ongoing connection disconnected. +- **CONNECTION_DISCONNECTED** = **0** --- The MultiplayerPeer is disconnected. -- **CONNECTION_CONNECTING** = **1** --- A connection attempt is ongoing. +- **CONNECTION_CONNECTING** = **1** --- The MultiplayerPeer is currently connecting to a server. -- **CONNECTION_CONNECTED** = **2** --- The connection attempt succeeded. +- **CONNECTION_CONNECTED** = **2** --- This MultiplayerPeer is connected. ---- @@ -145,9 +131,9 @@ Constants .. _class_MultiplayerPeer_constant_TARGET_PEER_SERVER: -- **TARGET_PEER_BROADCAST** = **0** --- Packets are sent to the server and then redistributed to other peers. +- **TARGET_PEER_BROADCAST** = **0** --- Packets are sent to all connected peers. -- **TARGET_PEER_SERVER** = **1** --- Packets are sent to the server alone. +- **TARGET_PEER_SERVER** = **1** --- Packets are sent to the remote peer acting as server. Property Descriptions --------------------- @@ -198,11 +184,27 @@ The channel to use to send packets. Many network APIs such as ENet and WebRTC al | *Getter* | get_transfer_mode() | +-----------+--------------------------+ -The manner in which to send packets to the ``target_peer``. See :ref:`TransferMode`. +The manner in which to send packets to the target peer. See :ref:`TransferMode`, and the :ref:`set_target_peer` method. Method Descriptions ------------------- +.. _class_MultiplayerPeer_method_close: + +- void **close** **(** **)** + +Immediately close the multiplayer peer returning to the state :ref:`CONNECTION_DISCONNECTED`. Connected peers will be dropped without emitting :ref:`peer_disconnected`. + +---- + +.. _class_MultiplayerPeer_method_disconnect_peer: + +- void **disconnect_peer** **(** :ref:`int` peer, :ref:`bool` force=false **)** + +Disconnects the given ``peer`` from this host. If ``force`` is ``true`` the :ref:`peer_disconnected` signal will not be emitted for this peer. + +---- + .. _class_MultiplayerPeer_method_generate_unique_id: - :ref:`int` **generate_unique_id** **(** **)** |const| @@ -219,11 +221,27 @@ Returns the current state of the connection. See :ref:`ConnectionStatus` **get_packet_channel** **(** **)** |const| + +Returns the channel over which the next available packet was received. See :ref:`PacketPeer.get_available_packet_count`. + +---- + +.. _class_MultiplayerPeer_method_get_packet_mode: + +- :ref:`TransferMode` **get_packet_mode** **(** **)** |const| + +Returns the :ref:`TransferMode` the remote peer used to send the next available packet. See :ref:`PacketPeer.get_available_packet_count`. + +---- + .. _class_MultiplayerPeer_method_get_packet_peer: - :ref:`int` **get_packet_peer** **(** **)** |const| -Returns the ID of the ``MultiplayerPeer`` who sent the most recent packet. +Returns the ID of the ``MultiplayerPeer`` who sent the next available packet. See :ref:`PacketPeer.get_available_packet_count`. ---- @@ -235,6 +253,14 @@ Returns the ID of this ``MultiplayerPeer``. ---- +.. _class_MultiplayerPeer_method_is_server_relay_supported: + +- :ref:`bool` **is_server_relay_supported** **(** **)** |const| + +Returns true if the server can act as a relay in the current configuration (i.e. if the higher level :ref:`MultiplayerAPI` should notify connected clients of other peers, and implement a relay protocol to allow communication between them). + +---- + .. _class_MultiplayerPeer_method_poll: - void **poll** **(** **)** diff --git a/classes/class_multiplayerpeerextension.rst b/classes/class_multiplayerpeerextension.rst index 6952d942a..2f50d5b8b 100644 --- a/classes/class_multiplayerpeerextension.rst +++ b/classes/class_multiplayerpeerextension.rst @@ -22,6 +22,10 @@ This class is designed to be inherited from a GDExtension plugin to implement cu Methods ------- ++----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_close` **(** **)** |virtual| | ++----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_disconnect_peer` **(** :ref:`int` p_peer, :ref:`bool` p_force **)** |virtual| | +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_available_packet_count` **(** **)** |virtual| |const| | +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -63,6 +67,22 @@ Methods Method Descriptions ------------------- +.. _class_MultiplayerPeerExtension_method__close: + +- void **_close** **(** **)** |virtual| + +Called when the multiplayer peer should be immediately closed (see :ref:`MultiplayerPeer.close`). + +---- + +.. _class_MultiplayerPeerExtension_method__disconnect_peer: + +- void **_disconnect_peer** **(** :ref:`int` p_peer, :ref:`bool` p_force **)** |virtual| + +Called when the connected ``p_peer`` should be forcibly disconnected (see :ref:`MultiplayerPeer.disconnect_peer`). + +---- + .. _class_MultiplayerPeerExtension_method__get_available_packet_count: - :ref:`int` **_get_available_packet_count** **(** **)** |virtual| |const| diff --git a/classes/class_multiplayerspawner.rst b/classes/class_multiplayerspawner.rst index 8134cc630..99194a425 100644 --- a/classes/class_multiplayerspawner.rst +++ b/classes/class_multiplayerspawner.rst @@ -21,8 +21,6 @@ Spawnable scenes can be configured in the editor or through code (see :ref:`add_ Also supports custom node spawns through :ref:`spawn`, calling :ref:`_spawn_custom` on all peers. - - Internally, ``MultiplayerSpawner`` uses :ref:`MultiplayerAPI.object_configuration_add` to notify spawns passing the spawned node as the ``object`` and itself as the ``configuration``, and :ref:`MultiplayerAPI.object_configuration_remove` to notify despawns in a similar way. Properties @@ -85,8 +83,6 @@ Property Descriptions Maximum nodes that is allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns. - - When set to ``0`` (the default), there is no limit. ---- @@ -114,9 +110,7 @@ Method Descriptions Method called on all peers when a custom spawn was requested by the authority using :ref:`spawn`. Should return a :ref:`Node` that is not in the scene tree. - - -\ **Note:** Spawned nodes should **not** be added to the scene with `add_child`. This is done automatically. +\ **Note:** Spawned nodes should **not** be added to the scene with :ref:`Node.add_child`. This is done automatically. ---- @@ -158,8 +152,6 @@ Returns the count of spawnable scene paths. Requests a custom spawn, with ``data`` passed to :ref:`_spawn_custom` on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by :ref:`spawn_path`. - - \ **Note:** Spawnable scenes are spawned automatically. :ref:`spawn` is only needed for custom spawns. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` diff --git a/classes/class_multiplayersynchronizer.rst b/classes/class_multiplayersynchronizer.rst index 565a63521..1fccc00da 100644 --- a/classes/class_multiplayersynchronizer.rst +++ b/classes/class_multiplayersynchronizer.rst @@ -21,12 +21,8 @@ By default, ``MultiplayerSynchronizer`` synchronizes configured properties to al Visibility can be handled directly with :ref:`set_visibility_for` or as-needed with :ref:`add_visibility_filter` and :ref:`update_visibility`. - - \ :ref:`MultiplayerSpawner`\ s will handle nodes according to visibility of synchronizers as long as the node at :ref:`root_path` was spawned by one. - - Internally, ``MultiplayerSynchronizer`` uses :ref:`MultiplayerAPI.object_configuration_add` to notify synchronization start passing the :ref:`Node` at :ref:`root_path` as the ``object`` and itself as the ``configuration``, and uses :ref:`MultiplayerAPI.object_configuration_remove` to notify synchronization end in a similar way. Properties @@ -177,8 +173,6 @@ Method Descriptions Adds a peer visibility filter for this synchronizer. - - \ ``filter`` should take a peer id :ref:`int` and return a :ref:`bool`. ---- diff --git a/classes/class_navigationagent2d.rst b/classes/class_navigationagent2d.rst index 4733e6a85..7349e786b 100644 --- a/classes/class_navigationagent2d.rst +++ b/classes/class_navigationagent2d.rst @@ -19,32 +19,34 @@ 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. -\ **Note:** After :ref:`set_target_location` is used it is required to use the :ref:`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. +\ **Note:** After setting :ref:`target_location` it is required to use the :ref:`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. Properties ---------- -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`max_neighbors` | ``10`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`max_speed` | ``200.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`navigation_layers` | ``1`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`neighbor_distance` | ``500.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`path_desired_distance` | ``1.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`radius` | ``10.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`time_horizon` | ``20.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`max_neighbors` | ``10`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`max_speed` | ``200.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`navigation_layers` | ``1`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`neighbor_distance` | ``500.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`path_desired_distance` | ``1.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`radius` | ``10.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`target_location` | ``Vector2(0, 0)`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`time_horizon` | ``20.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+-------------------+ Methods ------- @@ -66,8 +68,6 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_target_location` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_navigation_finished` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_target_reachable` **(** **)** | @@ -78,8 +78,6 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation_map` **(** :ref:`RID` navigation_map **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_target_location` **(** :ref:`Vector2` location **)** | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_velocity` **(** :ref:`Vector2` velocity **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -106,13 +104,13 @@ Notifies when the navigation path changes. - **target_reached** **(** **)** -Notifies when the player defined target, set with :ref:`set_target_location`, is reached. +Notifies when the player-defined :ref:`target_location` is reached. ---- .. _class_NavigationAgent2D_signal_velocity_computed: -- **velocity_computed** **(** :ref:`Vector3` safe_velocity **)** +- **velocity_computed** **(** :ref:`Vector2` safe_velocity **)** Notifies when the collision avoidance velocity is calculated. Emitted by :ref:`set_velocity`. Only emitted when :ref:`avoidance_enabled` is true. @@ -265,6 +263,22 @@ The distance threshold before the final target point is considered to be reached ---- +.. _class_NavigationAgent2D_property_target_location: + +- :ref:`Vector2` **target_location** + ++-----------+----------------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_target_location(value) | ++-----------+----------------------------+ +| *Getter* | get_target_location() | ++-----------+----------------------------+ + +The user-defined target location. Setting this property will clear the current navigation path. + +---- + .. _class_NavigationAgent2D_property_time_horizon: - :ref:`float` **time_horizon** @@ -286,7 +300,7 @@ Method Descriptions - :ref:`float` **distance_to_target** **(** **)** |const| -Returns the distance to the target location, using the agent's global position. The user must set the target location with :ref:`set_target_location` in order for this to be accurate. +Returns the distance to the target location, using the agent's global position. The user must set :ref:`target_location` in order for this to be accurate. ---- @@ -346,14 +360,6 @@ Returns the :ref:`RID` of this agent on the :ref:`NavigationServer2D< ---- -.. _class_NavigationAgent2D_method_get_target_location: - -- :ref:`Vector2` **get_target_location** **(** **)** |const| - -Returns the user defined :ref:`Vector2` after setting the target location. - ----- - .. _class_NavigationAgent2D_method_is_navigation_finished: - :ref:`bool` **is_navigation_finished** **(** **)** @@ -366,7 +372,7 @@ Returns true if the navigation path's final location has been reached. - :ref:`bool` **is_target_reachable** **(** **)** -Returns true if the target location is reachable. The target location is set using :ref:`set_target_location`. +Returns true if :ref:`target_location` is reachable. ---- @@ -374,7 +380,7 @@ Returns true if the target location is reachable. The target location is set usi - :ref:`bool` **is_target_reached** **(** **)** |const| -Returns true if the target location is reached. The target location is set using :ref:`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 :ref:`get_final_location`. +Returns true if :ref:`target_location` is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See :ref:`get_final_location`. ---- @@ -394,14 +400,6 @@ Sets the :ref:`RID` of the navigation map this NavigationAgent node s ---- -.. _class_NavigationAgent2D_method_set_target_location: - -- void **set_target_location** **(** :ref:`Vector2` location **)** - -Sets the user desired final location. This will clear the current navigation path. - ----- - .. _class_NavigationAgent2D_method_set_velocity: - void **set_velocity** **(** :ref:`Vector2` velocity **)** diff --git a/classes/class_navigationagent3d.rst b/classes/class_navigationagent3d.rst index 8c1bc21d2..a80d6cc95 100644 --- a/classes/class_navigationagent3d.rst +++ b/classes/class_navigationagent3d.rst @@ -19,36 +19,38 @@ 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. -\ **Note:** After :ref:`set_target_location` is used it is required to use the :ref:`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. +\ **Note:** After setting :ref:`target_location` it is required to use the :ref:`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. Properties ---------- -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`agent_height_offset` | ``0.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`ignore_y` | ``true`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`max_neighbors` | ``10`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`max_speed` | ``10.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`navigation_layers` | ``1`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`neighbor_distance` | ``50.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`path_desired_distance` | ``1.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`radius` | ``1.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`time_horizon` | ``5.0`` | -+---------------------------+------------------------------------------------------------------------------------------+-----------+ ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`agent_height_offset` | ``0.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`avoidance_enabled` | ``false`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`ignore_y` | ``true`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`int` | :ref:`max_neighbors` | ``10`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`max_speed` | ``10.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`int` | :ref:`navigation_layers` | ``1`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`neighbor_distance` | ``50.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`path_desired_distance` | ``1.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`path_max_distance` | ``3.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`target_desired_distance` | ``1.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`Vector3` | :ref:`target_location` | ``Vector3(0, 0, 0)`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`time_horizon` | ``5.0`` | ++-------------------------------+------------------------------------------------------------------------------------------+----------------------+ Methods ------- @@ -70,8 +72,6 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_target_location` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_navigation_finished` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_target_reachable` **(** **)** | @@ -82,8 +82,6 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation_map` **(** :ref:`RID` navigation_map **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_target_location` **(** :ref:`Vector3` location **)** | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_velocity` **(** :ref:`Vector3` velocity **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -110,7 +108,7 @@ Notifies when the navigation path changes. - **target_reached** **(** **)** -Notifies when the player defined target, set with :ref:`set_target_location`, is reached. +Notifies when the player-defined :ref:`target_location` is reached. ---- @@ -301,6 +299,22 @@ The distance threshold before the final target point is considered to be reached ---- +.. _class_NavigationAgent3D_property_target_location: + +- :ref:`Vector3` **target_location** + ++-----------+----------------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_target_location(value) | ++-----------+----------------------------+ +| *Getter* | get_target_location() | ++-----------+----------------------------+ + +The user-defined target location. Setting this property will clear the current navigation path. + +---- + .. _class_NavigationAgent3D_property_time_horizon: - :ref:`float` **time_horizon** @@ -322,7 +336,7 @@ Method Descriptions - :ref:`float` **distance_to_target** **(** **)** |const| -Returns the distance to the target location, using the agent's global position. The user must set the target location with :ref:`set_target_location` in order for this to be accurate. +Returns the distance to the target location, using the agent's global position. The user must set :ref:`target_location` in order for this to be accurate. ---- @@ -382,14 +396,6 @@ Returns the :ref:`RID` of this agent on the :ref:`NavigationServer3D< ---- -.. _class_NavigationAgent3D_method_get_target_location: - -- :ref:`Vector3` **get_target_location** **(** **)** |const| - -Returns the user defined :ref:`Vector3` after setting the target location. - ----- - .. _class_NavigationAgent3D_method_is_navigation_finished: - :ref:`bool` **is_navigation_finished** **(** **)** @@ -402,7 +408,7 @@ Returns true if the navigation path's final location has been reached. - :ref:`bool` **is_target_reachable** **(** **)** -Returns true if the target location is reachable. The target location is set using :ref:`set_target_location`. +Returns true if :ref:`target_location` is reachable. ---- @@ -410,7 +416,7 @@ Returns true if the target location is reachable. The target location is set usi - :ref:`bool` **is_target_reached** **(** **)** |const| -Returns true if the target location is reached. The target location is set using :ref:`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 :ref:`get_final_location`. +Returns true if :ref:`target_location` is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See :ref:`get_final_location`. ---- @@ -430,14 +436,6 @@ Sets the :ref:`RID` of the navigation map this NavigationAgent node s ---- -.. _class_NavigationAgent3D_method_set_target_location: - -- void **set_target_location** **(** :ref:`Vector3` location **)** - -Sets the user desired final location. This will clear the current navigation path. - ----- - .. _class_NavigationAgent3D_method_set_velocity: - void **set_velocity** **(** :ref:`Vector3` velocity **)** diff --git a/classes/class_node.rst b/classes/class_node.rst index 9eaf20fbf..4458d4fc5 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -181,7 +181,7 @@ Methods +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_processing_unhandled_key_input` **(** **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`move_child` **(** :ref:`Node` child_node, :ref:`int` to_position **)** | +| void | :ref:`move_child` **(** :ref:`Node` child_node, :ref:`int` to_index **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`print_orphan_nodes` **(** **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -725,7 +725,7 @@ Corresponds to the :ref:`NOTIFICATION_EXIT_TREE` **_get_configuration_warnings** **(** **)** |virtual| |const| -The elements in the array returned from this method are displayed as warnings in the Scene Dock if the script that overrides it is a ``tool`` script. +The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a ``tool`` script. Returning an empty array produces no warnings. @@ -1373,9 +1373,9 @@ Returns ``true`` if the node is processing unhandled key input (see :ref:`set_pr .. _class_Node_method_move_child: -- void **move_child** **(** :ref:`Node` child_node, :ref:`int` to_position **)** +- void **move_child** **(** :ref:`Node` child_node, :ref:`int` to_index **)** -Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. If ``to_position`` is negative, the index will be counted from the end. +Moves a child node to a different index (order) among the other children. Since calls, signals, etc. are performed by tree order, changing the order of children nodes may be useful. If ``to_index`` is negative, the index will be counted from the end. \ **Note:** Internal children can only be moved within their expected "internal range" (see ``internal`` parameter in :ref:`add_child`). @@ -1414,7 +1414,7 @@ Prints the tree to stdout. Used mainly for debugging purposes. This version disp - void **print_tree_pretty** **(** **)** -Similar to :ref:`print_tree`, this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the scene inspector. It is useful for inspecting larger trees. +Similar to :ref:`print_tree`, this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees. \ **Example output:**\ @@ -1497,7 +1497,7 @@ Requests that ``_ready`` be called again. Note that the method won't be called i - :ref:`Error` **rpc** **(** :ref:`StringName` method, ... **)** |vararg| -Sends a remote procedure call request for the given ``method`` 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 :ref:`NodePath`, including the exact same node name. Behaviour depends on the RPC configuration for the given method, see :ref:`rpc_config`. Methods are not exposed to RPCs by default. Returns ``null``. +Sends a remote procedure call request for the given ``method`` 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 :ref:`NodePath`, including the exact same node name. Behavior depends on the RPC configuration for the given method, see :ref:`rpc_config`. Methods are not exposed to RPCs by default. Returns ``null``. \ **Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`MultiplayerAPI`. You also need to keep track of the connection state, either by the :ref:`MultiplayerAPI` signals like ``server_disconnected`` or by checking ``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``. diff --git a/classes/class_node3d.rst b/classes/class_node3d.rst index 8e723a465..af30c0e12 100644 --- a/classes/class_node3d.rst +++ b/classes/class_node3d.rst @@ -52,7 +52,7 @@ Properties +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ | :ref:`RotationEditMode` | :ref:`rotation_edit_mode` | ``0`` | +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ -| :ref:`RotationOrder` | :ref:`rotation_order` | ``2`` | +| :ref:`EulerOrder` | :ref:`rotation_order` | ``2`` | +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ | :ref:`Vector3` | :ref:`scale` | ``Vector3(1, 1, 1)`` | +-------------------------------------------------------+---------------------------------------------------------------------+-----------------------------------------------------+ @@ -170,36 +170,6 @@ enum **RotationEditMode**: - **ROTATION_EDIT_MODE_BASIS** = **2** ----- - -.. _enum_Node3D_RotationOrder: - -.. _class_Node3D_constant_ROTATION_ORDER_XYZ: - -.. _class_Node3D_constant_ROTATION_ORDER_XZY: - -.. _class_Node3D_constant_ROTATION_ORDER_YXZ: - -.. _class_Node3D_constant_ROTATION_ORDER_YZX: - -.. _class_Node3D_constant_ROTATION_ORDER_ZXY: - -.. _class_Node3D_constant_ROTATION_ORDER_ZYX: - -enum **RotationOrder**: - -- **ROTATION_ORDER_XYZ** = **0** - -- **ROTATION_ORDER_XZY** = **1** - -- **ROTATION_ORDER_YXZ** = **2** - -- **ROTATION_ORDER_YZX** = **3** - -- **ROTATION_ORDER_ZXY** = **4** - -- **ROTATION_ORDER_ZYX** = **5** - Constants --------- @@ -354,7 +324,7 @@ Specify how rotation (and scale) will be presented in the editor. .. _class_Node3D_property_rotation_order: -- :ref:`RotationOrder` **rotation_order** +- :ref:`EulerOrder` **rotation_order** +-----------+---------------------------+ | *Default* | ``2`` | @@ -384,6 +354,8 @@ Scale part of the local transformation. \ **Note:** 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. +\ **Note:** Not all nodes are visually scaled by the :ref:`scale` property. For example, :ref:`Light3D`\ s are not visually affected by :ref:`scale`. + ---- .. _class_Node3D_property_top_level: diff --git a/classes/class_nodepath.rst b/classes/class_nodepath.rst index ec1182c8f..cdfd659a7 100644 --- a/classes/class_nodepath.rst +++ b/classes/class_nodepath.rst @@ -15,7 +15,7 @@ Pre-parsed scene tree path. Description ----------- -A pre-parsed relative or absolute path in a scene tree, for use with :ref:`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, ``"Path2D/PathFollow2D/Sprite2D:texture:size"`` would refer to the ``size`` property of the ``texture`` resource on the node named ``"Sprite2D"`` which is a child of the other named nodes in the path. +A pre-parsed relative or absolute path in a scene tree, for use with :ref:`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 example, ``"Path2D/PathFollow2D/Sprite2D:texture:size"`` would refer to the ``size`` property of the ``texture`` resource on the node named ``"Sprite2D"`` which is a child of the other named nodes in the path. You will usually just pass a string to :ref:`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 ``^"path"``. Exporting a ``NodePath`` variable will give you a node selection widget in the properties panel of the editor, which can often be useful. diff --git a/classes/class_object.rst b/classes/class_object.rst index 95b2a17b8..0fbed5fa6 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -107,7 +107,7 @@ Methods +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary[]` | :ref:`get_incoming_connections` **(** **)** |const| | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`get_indexed` **(** :ref:`NodePath` property **)** |const| | +| :ref:`Variant` | :ref:`get_indexed` **(** :ref:`NodePath` property_path **)** |const| | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_instance_id` **(** **)** |const| | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -153,7 +153,7 @@ Methods +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_deferred` **(** :ref:`StringName` property, :ref:`Variant` value **)** | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_indexed` **(** :ref:`NodePath` property, :ref:`Variant` value **)** | +| void | :ref:`set_indexed` **(** :ref:`NodePath` property_path, :ref:`Variant` value **)** | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_message_translation` **(** :ref:`bool` enable **)** | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -312,7 +312,9 @@ Adds a user-defined ``signal``. Arguments are optional, but can be added as an : - :ref:`Variant` **call** **(** :ref:`StringName` method, ... **)** |vararg| -Calls the ``method`` on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: +Calls the ``method`` on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. + +\ **Example:**\ .. tabs:: @@ -337,7 +339,9 @@ Calls the ``method`` on the object and returns the result. This method supports - :ref:`Variant` **call_deferred** **(** :ref:`StringName` method, ... **)** |vararg| -Calls the ``method`` on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: +Calls the ``method`` on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. + +\ **Example:**\ .. tabs:: @@ -568,7 +572,9 @@ If you try to disconnect a connection that does not exist, the method will print - :ref:`Error` **emit_signal** **(** :ref:`StringName` signal, ... **)** |vararg| -Emits the given ``signal``. 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: +Emits the given ``signal``. 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:**\ .. tabs:: @@ -633,9 +639,11 @@ Each :ref:`Dictionary` contains three String entries: .. _class_Object_method_get_indexed: -- :ref:`Variant` **get_indexed** **(** :ref:`NodePath` property **)** |const| +- :ref:`Variant` **get_indexed** **(** :ref:`NodePath` property_path **)** |const| -Gets the object's property indexed by the given :ref:`NodePath`. The node path should be relative to the current object and can use the colon character (``:``) to access nested properties. Examples: ``"position:x"`` or ``"material:next_pass:blend_mode"``. +Gets the object's property indexed by the given ``property_path``. The path should be a :ref:`NodePath` relative to the current object and can use the colon character (``:``) to access nested properties. + +\ **Examples:** ``"position:x"`` or ``"material:next_pass:blend_mode"``. \ **Note:** Even though the method takes :ref:`NodePath` argument, it doesn't support actual paths to :ref:`Node`\ s in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use :ref:`Node.get_node_and_resource` instead. @@ -659,7 +667,7 @@ Returns the object's metadata entry for the given ``name``. Throws error if the entry does not exist, unless ``default`` is not ``null`` (in which case the default value will be returned). See also :ref:`has_meta`, :ref:`set_meta` and :ref:`remove_meta`. -\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the inspector and should not be edited. +\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited. ---- @@ -719,7 +727,7 @@ Returns the list of signals as an :ref:`Array` of dictionaries. Returns ``true`` if a metadata entry is found with the given ``name``. See also :ref:`get_meta`, :ref:`set_meta` and :ref:`remove_meta`. -\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the inspector and should not be edited. +\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited. ---- @@ -805,7 +813,7 @@ Notify the editor that the property list has changed by emitting the :ref:`prope Removes a given entry from the object's metadata. See also :ref:`has_meta`, :ref:`get_meta` and :ref:`set_meta`. -\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the inspector and should not be edited. +\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited. ---- @@ -839,9 +847,11 @@ Assigns a new value to the given property, after the current frame's physics ste .. _class_Object_method_set_indexed: -- void **set_indexed** **(** :ref:`NodePath` property, :ref:`Variant` value **)** +- void **set_indexed** **(** :ref:`NodePath` property_path, :ref:`Variant` value **)** -Assigns a new value to the property identified by the :ref:`NodePath`. The node path should be relative to the current object and can use the colon character (``:``) to access nested properties. Example: +Assigns a new value to the property identified by the ``property_path``. The path should be a :ref:`NodePath` relative to the current object and can use the colon character (``:``) to access nested properties. + +\ **Example:**\ .. tabs:: @@ -880,7 +890,7 @@ Adds, changes or removes a given entry in the object's metadata. Metadata are se To remove a given entry from the object's metadata, use :ref:`remove_meta`. Metadata is also removed if its value is set to ``null``. This means you can also use ``set_meta("name", null)`` to remove metadata for ``"name"``. See also :ref:`has_meta` and :ref:`get_meta`. -\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the inspector and should not be edited. +\ **Note:** Metadata that has a ``name`` starting with an underscore (``_``) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited. ---- diff --git a/classes/class_occluderinstance3d.rst b/classes/class_occluderinstance3d.rst index 230d6429d..94fb9c65a 100644 --- a/classes/class_occluderinstance3d.rst +++ b/classes/class_occluderinstance3d.rst @@ -102,7 +102,7 @@ Setting this to ``0.0`` disables simplification entirely, but vertices in the ex The occluder resource for this ``OccluderInstance3D``. You can generate an occluder resource by selecting an ``OccluderInstance3D`` node then using the **Bake Occluders** button at the top of the editor. -You can also draw your own 2D occluder polygon by adding a new :ref:`PolygonOccluder3D` resource to the :ref:`occluder` property in the inspector. +You can also draw your own 2D occluder polygon by adding a new :ref:`PolygonOccluder3D` resource to the :ref:`occluder` property in the Inspector. Alternatively, you can select a primitive occluder to use: :ref:`QuadOccluder3D`, :ref:`BoxOccluder3D` or :ref:`SphereOccluder3D`. diff --git a/classes/class_omnilight3d.rst b/classes/class_omnilight3d.rst index 32c50c48b..385e97125 100644 --- a/classes/class_omnilight3d.rst +++ b/classes/class_omnilight3d.rst @@ -85,6 +85,8 @@ The light's attenuation (drop-off) curve. A number of presets are available in t The light's radius. Note that the effectively lit area may appear to be smaller depending on the :ref:`omni_attenuation` in use. No matter the :ref:`omni_attenuation` in use, the light will never reach anything outside this radius. +\ **Note:** :ref:`omni_range` is not affected by :ref:`Node3D.scale` (the light's scale or its parent's scale). + ---- .. _class_OmniLight3D_property_omni_shadow_mode: diff --git a/classes/class_openxraction.rst b/classes/class_openxraction.rst index ab79c3911..8437c966f 100644 --- a/classes/class_openxraction.rst +++ b/classes/class_openxraction.rst @@ -21,7 +21,7 @@ This resource defines an OpenXR action. Actions can be used both for inputs (but OpenXR performs automatic conversion between action type and input type whenever possible. An analogue trigger bound to a boolean action will thus return ``false`` if the trigger is depressed and ``true`` if pressed fully. -Actions are not directly bound to specific devices, instead OpenXR recognises a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the `reserved path section in the OpenXR specification `__ for more info on the top level paths. +Actions are not directly bound to specific devices, instead OpenXR recognizes a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the `reserved path section in the OpenXR specification `__ for more info on the top level paths. Note that the name of the resource is used to register the action with. @@ -90,7 +90,7 @@ The type of action. | *Getter* | get_localized_name() | +-----------+---------------------------+ -The localised description of this action. +The localized description of this action. ---- diff --git a/classes/class_openxractionset.rst b/classes/class_openxractionset.rst index 505909936..12e874373 100644 --- a/classes/class_openxractionset.rst +++ b/classes/class_openxractionset.rst @@ -74,7 +74,7 @@ Collection of actions for this action set. | *Getter* | get_localized_name() | +-----------+---------------------------+ -The localised name of this action set. +The localized name of this action set. ---- diff --git a/classes/class_openxrinterface.rst b/classes/class_openxrinterface.rst index 237e132fa..2e742f00f 100644 --- a/classes/class_openxrinterface.rst +++ b/classes/class_openxrinterface.rst @@ -19,13 +19,27 @@ Description The OpenXR interface allows Godot to interact with OpenXR runtimes and make it possible to create XR experiences and games. -Due to the needs of OpenXR this interface works slightly different than other plugin based XR interfaces. It needs to be initialised when Godot starts. You need to enable OpenXR, settings for this can be found in your games project settings under the XR heading. You do need to mark a viewport for use with XR in order for Godot to know which render result should be output to the headset. +Due to the needs of OpenXR this interface works slightly different than other plugin based XR interfaces. It needs to be initialized when Godot starts. You need to enable OpenXR, settings for this can be found in your games project settings under the XR heading. You do need to mark a viewport for use with XR in order for Godot to know which render result should be output to the headset. Tutorials --------- - :doc:`Setting up XR <../tutorials/xr/setting_up_xr>` +Properties +---------- + ++---------------------------+----------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`display_refresh_rate` | ``0.0`` | ++---------------------------+----------------------------------------------------------------------------------+---------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_available_display_refresh_rates` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------+ + Signals ------- @@ -67,6 +81,32 @@ Informs our OpenXR session is stopping. Informs our OpenXR session is now visible (output is being sent to the HMD). +Property Descriptions +--------------------- + +.. _class_OpenXRInterface_property_display_refresh_rate: + +- :ref:`float` **display_refresh_rate** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Setter* | set_display_refresh_rate(value) | ++-----------+---------------------------------+ +| *Getter* | get_display_refresh_rate() | ++-----------+---------------------------------+ + +The display refresh rate for the current HMD. Only functional if this feature is supported by the OpenXR runtime and after the interface has been initialized. + +Method Descriptions +------------------- + +.. _class_OpenXRInterface_method_get_available_display_refresh_rates: + +- :ref:`Array` **get_available_display_refresh_rates** **(** **)** |const| + +Returns display refresh rates supported by the current HMD. Only returned if this feature is supported by the OpenXR runtime and after the interface has been initialized. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_optionbutton.rst b/classes/class_optionbutton.rst index c0810eb5b..9a55ea39d 100644 --- a/classes/class_optionbutton.rst +++ b/classes/class_optionbutton.rst @@ -155,7 +155,7 @@ Signals - **item_focused** **(** :ref:`int` index **)** -Emitted when the user navigates to an item using the ``ui_up`` or ``ui_down`` actions. The index of the item selected is passed as argument. +Emitted when the user navigates to an item using the :ref:`ProjectSettings.input/ui_up` or :ref:`ProjectSettings.input/ui_down` input actions. The index of the item selected is passed as argument. ---- diff --git a/classes/class_os.rst b/classes/class_os.rst index 560c4ca66..35f9a8f84 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -17,7 +17,9 @@ Operating System functions. Description ----------- -Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc. +Operating System functions. ``OS`` wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc. + +\ **Note:** In Godot 4, ``OS`` functions related to window management were moved to the :ref:`DisplayServer` singleton. Tutorials --------- @@ -113,6 +115,8 @@ Methods +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_version` **(** **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`get_video_adapter_driver_info` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_environment` **(** :ref:`String` variable **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_feature` **(** :ref:`String` tag_name **)** |const| | @@ -155,17 +159,17 @@ Methods Enumerations ------------ -.. _enum_OS_VideoDriver: +.. _enum_OS_RenderingDriver: -.. _class_OS_constant_VIDEO_DRIVER_VULKAN: +.. _class_OS_constant_RENDERING_DRIVER_VULKAN: -.. _class_OS_constant_VIDEO_DRIVER_OPENGL_3: +.. _class_OS_constant_RENDERING_DRIVER_OPENGL3: -enum **VideoDriver**: +enum **RenderingDriver**: -- **VIDEO_DRIVER_VULKAN** = **0** --- The Vulkan rendering backend. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available. +- **RENDERING_DRIVER_VULKAN** = **0** --- The Vulkan rendering driver. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available. -- **VIDEO_DRIVER_OPENGL_3** = **1** --- The OpenGL 3 rendering backend. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. +- **RENDERING_DRIVER_OPENGL3** = **1** --- The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. ---- @@ -494,7 +498,7 @@ Returns the keycode of the given string (e.g. "Escape"). - :ref:`String` **get_cache_dir** **(** **)** |const| -Returns the *global* cache data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_config_dir` and :ref:`get_data_dir`. +Returns the *global* cache data directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_config_dir` and :ref:`get_data_dir`. Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. @@ -571,7 +575,7 @@ For example, in the command line below, ``--fullscreen`` will not be returned in - :ref:`String` **get_config_dir** **(** **)** |const| -Returns the *global* user configuration directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_data_dir`. +Returns the *global* user configuration directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_data_dir`. Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. @@ -583,7 +587,7 @@ Not to be confused with :ref:`get_user_data_dir`. +The returned array will be empty if the system MIDI driver has not previously been initialized with :ref:`open_midi_inputs`. \ **Note:** This method is implemented on Linux, macOS and Windows. @@ -593,7 +597,7 @@ The returned array will be empty if the system MIDI driver has not previously be - :ref:`String` **get_data_dir** **(** **)** |const| -Returns the *global* user data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_config_dir`. +Returns the *global* user data directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_config_dir`. Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. @@ -923,6 +927,20 @@ For Android, the SDK version and the incremental build number are returned. If i ---- +.. _class_OS_method_get_video_adapter_driver_info: + +- :ref:`PackedStringArray` **get_video_adapter_driver_info** **(** **)** |const| + +Returns the video adapter driver name and version for the user's currently active graphics card. + +The first element holds the driver name, such as ``nvidia``, ``amdgpu``, etc. + +The second element holds the driver version. For e.g. the ``nvidia`` driver on a Linux/BSD platform, the version is in the format ``510.85.02``. For Windows, the driver's format is ``31.0.15.1659``. + +\ **Note:** This method is only supported on the platforms Linux/BSD and Windows when not running in headless mode. It returns an empty array on other platforms. + +---- + .. _class_OS_method_has_environment: - :ref:`bool` **has_environment** **(** :ref:`String` variable **)** |const| diff --git a/classes/class_particleprocessmaterial.rst b/classes/class_particleprocessmaterial.rst index 1fe021565..10eda696a 100644 --- a/classes/class_particleprocessmaterial.rst +++ b/classes/class_particleprocessmaterial.rst @@ -145,6 +145,8 @@ Properties +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`spread` | ``45.0`` | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`int` | :ref:`sub_emitter_amount_at_collision` | | ++--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------+ | :ref:`int` | :ref:`sub_emitter_amount_at_end` | | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`sub_emitter_frequency` | | @@ -1089,7 +1091,7 @@ Maximum linear acceleration applied to each particle in the direction of motion. | *Getter* | get_param_min() | +-----------+----------------------+ -Minimum equivalent of :ref:`linear_accel_min`. +Minimum equivalent of :ref:`linear_accel_max`. ---- @@ -1293,6 +1295,22 @@ Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. ---- +.. _class_ParticleProcessMaterial_property_sub_emitter_amount_at_collision: + +- :ref:`int` **sub_emitter_amount_at_collision** + ++----------+--------------------------------------------+ +| *Setter* | set_sub_emitter_amount_at_collision(value) | ++----------+--------------------------------------------+ +| *Getter* | get_sub_emitter_amount_at_collision() | ++----------+--------------------------------------------+ + +Sub particle amount on collision. + +Maximum amount set in the sub particles emitter. + +---- + .. _class_ParticleProcessMaterial_property_sub_emitter_amount_at_end: - :ref:`int` **sub_emitter_amount_at_end** diff --git a/classes/class_physicsdirectbodystate2d.rst b/classes/class_physicsdirectbodystate2d.rst index a73dc7eaa..0e69c6031 100644 --- a/classes/class_physicsdirectbodystate2d.rst +++ b/classes/class_physicsdirectbodystate2d.rst @@ -31,31 +31,31 @@ Tutorials Properties ---------- -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`angular_velocity` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`center_of_mass` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`center_of_mass_local` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`inverse_inertia` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`inverse_mass` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`linear_velocity` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`sleeping` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`step` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`total_angular_damp` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`total_gravity` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`total_linear_damp` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ -| :ref:`Transform2D` | :ref:`transform` | -+---------------------------------------+-------------------------------------------------------------------------------------------+ ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`angular_velocity` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`Vector2` | :ref:`center_of_mass` | ``Vector2(0, 0)`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`Vector2` | :ref:`center_of_mass_local` | ``Vector2(0, 0)`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`inverse_inertia` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`inverse_mass` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`Vector2` | :ref:`linear_velocity` | ``Vector2(0, 0)`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`bool` | :ref:`sleeping` | ``false`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`step` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`total_angular_damp` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`Vector2` | :ref:`total_gravity` | ``Vector2(0, 0)`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`total_linear_damp` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ +| :ref:`Transform2D` | :ref:`transform` | ``Transform2D(1, 0, 0, 1, 0, 0)`` | ++---------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------+ Methods ------- @@ -121,11 +121,13 @@ Property Descriptions - :ref:`float` **angular_velocity** -+----------+-----------------------------+ -| *Setter* | set_angular_velocity(value) | -+----------+-----------------------------+ -| *Getter* | get_angular_velocity() | -+----------+-----------------------------+ ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++-----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++-----------+-----------------------------+ The body's rotational velocity in *radians* per second. @@ -135,9 +137,11 @@ The body's rotational velocity in *radians* per second. - :ref:`Vector2` **center_of_mass** -+----------+----------------------+ -| *Getter* | get_center_of_mass() | -+----------+----------------------+ ++-----------+----------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+----------------------+ +| *Getter* | get_center_of_mass() | ++-----------+----------------------+ The body's center of mass position relative to the body's center in the global coordinate system. @@ -147,9 +151,11 @@ The body's center of mass position relative to the body's center in the global c - :ref:`Vector2` **center_of_mass_local** -+----------+----------------------------+ -| *Getter* | get_center_of_mass_local() | -+----------+----------------------------+ ++-----------+----------------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+----------------------------+ +| *Getter* | get_center_of_mass_local() | ++-----------+----------------------------+ The body's center of mass position in the body's local coordinate system. @@ -159,9 +165,11 @@ The body's center of mass position in the body's local coordinate system. - :ref:`float` **inverse_inertia** -+----------+-----------------------+ -| *Getter* | get_inverse_inertia() | -+----------+-----------------------+ ++-----------+-----------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------+ +| *Getter* | get_inverse_inertia() | ++-----------+-----------------------+ The inverse of the inertia of the body. @@ -171,9 +179,11 @@ The inverse of the inertia of the body. - :ref:`float` **inverse_mass** -+----------+--------------------+ -| *Getter* | get_inverse_mass() | -+----------+--------------------+ ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Getter* | get_inverse_mass() | ++-----------+--------------------+ The inverse of the mass of the body. @@ -183,11 +193,13 @@ The inverse of the mass of the body. - :ref:`Vector2` **linear_velocity** -+----------+----------------------------+ -| *Setter* | set_linear_velocity(value) | -+----------+----------------------------+ -| *Getter* | get_linear_velocity() | -+----------+----------------------------+ ++-----------+----------------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++-----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++-----------+----------------------------+ The body's linear velocity in pixels per second. @@ -197,11 +209,13 @@ The body's linear velocity in pixels per second. - :ref:`bool` **sleeping** -+----------+------------------------+ -| *Setter* | set_sleep_state(value) | -+----------+------------------------+ -| *Getter* | is_sleeping() | -+----------+------------------------+ ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_sleep_state(value) | ++-----------+------------------------+ +| *Getter* | is_sleeping() | ++-----------+------------------------+ If ``true``, this body is currently sleeping (not active). @@ -211,9 +225,11 @@ If ``true``, this body is currently sleeping (not active). - :ref:`float` **step** -+----------+------------+ -| *Getter* | get_step() | -+----------+------------+ ++-----------+------------+ +| *Default* | ``0.0`` | ++-----------+------------+ +| *Getter* | get_step() | ++-----------+------------+ The timestep (delta) used for the simulation. @@ -223,9 +239,11 @@ The timestep (delta) used for the simulation. - :ref:`float` **total_angular_damp** -+----------+--------------------------+ -| *Getter* | get_total_angular_damp() | -+----------+--------------------------+ ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Getter* | get_total_angular_damp() | ++-----------+--------------------------+ The rate at which the body stops rotating, if there are not any other forces moving it. @@ -235,9 +253,11 @@ The rate at which the body stops rotating, if there are not any other forces mov - :ref:`Vector2` **total_gravity** -+----------+---------------------+ -| *Getter* | get_total_gravity() | -+----------+---------------------+ ++-----------+---------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+---------------------+ +| *Getter* | get_total_gravity() | ++-----------+---------------------+ The total gravity vector being currently applied to this body. @@ -247,9 +267,11 @@ The total gravity vector being currently applied to this body. - :ref:`float` **total_linear_damp** -+----------+-------------------------+ -| *Getter* | get_total_linear_damp() | -+----------+-------------------------+ ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Getter* | get_total_linear_damp() | ++-----------+-------------------------+ The rate at which the body stops moving, if there are not any other forces moving it. @@ -259,11 +281,13 @@ The rate at which the body stops moving, if there are not any other forces movin - :ref:`Transform2D` **transform** -+----------+----------------------+ -| *Setter* | set_transform(value) | -+----------+----------------------+ -| *Getter* | get_transform() | -+----------+----------------------+ ++-----------+-----------------------------------+ +| *Default* | ``Transform2D(1, 0, 0, 1, 0, 0)`` | ++-----------+-----------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-----------------------------------+ +| *Getter* | get_transform() | ++-----------+-----------------------------------+ The body's transformation matrix. diff --git a/classes/class_physicsdirectbodystate3d.rst b/classes/class_physicsdirectbodystate3d.rst index 781bf5d15..d73b6fb58 100644 --- a/classes/class_physicsdirectbodystate3d.rst +++ b/classes/class_physicsdirectbodystate3d.rst @@ -31,35 +31,35 @@ Tutorials Properties ---------- -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`angular_velocity` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`center_of_mass` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`center_of_mass_local` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`inverse_inertia` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`inverse_inertia_tensor` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`inverse_mass` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`linear_velocity` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`principal_inertia_axes` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`sleeping` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`step` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`total_angular_damp` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`total_gravity` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`total_linear_damp` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ -| :ref:`Transform3D` | :ref:`transform` | -+---------------------------------------+-----------------------------------------------------------------------------------------------+ ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`angular_velocity` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`center_of_mass` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`center_of_mass_local` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`inverse_inertia` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Basis` | :ref:`inverse_inertia_tensor` | ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`inverse_mass` | ``0.0`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`linear_velocity` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Basis` | :ref:`principal_inertia_axes` | ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`sleeping` | ``false`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`step` | ``0.0`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`total_angular_damp` | ``0.0`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`total_gravity` | ``Vector3(0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`total_linear_damp` | ``0.0`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform3D` | :ref:`transform` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` | ++---------------------------------------+-----------------------------------------------------------------------------------------------+-----------------------------------------------------+ Methods ------- @@ -127,11 +127,13 @@ Property Descriptions - :ref:`Vector3` **angular_velocity** -+----------+-----------------------------+ -| *Setter* | set_angular_velocity(value) | -+----------+-----------------------------+ -| *Getter* | get_angular_velocity() | -+----------+-----------------------------+ ++-----------+-----------------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++-----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++-----------+-----------------------------+ The body's rotational velocity in *radians* per second. @@ -141,9 +143,11 @@ The body's rotational velocity in *radians* per second. - :ref:`Vector3` **center_of_mass** -+----------+----------------------+ -| *Getter* | get_center_of_mass() | -+----------+----------------------+ ++-----------+----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------+ +| *Getter* | get_center_of_mass() | ++-----------+----------------------+ The body's center of mass position relative to the body's center in the global coordinate system. @@ -153,9 +157,11 @@ The body's center of mass position relative to the body's center in the global c - :ref:`Vector3` **center_of_mass_local** -+----------+----------------------------+ -| *Getter* | get_center_of_mass_local() | -+----------+----------------------------+ ++-----------+----------------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------------+ +| *Getter* | get_center_of_mass_local() | ++-----------+----------------------------+ The body's center of mass position in the body's local coordinate system. @@ -165,9 +171,11 @@ The body's center of mass position in the body's local coordinate system. - :ref:`Vector3` **inverse_inertia** -+----------+-----------------------+ -| *Getter* | get_inverse_inertia() | -+----------+-----------------------+ ++-----------+-----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+-----------------------+ +| *Getter* | get_inverse_inertia() | ++-----------+-----------------------+ The inverse of the inertia of the body. @@ -177,9 +185,11 @@ The inverse of the inertia of the body. - :ref:`Basis` **inverse_inertia_tensor** -+----------+------------------------------+ -| *Getter* | get_inverse_inertia_tensor() | -+----------+------------------------------+ ++-----------+--------------------------------------+ +| *Default* | ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)`` | ++-----------+--------------------------------------+ +| *Getter* | get_inverse_inertia_tensor() | ++-----------+--------------------------------------+ The inverse of the inertia tensor of the body. @@ -189,9 +199,11 @@ The inverse of the inertia tensor of the body. - :ref:`float` **inverse_mass** -+----------+--------------------+ -| *Getter* | get_inverse_mass() | -+----------+--------------------+ ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Getter* | get_inverse_mass() | ++-----------+--------------------+ The inverse of the mass of the body. @@ -201,11 +213,13 @@ The inverse of the mass of the body. - :ref:`Vector3` **linear_velocity** -+----------+----------------------------+ -| *Setter* | set_linear_velocity(value) | -+----------+----------------------------+ -| *Getter* | get_linear_velocity() | -+----------+----------------------------+ ++-----------+----------------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++-----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++-----------+----------------------------+ The body's linear velocity in units per second. @@ -215,9 +229,11 @@ The body's linear velocity in units per second. - :ref:`Basis` **principal_inertia_axes** -+----------+------------------------------+ -| *Getter* | get_principal_inertia_axes() | -+----------+------------------------------+ ++-----------+--------------------------------------+ +| *Default* | ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)`` | ++-----------+--------------------------------------+ +| *Getter* | get_principal_inertia_axes() | ++-----------+--------------------------------------+ ---- @@ -225,11 +241,13 @@ The body's linear velocity in units per second. - :ref:`bool` **sleeping** -+----------+------------------------+ -| *Setter* | set_sleep_state(value) | -+----------+------------------------+ -| *Getter* | is_sleeping() | -+----------+------------------------+ ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_sleep_state(value) | ++-----------+------------------------+ +| *Getter* | is_sleeping() | ++-----------+------------------------+ If ``true``, this body is currently sleeping (not active). @@ -239,9 +257,11 @@ If ``true``, this body is currently sleeping (not active). - :ref:`float` **step** -+----------+------------+ -| *Getter* | get_step() | -+----------+------------+ ++-----------+------------+ +| *Default* | ``0.0`` | ++-----------+------------+ +| *Getter* | get_step() | ++-----------+------------+ The timestep (delta) used for the simulation. @@ -251,9 +271,11 @@ The timestep (delta) used for the simulation. - :ref:`float` **total_angular_damp** -+----------+--------------------------+ -| *Getter* | get_total_angular_damp() | -+----------+--------------------------+ ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Getter* | get_total_angular_damp() | ++-----------+--------------------------+ The rate at which the body stops rotating, if there are not any other forces moving it. @@ -263,9 +285,11 @@ The rate at which the body stops rotating, if there are not any other forces mov - :ref:`Vector3` **total_gravity** -+----------+---------------------+ -| *Getter* | get_total_gravity() | -+----------+---------------------+ ++-----------+----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------+ +| *Getter* | get_total_gravity() | ++-----------+----------------------+ The total gravity vector being currently applied to this body. @@ -275,9 +299,11 @@ The total gravity vector being currently applied to this body. - :ref:`float` **total_linear_damp** -+----------+-------------------------+ -| *Getter* | get_total_linear_damp() | -+----------+-------------------------+ ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Getter* | get_total_linear_damp() | ++-----------+-------------------------+ The rate at which the body stops moving, if there are not any other forces moving it. @@ -287,11 +313,13 @@ The rate at which the body stops moving, if there are not any other forces movin - :ref:`Transform3D` **transform** -+----------+----------------------+ -| *Setter* | set_transform(value) | -+----------+----------------------+ -| *Getter* | get_transform() | -+----------+----------------------+ ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_transform() | ++-----------+-----------------------------------------------------+ The body's transformation matrix. diff --git a/classes/class_physicstestmotionparameters2d.rst b/classes/class_physicstestmotionparameters2d.rst index d50b36154..9f284f8df 100644 --- a/classes/class_physicstestmotionparameters2d.rst +++ b/classes/class_physicstestmotionparameters2d.rst @@ -153,7 +153,7 @@ Motion vector to define the length and direction of the motion to test. If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody2D` for improving floor detection during floor snapping. -If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behaviour. +If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behavior. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_physicstestmotionparameters3d.rst b/classes/class_physicstestmotionparameters3d.rst index f6c9a8387..b4478932d 100644 --- a/classes/class_physicstestmotionparameters3d.rst +++ b/classes/class_physicstestmotionparameters3d.rst @@ -171,7 +171,7 @@ Motion vector to define the length and direction of the motion to test. If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody3D` for improving floor detection during floor snapping. -If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behaviour. +If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behavior. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_plane.rst b/classes/class_plane.rst index bcb63e683..29e6e98ec 100644 --- a/classes/class_plane.rst +++ b/classes/class_plane.rst @@ -74,6 +74,8 @@ Methods +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Plane` to_plane **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_point_over` **(** :ref:`Vector3` point **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Plane` | :ref:`normalized` **(** **)** |const| | @@ -280,6 +282,14 @@ Returns ``true`` if this plane and ``to_plane`` are approximately equal, by runn ---- +.. _class_Plane_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this plane is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Plane_method_is_point_over: - :ref:`bool` **is_point_over** **(** :ref:`Vector3` point **)** |const| diff --git a/classes/class_polygon2d.rst b/classes/class_polygon2d.rst index 5c4226810..72e27050e 100644 --- a/classes/class_polygon2d.rst +++ b/classes/class_polygon2d.rst @@ -214,6 +214,8 @@ The polygon's list of vertices. The final point will be connected to the first. | *Getter* | get_polygons() | +-----------+---------------------+ +The list of polygons, in case more than one is being represented. Every individual polygon is stored as a :ref:`PackedInt32Array` where each :ref:`int` is an index to a point in :ref:`polygon`. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in :ref:`polygon`, using the order they are stored in. + ---- .. _class_Polygon2D_property_skeleton: diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index 1c94255cd..c74a80d42 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -245,7 +245,7 @@ Signals - **id_focused** **(** :ref:`int` id **)** -Emitted when user navigated to an item of some ``id`` using ``ui_up`` or ``ui_down`` action. +Emitted when the user navigated to an item of some ``id`` using the :ref:`ProjectSettings.input/ui_up` or :ref:`ProjectSettings.input/ui_down` input action. ---- @@ -255,6 +255,8 @@ Emitted when user navigated to an item of some ``id`` using ``ui_up`` or ``ui_do Emitted when an item of some ``id`` is pressed or its accelerator is activated. +\ **Note:** If ``id`` is negative (either explicitly or due to overflow), this will return the corresponding index instead. + ---- .. _class_PopupMenu_signal_index_pressed: diff --git a/classes/class_portablecompressedtexture2d.rst b/classes/class_portablecompressedtexture2d.rst index 3662face9..5e3eed3a9 100644 --- a/classes/class_portablecompressedtexture2d.rst +++ b/classes/class_portablecompressedtexture2d.rst @@ -140,7 +140,7 @@ Initializes the compressed texture from a base image. The compression mode must 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. +If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. ---- diff --git a/classes/class_primitivemesh.rst b/classes/class_primitivemesh.rst index 501be77f4..5de4fd22a 100644 --- a/classes/class_primitivemesh.rst +++ b/classes/class_primitivemesh.rst @@ -24,13 +24,13 @@ Base class for all primitive meshes. Handles applying a :ref:`Material` | :ref:`custom_aabb` | -+---------------------------------+--------------------------------------------------------------+ -| :ref:`bool` | :ref:`flip_faces` | -+---------------------------------+--------------------------------------------------------------+ -| :ref:`Material` | :ref:`material` | -+---------------------------------+--------------------------------------------------------------+ ++---------------------------------+--------------------------------------------------------------+----------------------------+ +| :ref:`AABB` | :ref:`custom_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | ++---------------------------------+--------------------------------------------------------------+----------------------------+ +| :ref:`bool` | :ref:`flip_faces` | ``false`` | ++---------------------------------+--------------------------------------------------------------+----------------------------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+--------------------------------------------------------------+----------------------------+ Methods ------- @@ -48,11 +48,13 @@ Property Descriptions - :ref:`AABB` **custom_aabb** -+----------+------------------------+ -| *Setter* | set_custom_aabb(value) | -+----------+------------------------+ -| *Getter* | get_custom_aabb() | -+----------+------------------------+ ++-----------+----------------------------+ +| *Default* | ``AABB(0, 0, 0, 0, 0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_custom_aabb(value) | ++-----------+----------------------------+ +| *Getter* | get_custom_aabb() | ++-----------+----------------------------+ Overrides the :ref:`AABB` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. @@ -62,11 +64,13 @@ Overrides the :ref:`AABB` with one defined by user for use with frus - :ref:`bool` **flip_faces** -+----------+-----------------------+ -| *Setter* | set_flip_faces(value) | -+----------+-----------------------+ -| *Getter* | get_flip_faces() | -+----------+-----------------------+ ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_flip_faces(value) | ++-----------+-----------------------+ +| *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. diff --git a/classes/class_progressbar.rst b/classes/class_progressbar.rst index 4b6cbd296..c29a4d851 100644 --- a/classes/class_progressbar.rst +++ b/classes/class_progressbar.rst @@ -22,11 +22,15 @@ General-purpose progress bar. Shows fill percentage from right to left. Properties ---------- -+-------------------------+--------------------------------------------------------------------+----------+ -| :ref:`int` | :ref:`fill_mode` | ``0`` | -+-------------------------+--------------------------------------------------------------------+----------+ -| :ref:`bool` | :ref:`show_percentage` | ``true`` | -+-------------------------+--------------------------------------------------------------------+----------+ ++---------------------------+--------------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`fill_mode` | ``0`` | ++---------------------------+--------------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`show_percentage` | ``true`` | ++---------------------------+--------------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` (overrides :ref:`Control`) | ++---------------------------+--------------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`float` | step | ``0.01`` (overrides :ref:`Range`) | ++---------------------------+--------------------------------------------------------------------+------------------------------------------------------------------------------+ Theme Properties ---------------- diff --git a/classes/class_projection.rst b/classes/class_projection.rst index fbd95f1bb..8863eba1a 100644 --- a/classes/class_projection.rst +++ b/classes/class_projection.rst @@ -10,7 +10,16 @@ Projection ========== +3D projection (4x4 matrix). +Description +----------- + +A 4x4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four :ref:`Vector4` columns. + +For purely linear transformations (translation, rotation, and scale), it is recommended to use :ref:`Transform3D`, as it is more performant and has a lower memory footprint. + +Used internally as :ref:`Camera3D`'s projection matrix. Properties ---------- @@ -129,21 +138,21 @@ Constants .. _class_Projection_constant_ZERO: -- **PLANE_NEAR** = **0** +- **PLANE_NEAR** = **0** --- The index value of the projection's near clipping plane. -- **PLANE_FAR** = **1** +- **PLANE_FAR** = **1** --- The index value of the projection's far clipping plane. -- **PLANE_LEFT** = **2** +- **PLANE_LEFT** = **2** --- The index value of the projection's left clipping plane. -- **PLANE_TOP** = **3** +- **PLANE_TOP** = **3** --- The index value of the projection's top clipping plane. -- **PLANE_RIGHT** = **4** +- **PLANE_RIGHT** = **4** --- The index value of the projection's right clipping plane. -- **PLANE_BOTTOM** = **5** +- **PLANE_BOTTOM** = **5** --- The index value of the projection bottom clipping plane. -- **IDENTITY** = **Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)** +- **IDENTITY** = **Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)** --- A ``Projection`` with no transformation defined. When applied to other data structures, no transformation is performed. -- **ZERO** = **Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)** +- **ZERO** = **Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)** --- A ``Projection`` with all values initialized to 0. When applied to other data structures, they will be zeroed. Property Descriptions --------------------- @@ -156,6 +165,8 @@ Property Descriptions | *Default* | ``Vector4(0, 0, 0, 1)`` | +-----------+-------------------------+ +The projection matrix's W vector (column 3). Equivalent to array index ``3``. + ---- .. _class_Projection_property_x: @@ -166,6 +177,8 @@ Property Descriptions | *Default* | ``Vector4(1, 0, 0, 0)`` | +-----------+-------------------------+ +The projection matrix's X vector (column 0). Equivalent to array index ``0``. + ---- .. _class_Projection_property_y: @@ -176,6 +189,8 @@ Property Descriptions | *Default* | ``Vector4(0, 1, 0, 0)`` | +-----------+-------------------------+ +The projection matrix's Y vector (column 1). Equivalent to array index ``1``. + ---- .. _class_Projection_property_z: @@ -186,6 +201,8 @@ Property Descriptions | *Default* | ``Vector4(0, 0, 1, 0)`` | +-----------+-------------------------+ +The projection matrix's Z vector (column 2). Equivalent to array index ``2``. + Constructor Descriptions ------------------------ @@ -193,14 +210,20 @@ Constructor Descriptions - :ref:`Projection` **Projection** **(** **)** +Constructs a default-initialized ``Projection`` set to :ref:`IDENTITY`. + ---- - :ref:`Projection` **Projection** **(** :ref:`Projection` from **)** +Constructs a ``Projection`` as a copy of the given ``Projection``. + ---- - :ref:`Projection` **Projection** **(** :ref:`Transform3D` from **)** +Constructs a Projection as a copy of the given :ref:`Transform3D`. + ---- - :ref:`Projection` **Projection** **(** :ref:`Vector4` x_axis, :ref:`Vector4` y_axis, :ref:`Vector4` z_axis, :ref:`Vector4` w_axis **)** @@ -214,156 +237,226 @@ Method Descriptions - :ref:`Projection` **create_depth_correction** **(** :ref:`bool` flip_y **)** |static| +Creates a new ``Projection`` that projects positions from a depth range of ``-1`` to ``1`` to one that ranges from ``0`` to ``1``, and flips the projected positions vertically, according to ``flip_y``. + ---- .. _class_Projection_method_create_fit_aabb: - :ref:`Projection` **create_fit_aabb** **(** :ref:`AABB` aabb **)** |static| +Creates a new ``Projection`` that scales a given projection to fit around a given :ref:`AABB` in projection space. + ---- .. _class_Projection_method_create_for_hmd: - :ref:`Projection` **create_for_hmd** **(** :ref:`int` eye, :ref:`float` aspect, :ref:`float` intraocular_dist, :ref:`float` display_width, :ref:`float` display_to_lens, :ref:`float` oversample, :ref:`float` z_near, :ref:`float` z_far **)** |static| +Creates a new ``Projection`` for projecting positions onto a head-mounted display with the given X:Y aspect ratio, distance between eyes, display width, distance to lens, oversampling factor, and depth clipping planes. + +\ ``eye`` creates the projection for the left eye when set to 1, or the right eye when set to 2. + ---- .. _class_Projection_method_create_frustum: - :ref:`Projection` **create_frustum** **(** :ref:`float` left, :ref:`float` right, :ref:`float` bottom, :ref:`float` top, :ref:`float` z_near, :ref:`float` z_far **)** |static| +Creates a new ``Projection`` that projects positions in a frustum with the given clipping planes. + ---- .. _class_Projection_method_create_frustum_aspect: - :ref:`Projection` **create_frustum_aspect** **(** :ref:`float` size, :ref:`float` aspect, :ref:`Vector2` offset, :ref:`float` z_near, :ref:`float` z_far, :ref:`bool` flip_fov=false **)** |static| +Creates a new ``Projection`` that projects positions in a frustum with the given size, X:Y aspect ratio, offset, and clipping planes. + +\ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal. + ---- .. _class_Projection_method_create_light_atlas_rect: - :ref:`Projection` **create_light_atlas_rect** **(** :ref:`Rect2` rect **)** |static| +Creates a new ``Projection`` that projects positions into the given :ref:`Rect2`. + ---- .. _class_Projection_method_create_orthogonal: - :ref:`Projection` **create_orthogonal** **(** :ref:`float` left, :ref:`float` right, :ref:`float` bottom, :ref:`float` top, :ref:`float` z_near, :ref:`float` z_far **)** |static| +Creates a new ``Projection`` that projects positions using an orthogonal projection with the given clipping planes. + ---- .. _class_Projection_method_create_orthogonal_aspect: - :ref:`Projection` **create_orthogonal_aspect** **(** :ref:`float` size, :ref:`float` aspect, :ref:`float` z_near, :ref:`float` z_far, :ref:`bool` flip_fov=false **)** |static| +Creates a new ``Projection`` that projects positions using an orthogonal projection with the given size, X:Y aspect ratio, and clipping planes. + +\ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal. + ---- .. _class_Projection_method_create_perspective: - :ref:`Projection` **create_perspective** **(** :ref:`float` fovy, :ref:`float` aspect, :ref:`float` z_near, :ref:`float` z_far, :ref:`bool` flip_fov=false **)** |static| +Creates a new ``Projection`` that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping planes. + +\ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal. + ---- .. _class_Projection_method_create_perspective_hmd: - :ref:`Projection` **create_perspective_hmd** **(** :ref:`float` fovy, :ref:`float` aspect, :ref:`float` z_near, :ref:`float` z_far, :ref:`bool` flip_fov, :ref:`int` eye, :ref:`float` intraocular_dist, :ref:`float` convergence_dist **)** |static| +Creates a new ``Projection`` that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on. + +\ ``eye`` creates the projection for the left eye when set to 1, or the right eye when set to 2. + +\ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal. + ---- .. _class_Projection_method_determinant: - :ref:`float` **determinant** **(** **)** |const| +Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area. + +The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications. + ---- .. _class_Projection_method_flipped_y: - :ref:`Projection` **flipped_y** **(** **)** |const| +Returns a copy of this ``Projection`` with the signs of the values of the Y column flipped. + ---- .. _class_Projection_method_get_aspect: - :ref:`float` **get_aspect** **(** **)** |const| +Returns the X:Y aspect ratio of this ``Projection``'s viewport. + ---- .. _class_Projection_method_get_far_plane_half_extents: - :ref:`Vector2` **get_far_plane_half_extents** **(** **)** |const| +Returns the dimensions of the far clipping plane of the projection, divided by two. + ---- .. _class_Projection_method_get_fov: - :ref:`float` **get_fov** **(** **)** |const| +Returns the horizontal field of view of the projection (in degrees). + ---- .. _class_Projection_method_get_fovy: - :ref:`float` **get_fovy** **(** :ref:`float` fovx, :ref:`float` aspect **)** |static| +Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio. + ---- .. _class_Projection_method_get_lod_multiplier: - :ref:`float` **get_lod_multiplier** **(** **)** |const| +Returns the factor by which the visible level of detail is scaled by this ``Projection``. + ---- .. _class_Projection_method_get_pixels_per_meter: - :ref:`int` **get_pixels_per_meter** **(** :ref:`int` for_pixel_width **)** |const| +Returns the number of pixels with the given pixel width displayed per meter, after this ``Projection`` is applied. + ---- .. _class_Projection_method_get_projection_plane: - :ref:`Plane` **get_projection_plane** **(** :ref:`int` plane **)** |const| +Returns the clipping plane of this ``Projection`` whose index is given by ``plane``. + +\ ``plane`` should be equal to one of :ref:`PLANE_NEAR`, :ref:`PLANE_FAR`, :ref:`PLANE_LEFT`, :ref:`PLANE_TOP`, :ref:`PLANE_RIGHT`, or :ref:`PLANE_BOTTOM`. + ---- .. _class_Projection_method_get_viewport_half_extents: - :ref:`Vector2` **get_viewport_half_extents** **(** **)** |const| +Returns the dimensions of the viewport plane that this ``Projection`` projects positions onto, divided by two. + ---- .. _class_Projection_method_get_z_far: - :ref:`float` **get_z_far** **(** **)** |const| +Returns the distance for this ``Projection`` beyond which positions are clipped. + ---- .. _class_Projection_method_get_z_near: - :ref:`float` **get_z_near** **(** **)** |const| +Returns the distance for this ``Projection`` before which positions are clipped. + ---- .. _class_Projection_method_inverse: - :ref:`Projection` **inverse** **(** **)** |const| +Returns a ``Projection`` that performs the inverse of this ``Projection``'s projective transformation. + ---- .. _class_Projection_method_is_orthogonal: - :ref:`bool` **is_orthogonal** **(** **)** |const| +Returns ``true`` if this ``Projection`` performs an orthogonal projection. + ---- .. _class_Projection_method_jitter_offseted: - :ref:`Projection` **jitter_offseted** **(** :ref:`Vector2` offset **)** |const| +Returns a ``Projection`` with the X and Y values from the given :ref:`Vector2` added to the first and second values of the final column respectively. + ---- .. _class_Projection_method_perspective_znear_adjusted: - :ref:`Projection` **perspective_znear_adjusted** **(** :ref:`float` new_znear **)** |const| +Returns a ``Projection`` with the near clipping distance adjusted to be ``new_znear``. + +\ **Note:** The original ``Projection`` must be a perspective projection. + Operator Descriptions --------------------- @@ -371,28 +464,44 @@ Operator Descriptions - :ref:`bool` **operator !=** **(** :ref:`Projection` right **)** +Returns ``true`` if the projections are not equal. + +\ **Note:** Due to floating-point precision errors, this may return ``true``, even if the projections are virtually equal. An ``is_equal_approx`` method may be added in a future version of Godot. + ---- .. _class_Projection_operator_mul_Projection: - :ref:`Projection` **operator *** **(** :ref:`Projection` right **)** +Returns a ``Projection`` that applies the combined transformations of this ``Projection`` and ``right``. + ---- - :ref:`Vector4` **operator *** **(** :ref:`Vector4` right **)** +Projects (multiplies) the given :ref:`Vector4` by this ``Projection`` matrix. + ---- .. _class_Projection_operator_eq_bool: - :ref:`bool` **operator ==** **(** :ref:`Projection` right **)** +Returns ``true`` if the projections are equal. + +\ **Note:** Due to floating-point precision errors, this may return ``false``, even if the projections are virtually equal. An ``is_equal_approx`` method may be added in a future version of Godot. + ---- .. _class_Projection_operator_idx_Vector4: - :ref:`Vector4` **operator []** **(** :ref:`int` index **)** +Returns the column of the ``Projection`` with the given index. + +Indices are in the following order: x, y, z, w. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 7e94616db..a14919f9d 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -172,6 +172,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/standalone_ternary` | ``1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/gdscript/warnings/static_called_on_instance` | ``1`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`debug/gdscript/warnings/treat_warnings_as_errors` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/gdscript/warnings/unassigned_variable` | ``1`` | @@ -270,8 +272,14 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`display/window/handheld/orientation` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/ios/allow_high_refresh_rate` | ``true`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/ios/hide_home_indicator` | ``true`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/ios/hide_status_bar` | ``true`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/ios/suppress_ui_gesture` | ``true`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/per_pixel_transparency/allowed` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/size/always_on_top` | ``false`` | @@ -408,6 +416,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_swap_input_direction` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_add_selection_for_next_occurrence` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_backspace` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_backspace_all_to_left` | | @@ -418,6 +428,14 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_backspace_word.macos` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_caret_add_above` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_caret_add_above.macos` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_caret_add_below` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_caret_add_below.macos` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_caret_document_end` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_caret_document_end.macos` | | @@ -454,6 +472,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_caret_word_right.macos` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_text_clear_carets_and_selection` | | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_completion_accept` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`input/ui_text_completion_query` | | @@ -1196,8 +1216,6 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/renderer/rendering_method.web` | ``"gl_compatibility"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rendering/rendering_device/descriptor_pools/max_descriptors_per_pool` | ``64`` | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/rendering_device/driver` | ``"vulkan"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/rendering_device/driver.android` | ``"vulkan"`` | @@ -1216,6 +1234,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/rendering_device/staging_buffer/texture_upload_region_size_px` | ``64`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/rendering_device/vulkan/max_descriptors_per_pool` | ``64`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/scaling_3d/fsr_sharpness` | ``0.2`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/scaling_3d/mode` | ``0`` | @@ -1262,6 +1282,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/textures/vram_compression/import_s3tc` | ``true`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/transparent_background` | ``false`` | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/vrs/mode` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/vrs/texture` | ``""`` | @@ -1557,7 +1579,7 @@ Changes to this setting will only be applied upon restarting the application. | *Default* | ``false`` | +-----------+-----------+ -If ``true``, disables printing to standard output. This is equivalent to starting the editor or project with the ``--quiet`` command line argument. See also :ref:`application/run/disable_stderr`. +If ``true``, disables printing to standard output. This is equivalent to starting the editor or project with the ``--quiet`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. See also :ref:`application/run/disable_stderr`. Changes to this setting will only be applied upon restarting the application. @@ -1711,7 +1733,7 @@ Specifies the audio driver to use. This setting is platform-dependent as each pl The ``Dummy`` audio driver disables all audio playback and recording, which is useful for non-game applications as it reduces CPU usage. It also prevents the engine from appearing as an application playing audio in the OS' audio mixer. -\ **Note:** The driver in use can be overridden at runtime via the ``--audio-driver`` command line argument. +\ **Note:** The driver in use can be overridden at runtime via the ``--audio-driver`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. ---- @@ -2165,6 +2187,18 @@ When set to ``warn`` or ``error``, produces a warning or an error respectively w ---- +.. _class_ProjectSettings_property_debug/gdscript/warnings/static_called_on_instance: + +- :ref:`int` **debug/gdscript/warnings/static_called_on_instance** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +When set to ``warn`` or ``error``, produces a warning or an error respectively when calling a static method from an instance of a class instead of from the class directly. + +---- + .. _class_ProjectSettings_property_debug/gdscript/warnings/treat_warnings_as_errors: - :ref:`bool` **debug/gdscript/warnings/treat_warnings_as_errors** @@ -2425,7 +2459,7 @@ Print GPU profile information to standard output every second. This includes how | *Default* | ``false`` | +-----------+-----------+ -Print more information to standard output when running. It displays information such as memory leaks, which scenes and resources are being loaded, etc. This can also be enabled using the ``--verbose`` or ``-v`` command line argument, even on an exported project. See also :ref:`OS.is_stdout_verbose` and :ref:`@GlobalScope.print_verbose`. +Print more information to standard output when running. It displays information such as memory leaks, which scenes and resources are being loaded, etc. This can also be enabled using the ``--verbose`` or ``-v`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`, even on an exported project. See also :ref:`OS.is_stdout_verbose` and :ref:`@GlobalScope.print_verbose`. ---- @@ -2757,6 +2791,18 @@ The default screen orientation to use on mobile devices. See :ref:`ScreenOrienta ---- +.. _class_ProjectSettings_property_display/window/ios/allow_high_refresh_rate: + +- :ref:`bool` **display/window/ios/allow_high_refresh_rate** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, iOS devices that support high refresh rate/"ProMotion" will be allowed to render at up to 120 frames per second. + +---- + .. _class_ProjectSettings_property_display/window/ios/hide_home_indicator: - :ref:`bool` **display/window/ios/hide_home_indicator** @@ -2769,6 +2815,32 @@ If ``true``, the home indicator is hidden automatically. This only affects iOS d ---- +.. _class_ProjectSettings_property_display/window/ios/hide_status_bar: + +- :ref:`bool` **display/window/ios/hide_status_bar** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, the status bar is hidden while the app is running. + +---- + +.. _class_ProjectSettings_property_display/window/ios/suppress_ui_gesture: + +- :ref:`bool` **display/window/ios/suppress_ui_gesture** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, it will require two swipes to access iOS UI that uses gestures. + +\ **Note:** This setting has no effect on the home indicator if ``hide_home_indicator`` is ``true``. + +---- + .. _class_ProjectSettings_property_display/window/per_pixel_transparency/allowed: - :ref:`bool` **display/window/per_pixel_transparency/allowed** @@ -2777,7 +2849,7 @@ If ``true``, the home indicator is hidden automatically. This only affects iOS d | *Default* | ``false`` | +-----------+-----------+ -If ``true``, allows per-pixel transparency for the window background. This affects performance, so leave it on ``false`` unless you need it. +If ``true``, allows per-pixel transparency for the window background. This affects performance, so leave it on ``false`` unless you need it. See also :ref:`display/window/size/transparent` and :ref:`rendering/transparent_background`. ---- @@ -2869,9 +2941,9 @@ Allows the window to be resizable by default. | *Default* | ``false`` | +-----------+-----------+ -Main window background can be transparent. +If ``true``, enables a window manager hint that the main window background *can* be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling :ref:`rendering/transparent_background`. -\ **Note:** To use transparent splash screen, set :ref:`application/boot_splash/bg_color` to ``Color(0, 0, 0, 0)``. +\ **Note:** To use a transparent splash screen, set :ref:`application/boot_splash/bg_color` to ``Color(0, 0, 0, 0)``. \ **Note:** This setting has no effect if :ref:`display/window/per_pixel_transparency/allowed` is set to ``false``. @@ -2969,7 +3041,7 @@ If ``true``, requests V-Sync to be disabled when writing a movie (similar to set 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 :ref:`editor/movie_writer/fps` values. Certain FPS values will require you to adjust :ref:`editor/movie_writer/mix_rate` to prevent audio from desynchronizing over time. -This can be specified manually on the command line using the ``--fixed-fps `` command line argument. +This can be specified manually on the command line using the ``--fixed-fps `` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. ---- @@ -3193,7 +3265,9 @@ Default value for :ref:`ScrollContainer.scroll_deadzone` **gui/common/swap_cancel_ok** -If ``true``, swaps Cancel and OK buttons in dialogs on Windows and UWP to follow interface conventions. +If ``true``, swaps **Cancel** and **OK** buttons in dialogs on Windows and UWP to follow interface conventions. :ref:`DisplayServer.get_swap_cancel_ok` can be used to query whether buttons are swapped at run-time. + +\ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`DisplayServer.dialog_show`. ---- @@ -3297,7 +3371,7 @@ MSDF font rendering can be combined with :ref:`gui/theme/default_font_generate_m | *Default* | ``1`` | +-----------+-------+ -Default font glyph sub-pixel positioning mode. See :ref:`FontFile.subpixel_positioning`. +Default font glyph subpixel positioning mode. See :ref:`FontFile.subpixel_positioning`. ---- @@ -3309,7 +3383,7 @@ Default font glyph sub-pixel positioning mode. See :ref:`FontFile.subpixel_posit | *Default* | ``1.0`` | +-----------+---------+ -The default scale factor for :ref:`Control`\ s, when not overriden by a :ref:`Theme`. +The default scale factor for :ref:`Control`\ s, when not overridden by a :ref:`Theme`. \ **Note:** This property is only read when the project starts. To change the default scale at runtime, set :ref:`ThemeDB.fallback_base_scale` instead. @@ -3323,7 +3397,7 @@ The default scale factor for :ref:`Control`\ s, when not override | *Default* | ``1`` | +-----------+-------+ -LCD sub-pixel layout used for font anti-aliasing. See :ref:`FontLCDSubpixelLayout`. +LCD subpixel layout used for font anti-aliasing. See :ref:`FontLCDSubpixelLayout`. ---- @@ -3589,6 +3663,22 @@ Default :ref:`InputEventAction` to select an item in a : ---- +.. _class_ProjectSettings_property_input/ui_text_add_selection_for_next_occurrence: + +- :ref:`Dictionary` **input/ui_text_add_selection_for_next_occurrence** + +If a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence. + +If no selection is currently active with the last caret in text fields, selects the word currently under the caret. + +The action can be performed sequentially for all occurrences of the selection of the last caret and for all existing carets. + +The viewport is adjusted to the latest newly added caret. + +\ **Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + .. _class_ProjectSettings_property_input/ui_text_backspace: - :ref:`Dictionary` **input/ui_text_backspace** @@ -3635,6 +3725,38 @@ macOS specific override for the shortcut to delete a word. ---- +.. _class_ProjectSettings_property_input/ui_text_caret_add_above: + +- :ref:`Dictionary` **input/ui_text_caret_add_above** + +Default :ref:`InputEventAction` to add an additional caret above every caret of a text + +---- + +.. _class_ProjectSettings_property_input/ui_text_caret_add_above.macos: + +- :ref:`Dictionary` **input/ui_text_caret_add_above.macos** + +macOS specific override for the shortcut to add a caret above every caret + +---- + +.. _class_ProjectSettings_property_input/ui_text_caret_add_below: + +- :ref:`Dictionary` **input/ui_text_caret_add_below** + +Default :ref:`InputEventAction` to add an additional caret below every caret of a text + +---- + +.. _class_ProjectSettings_property_input/ui_text_caret_add_below.macos: + +- :ref:`Dictionary` **input/ui_text_caret_add_below.macos** + +macOS specific override for the shortcut to add a caret below every caret + +---- + .. _class_ProjectSettings_property_input/ui_text_caret_document_end: - :ref:`Dictionary` **input/ui_text_caret_document_end** @@ -3803,6 +3925,18 @@ macOS specific override for the shortcut to move the text cursor forward one wor ---- +.. _class_ProjectSettings_property_input/ui_text_clear_carets_and_selection: + +- :ref:`Dictionary` **input/ui_text_clear_carets_and_selection** + +If there's only one caret active and with a selection, clears the selection. + +In case there's more than one caret active, removes the secondary carets and clears their selections. + +\ **Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + .. _class_ProjectSettings_property_input/ui_text_completion_accept: - :ref:`Dictionary` **input/ui_text_completion_accept** @@ -3981,7 +4115,7 @@ Default :ref:`InputEventAction` to select all text. If no selection is currently active, selects the word currently under the caret in text fields. If a selection is currently active, deselects the current selection. -\ **Note:** Currently, this is only implemented in :ref:`TextEdit`, not :ref:`LineEdit`. +\ **Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. ---- @@ -3999,7 +4133,7 @@ Default :ref:`InputEventAction` to submit a text field. - :ref:`Dictionary` **input/ui_text_toggle_insert_mode** -Default :ref:`InputEventAction` to toggle *instert mode* in a text field. While in insert mode, inserting new text overrides the character after the cursor, unless the next character is a new line. +Default :ref:`InputEventAction` to toggle *insert mode* in a text field. While in insert mode, inserting new text overrides the character after the cursor, unless the next character is a new line. \ **Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. @@ -4049,7 +4183,7 @@ Enabling this can greatly improve the responsiveness to input, specially in devi Specifies the tablet driver to use. If left empty, the default driver will be used. -\ **Note:** The driver in use can be overridden at runtime via the ``--tablet-driver`` command line argument. +\ **Note:** The driver in use can be overridden at runtime via the ``--tablet-driver`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. ---- @@ -4287,9 +4421,9 @@ Specifies the :ref:`TextServer` to use. If left empty, the def "ICU / HarfBuzz / Graphite" is the most advanced text driver, supporting right-to-left typesetting and complex scripts (for languages like Arabic, Hebrew, etc). The "Fallback" text driver does not support right-to-left typesetting and complex scripts. -\ **Note:** The driver in use can be overridden at runtime via the ``--text-driver`` command line argument. +\ **Note:** The driver in use can be overridden at runtime via the ``--text-driver`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. -\ **Note:** There is an additional ``Dummy`` text driver available, which disables all text rendering and font-related functionality. This driver is not listed in the project settings, but it can be enabled when running the editor or project using the ``--text-driver Dummy`` command line argument. +\ **Note:** There is an additional ``Dummy`` text driver available, which disables all text rendering and font-related functionality. This driver is not listed in the project settings, but it can be enabled when running the editor or project using the ``--text-driver Dummy`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. ---- @@ -7101,7 +7235,11 @@ Another way to combat specular aliasing is to enable :ref:`rendering/anti_aliasi | *Default* | ``false`` | +-----------+-----------+ -If ``true``, uses a fast post-processing dithering filter on the default screen :ref:`Viewport` to make banding significantly less visible. In some cases, the dithering pattern may be slightly noticable. Note that this will make losslessly compressed (PNG etc.) screenshots larger. +If ``true``, uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is *not* affected by debanding unless the :ref:`Environment.background_mode` is :ref:`Environment.BG_CANVAS`. + +In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +\ **Note:** This property is only read when the project starts. To set debanding at run-time, set :ref:`Viewport.use_debanding` on the root :ref:`Viewport` instead. ---- @@ -7303,7 +7441,7 @@ Sets the quality for rough screen-space reflections. Turning off will make all s | *Default* | ``0.5`` | +-----------+---------+ -Quality target to use when :ref:`rendering/environment/ssao/quality` is set to ``ULTRA``. A value of ``0.0`` provides a quality and speed similar to ``MEDIUM`` while a value of ``1.0`` provides much higher quality than any of the other settings at the cost of performance. +Quality target to use when :ref:`rendering/environment/ssao/quality` is set to ``Ultra``. A value of ``0.0`` provides a quality and speed similar to ``Medium`` while a value of ``1.0`` provides much higher quality than any of the other settings at the cost of performance. ---- @@ -7363,7 +7501,7 @@ If ``true``, screen-space ambient occlusion will be rendered at half size and th | *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 ``ULTRA`` will use the :ref:`rendering/environment/ssao/adaptive_target` setting. +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 ``Ultra`` will use the :ref:`rendering/environment/ssao/adaptive_target` setting. ---- @@ -7375,7 +7513,7 @@ Sets the quality of the screen-space ambient occlusion effect. Higher values tak | *Default* | ``0.5`` | +-----------+---------+ -Quality target to use when :ref:`rendering/environment/ssil/quality` is set to ``ULTRA``. A value of ``0.0`` provides a quality and speed similar to ``MEDIUM`` while a value of ``1.0`` provides much higher quality than any of the other settings at the cost of performance. When using the adaptive target, the performance cost scales with the complexity of the scene. +Quality target to use when :ref:`rendering/environment/ssil/quality` is set to ``Ultra``. A value of ``0.0`` provides a quality and speed similar to ``Medium`` while a value of ``1.0`` provides much higher quality than any of the other settings at the cost of performance. When using the adaptive target, the performance cost scales with the complexity of the scene. ---- @@ -7435,7 +7573,7 @@ If ``true``, screen-space indirect lighting will be rendered at half size and th | *Default* | ``2`` | +-----------+-------+ -Sets the quality of the screen-space indirect lighting effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to ``ULTRA`` will use the :ref:`rendering/environment/ssil/adaptive_target` setting. +Sets the quality of the screen-space indirect lighting effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to ``Ultra`` will use the :ref:`rendering/environment/ssil/adaptive_target` setting. ---- @@ -8293,16 +8431,6 @@ Override for :ref:`rendering/renderer/rendering_method` **rendering/rendering_device/descriptor_pools/max_descriptors_per_pool** - -+-----------+--------+ -| *Default* | ``64`` | -+-----------+--------+ - ----- - .. _class_ProjectSettings_property_rendering/rendering_device/driver: - :ref:`String` **rendering/rendering_device/driver** @@ -8405,6 +8533,16 @@ Windows override for :ref:`rendering/rendering_device/driver` **rendering/rendering_device/vulkan/max_descriptors_per_pool** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +---- + .. _class_ProjectSettings_property_rendering/scaling_3d/fsr_sharpness: - :ref:`float` **rendering/scaling_3d/fsr_sharpness** @@ -8695,6 +8833,18 @@ If ``true``, the texture importer will import VRAM-compressed textures using the ---- +.. _class_ProjectSettings_property_rendering/transparent_background: + +- :ref:`bool` **rendering/transparent_background** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables :ref:`Viewport.transparent_bg` on the root viewport. This allows per-pixel transparency to be effective after also enabling :ref:`display/window/size/transparent` and :ref:`display/window/per_pixel_transparency/allowed`. + +---- + .. _class_ProjectSettings_property_rendering/vrs/mode: - :ref:`int` **rendering/vrs/mode** @@ -8769,7 +8919,7 @@ Action map configuration to load by default. | *Default* | ``false`` | +-----------+-----------+ -If ``true`` Godot will setup and initialise OpenXR on startup. +If ``true`` Godot will setup and initialize OpenXR on startup. ---- diff --git a/classes/class_propertytweener.rst b/classes/class_propertytweener.rst index 984113eae..2312bed0d 100644 --- a/classes/class_propertytweener.rst +++ b/classes/class_propertytweener.rst @@ -45,7 +45,9 @@ Method Descriptions - :ref:`PropertyTweener` **as_relative** **(** **)** -When called, the final value will be used as a relative value instead. Example: +When called, the final value will be used as a relative value instead. + +\ **Example:**\ :: @@ -58,12 +60,14 @@ When called, the final value will be used as a relative value instead. Example: - :ref:`PropertyTweener` **from** **(** :ref:`Variant` value **)** -Sets a custom initial value to the ``PropertyTweener``. Example: +Sets a custom initial value to the ``PropertyTweener``. + +\ **Example:**\ :: var tween = get_tree().create_tween() - tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100) #this will move the node from position (100, 100) to (200, 100) + tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will move the node from position (100, 100) to (200, 100) ---- diff --git a/classes/class_quaternion.rst b/classes/class_quaternion.rst index 9a2acf80f..9b3849532 100644 --- a/classes/class_quaternion.rst +++ b/classes/class_quaternion.rst @@ -53,8 +53,6 @@ Constructors +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`Quaternion` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quaternion` | :ref:`Quaternion` **(** :ref:`Vector3` euler_yxz **)** | -+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`Quaternion` **(** :ref:`Basis` from **)** | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`Quaternion` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | @@ -70,16 +68,20 @@ Methods +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`exp` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quaternion` | :ref:`from_euler` **(** :ref:`Vector3` euler **)** |static| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_angle` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_axis` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_euler` **(** **)** |const| | +| :ref:`Vector3` | :ref:`get_euler` **(** :ref:`int` order=2 **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`inverse` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Quaternion` to **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_normalized` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length` **(** **)** |const| | @@ -221,10 +223,6 @@ Constructs a quaternion that will rotate around the given axis by the specified ---- -- :ref:`Quaternion` **Quaternion** **(** :ref:`Vector3` euler_yxz **)** - ----- - - :ref:`Quaternion` **Quaternion** **(** :ref:`Basis` from **)** Constructs a quaternion from the given :ref:`Basis`. @@ -262,6 +260,14 @@ Returns the dot product of two quaternions. ---- +.. _class_Quaternion_method_from_euler: + +- :ref:`Quaternion` **from_euler** **(** :ref:`Vector3` euler **)** |static| + +Constructs a Quaternion from Euler angles in YXZ rotation order. + +---- + .. _class_Quaternion_method_get_angle: - :ref:`float` **get_angle** **(** **)** |const| @@ -276,9 +282,9 @@ Returns the dot product of two quaternions. .. _class_Quaternion_method_get_euler: -- :ref:`Vector3` **get_euler** **(** **)** |const| +- :ref:`Vector3` **get_euler** **(** :ref:`int` order=2 **)** |const| -Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). +Returns the quaternion's rotation in the form of Euler angles. The Euler order depends on the ``order`` parameter, for example using the YXZ convention: since this method decomposes, first Z, then X, and Y last. See the :ref:`EulerOrder` enum for possible values. The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). ---- @@ -298,6 +304,14 @@ Returns ``true`` if this quaternion and ``to`` are approximately equal, by runni ---- +.. _class_Quaternion_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this quaternion is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Quaternion_method_is_normalized: - :ref:`bool` **is_normalized** **(** **)** |const| diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst index 1934eb63f..9a36611d7 100644 --- a/classes/class_randomnumbergenerator.rst +++ b/classes/class_randomnumbergenerator.rst @@ -27,10 +27,9 @@ To generate a random float number (within a given range) based on a time-dependa var rng = RandomNumberGenerator.new() func _ready(): - rng.randomize() var my_random_number = rng.randf_range(-10.0, 10.0) -\ **Note:** The default values of :ref:`seed` and :ref:`state` properties are pseudo-random, and changes when calling :ref:`randomize`. The ``0`` value documented here is a placeholder, and not the actual default seed. +\ **Note:** The default values of :ref:`seed` and :ref:`state` properties are pseudo-random, and change when calling :ref:`randomize`. The ``0`` value documented here is a placeholder, and not the actual default seed. Tutorials --------- diff --git a/classes/class_range.rst b/classes/class_range.rst index fd0fb5256..f408b3ccc 100644 --- a/classes/class_range.rst +++ b/classes/class_range.rst @@ -24,27 +24,27 @@ Range is a base class for :ref:`Control` nodes that change a floa Properties ---------- -+---------------------------+----------------------------------------------------------+ -| :ref:`bool` | :ref:`allow_greater` | -+---------------------------+----------------------------------------------------------+ -| :ref:`bool` | :ref:`allow_lesser` | -+---------------------------+----------------------------------------------------------+ -| :ref:`bool` | :ref:`exp_edit` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`max_value` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`min_value` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`page` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`ratio` | -+---------------------------+----------------------------------------------------------+ -| :ref:`bool` | :ref:`rounded` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`step` | -+---------------------------+----------------------------------------------------------+ -| :ref:`float` | :ref:`value` | -+---------------------------+----------------------------------------------------------+ ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`allow_greater` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`allow_lesser` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`exp_edit` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`max_value` | ``100.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`min_value` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`page` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`ratio` | | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`rounded` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`step` | ``1.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`value` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ Methods ------- @@ -52,6 +52,8 @@ Methods +------+--------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_value_changed` **(** :ref:`float` new_value **)** |virtual| | +------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_value_no_signal` **(** :ref:`float` value **)** | ++------+--------------------------------------------------------------------------------------------------------------------+ | void | :ref:`share` **(** :ref:`Node` with **)** | +------+--------------------------------------------------------------------------------------------------------------------+ | void | :ref:`unshare` **(** **)** | @@ -83,11 +85,13 @@ Property Descriptions - :ref:`bool` **allow_greater** -+----------+--------------------------+ -| *Setter* | set_allow_greater(value) | -+----------+--------------------------+ -| *Getter* | is_greater_allowed() | -+----------+--------------------------+ ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_allow_greater(value) | ++-----------+--------------------------+ +| *Getter* | is_greater_allowed() | ++-----------+--------------------------+ If ``true``, :ref:`value` may be greater than :ref:`max_value`. @@ -97,11 +101,13 @@ If ``true``, :ref:`value` may be greater than :ref:` - :ref:`bool` **allow_lesser** -+----------+-------------------------+ -| *Setter* | set_allow_lesser(value) | -+----------+-------------------------+ -| *Getter* | is_lesser_allowed() | -+----------+-------------------------+ ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_allow_lesser(value) | ++-----------+-------------------------+ +| *Getter* | is_lesser_allowed() | ++-----------+-------------------------+ If ``true``, :ref:`value` may be less than :ref:`min_value`. @@ -111,11 +117,13 @@ If ``true``, :ref:`value` may be less than :ref:`min - :ref:`bool` **exp_edit** -+----------+----------------------+ -| *Setter* | set_exp_ratio(value) | -+----------+----------------------+ -| *Getter* | is_ratio_exp() | -+----------+----------------------+ ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_exp_ratio(value) | ++-----------+----------------------+ +| *Getter* | is_ratio_exp() | ++-----------+----------------------+ If ``true``, and ``min_value`` is greater than 0, ``value`` will be represented exponentially rather than linearly. @@ -125,11 +133,13 @@ If ``true``, and ``min_value`` is greater than 0, ``value`` will be represented - :ref:`float` **max_value** -+----------+----------------+ -| *Setter* | set_max(value) | -+----------+----------------+ -| *Getter* | get_max() | -+----------+----------------+ ++-----------+----------------+ +| *Default* | ``100.0`` | ++-----------+----------------+ +| *Setter* | set_max(value) | ++-----------+----------------+ +| *Getter* | get_max() | ++-----------+----------------+ Maximum value. Range is clamped if ``value`` is greater than ``max_value``. @@ -139,11 +149,13 @@ Maximum value. Range is clamped if ``value`` is greater than ``max_value``. - :ref:`float` **min_value** -+----------+----------------+ -| *Setter* | set_min(value) | -+----------+----------------+ -| *Getter* | get_min() | -+----------+----------------+ ++-----------+----------------+ +| *Default* | ``0.0`` | ++-----------+----------------+ +| *Setter* | set_min(value) | ++-----------+----------------+ +| *Getter* | get_min() | ++-----------+----------------+ Minimum value. Range is clamped if ``value`` is less than ``min_value``. @@ -153,11 +165,13 @@ Minimum value. Range is clamped if ``value`` is less than ``min_value``. - :ref:`float` **page** -+----------+-----------------+ -| *Setter* | set_page(value) | -+----------+-----------------+ -| *Getter* | get_page() | -+----------+-----------------+ ++-----------+-----------------+ +| *Default* | ``0.0`` | ++-----------+-----------------+ +| *Setter* | set_page(value) | ++-----------+-----------------+ +| *Getter* | get_page() | ++-----------+-----------------+ Page size. Used mainly for :ref:`ScrollBar`. ScrollBar's length is its size multiplied by ``page`` over the difference between ``min_value`` and ``max_value``. @@ -181,11 +195,13 @@ The value mapped between 0 and 1. - :ref:`bool` **rounded** -+----------+-------------------------------+ -| *Setter* | set_use_rounded_values(value) | -+----------+-------------------------------+ -| *Getter* | is_using_rounded_values() | -+----------+-------------------------------+ ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_use_rounded_values(value) | ++-----------+-------------------------------+ +| *Getter* | is_using_rounded_values() | ++-----------+-------------------------------+ If ``true``, ``value`` will always be rounded to the nearest integer. @@ -195,11 +211,13 @@ If ``true``, ``value`` will always be rounded to the nearest integer. - :ref:`float` **step** -+----------+-----------------+ -| *Setter* | set_step(value) | -+----------+-----------------+ -| *Getter* | get_step() | -+----------+-----------------+ ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_step(value) | ++-----------+-----------------+ +| *Getter* | get_step() | ++-----------+-----------------+ If greater than 0, ``value`` will always be rounded to a multiple of ``step``. If ``rounded`` is also ``true``, ``value`` will first be rounded to a multiple of ``step`` then rounded to the nearest integer. @@ -209,13 +227,15 @@ If greater than 0, ``value`` will always be rounded to a multiple of ``step``. I - :ref:`float` **value** -+----------+------------------+ -| *Setter* | set_value(value) | -+----------+------------------+ -| *Getter* | get_value() | -+----------+------------------+ ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_value(value) | ++-----------+------------------+ +| *Getter* | get_value() | ++-----------+------------------+ -Range's current value. +Range's current value. Changing this property (even via code) will trigger :ref:`value_changed` signal. Use :ref:`set_value_no_signal` if you want to avoid it. Method Descriptions ------------------- @@ -228,6 +248,14 @@ Called when the ``Range``'s value is changed (following the same conditions as : ---- +.. _class_Range_method_set_value_no_signal: + +- void **set_value_no_signal** **(** :ref:`float` value **)** + +Sets the ``Range``'s current value to the specified ``value``, without emitting the :ref:`value_changed` signal. + +---- + .. _class_Range_method_share: - void **share** **(** :ref:`Node` with **)** diff --git a/classes/class_rdpipelinerasterizationstate.rst b/classes/class_rdpipelinerasterizationstate.rst index 4b24a3ce6..8118a4170 100644 --- a/classes/class_rdpipelinerasterizationstate.rst +++ b/classes/class_rdpipelinerasterizationstate.rst @@ -24,7 +24,7 @@ Properties +----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`depth_bias_constant_factor` | ``0.0`` | +----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`depth_bias_enable` | ``false`` | +| :ref:`bool` | :ref:`depth_bias_enabled` | ``false`` | +----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`depth_bias_slope_factor` | ``0.0`` | +----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+ @@ -86,17 +86,17 @@ Property Descriptions ---- -.. _class_RDPipelineRasterizationState_property_depth_bias_enable: +.. _class_RDPipelineRasterizationState_property_depth_bias_enabled: -- :ref:`bool` **depth_bias_enable** +- :ref:`bool` **depth_bias_enabled** -+-----------+------------------------------+ -| *Default* | ``false`` | -+-----------+------------------------------+ -| *Setter* | set_depth_bias_enable(value) | -+-----------+------------------------------+ -| *Getter* | get_depth_bias_enable() | -+-----------+------------------------------+ ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_depth_bias_enabled(value) | ++-----------+-------------------------------+ +| *Getter* | get_depth_bias_enabled() | ++-----------+-------------------------------+ ---- diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst index 89eb2c9ea..0e9b1e4b3 100644 --- a/classes/class_rect2.rst +++ b/classes/class_rect2.rst @@ -88,6 +88,8 @@ Methods +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Rect2` rect **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`merge` **(** :ref:`Rect2` b **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -308,6 +310,14 @@ Returns ``true`` if this ``Rect2`` and ``rect`` are approximately equal, by call ---- +.. _class_Rect2_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this ``Rect2`` is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Rect2_method_merge: - :ref:`Rect2` **merge** **(** :ref:`Rect2` b **)** |const| diff --git a/classes/class_refcounted.rst b/classes/class_refcounted.rst index faeddf75f..2dc135844 100644 --- a/classes/class_refcounted.rst +++ b/classes/class_refcounted.rst @@ -12,7 +12,7 @@ RefCounted **Inherits:** :ref:`Object` -**Inherited By:** :ref:`AESContext`, :ref:`AStar2D`, :ref:`AStar3D`, :ref:`AStarGrid2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DTLSServer`, :ref:`DirAccess`, :ref:`ENetConnection`, :ref:`EditorExportPlatform`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorFileSystemImportFormatSupportQuery`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneFormatImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScenePostImportPlugin`, :ref:`EditorScript`, :ref:`EditorTranslationParserPlugin`, :ref:`EditorUndoRedoManager`, :ref:`EncodedObjectAsID`, :ref:`EngineProfiler`, :ref:`Expression`, :ref:`FileAccess`, :ref:`HMACContext`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`ImageFormatLoader`, :ref:`JSON`, :ref:`JavaClass`, :ref:`JavaScriptObject`, :ref:`KinematicCollision2D`, :ref:`KinematicCollision3D`, :ref:`Lightmapper`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`NavigationPathQueryParameters2D`, :ref:`NavigationPathQueryParameters3D`, :ref:`NavigationPathQueryResult2D`, :ref:`NavigationPathQueryResult3D`, :ref:`Node3DGizmo`, :ref:`OggPacketSequencePlayback`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`PhysicsPointQueryParameters2D`, :ref:`PhysicsPointQueryParameters3D`, :ref:`PhysicsRayQueryParameters2D`, :ref:`PhysicsRayQueryParameters3D`, :ref:`PhysicsShapeQueryParameters2D`, :ref:`PhysicsShapeQueryParameters3D`, :ref:`PhysicsTestMotionParameters2D`, :ref:`PhysicsTestMotionParameters3D`, :ref:`PhysicsTestMotionResult2D`, :ref:`PhysicsTestMotionResult3D`, :ref:`RDAttachmentFormat`, :ref:`RDFramebufferPass`, :ref:`RDPipelineColorBlendState`, :ref:`RDPipelineColorBlendStateAttachment`, :ref:`RDPipelineDepthStencilState`, :ref:`RDPipelineMultisampleState`, :ref:`RDPipelineRasterizationState`, :ref:`RDPipelineSpecializationConstant`, :ref:`RDSamplerState`, :ref:`RDShaderSource`, :ref:`RDTextureFormat`, :ref:`RDTextureView`, :ref:`RDUniform`, :ref:`RDVertexAttribute`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCPServer`, :ref:`TextLine`, :ref:`TextParagraph`, :ref:`TextServer`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`Tween`, :ref:`Tweener`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser`, :ref:`XRInterface`, :ref:`XRPose`, :ref:`XRPositionalTracker` +**Inherited By:** :ref:`AESContext`, :ref:`AStar2D`, :ref:`AStar3D`, :ref:`AStarGrid2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DTLSServer`, :ref:`DirAccess`, :ref:`ENetConnection`, :ref:`EditorExportPlatform`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorFileSystemImportFormatSupportQuery`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneFormatImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScenePostImportPlugin`, :ref:`EditorScript`, :ref:`EditorTranslationParserPlugin`, :ref:`EditorUndoRedoManager`, :ref:`EncodedObjectAsID`, :ref:`EngineProfiler`, :ref:`Expression`, :ref:`FileAccess`, :ref:`HMACContext`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`ImageFormatLoader`, :ref:`JSON`, :ref:`JavaClass`, :ref:`JavaScriptObject`, :ref:`KinematicCollision2D`, :ref:`KinematicCollision3D`, :ref:`Lightmapper`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`NavigationPathQueryParameters2D`, :ref:`NavigationPathQueryParameters3D`, :ref:`NavigationPathQueryResult2D`, :ref:`NavigationPathQueryResult3D`, :ref:`Node3DGizmo`, :ref:`OggPacketSequencePlayback`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`PhysicsPointQueryParameters2D`, :ref:`PhysicsPointQueryParameters3D`, :ref:`PhysicsRayQueryParameters2D`, :ref:`PhysicsRayQueryParameters3D`, :ref:`PhysicsShapeQueryParameters2D`, :ref:`PhysicsShapeQueryParameters3D`, :ref:`PhysicsTestMotionParameters2D`, :ref:`PhysicsTestMotionParameters3D`, :ref:`PhysicsTestMotionResult2D`, :ref:`PhysicsTestMotionResult3D`, :ref:`RDAttachmentFormat`, :ref:`RDFramebufferPass`, :ref:`RDPipelineColorBlendState`, :ref:`RDPipelineColorBlendStateAttachment`, :ref:`RDPipelineDepthStencilState`, :ref:`RDPipelineMultisampleState`, :ref:`RDPipelineRasterizationState`, :ref:`RDPipelineSpecializationConstant`, :ref:`RDSamplerState`, :ref:`RDShaderSource`, :ref:`RDTextureFormat`, :ref:`RDTextureView`, :ref:`RDUniform`, :ref:`RDVertexAttribute`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCPServer`, :ref:`TextLine`, :ref:`TextParagraph`, :ref:`TextServer`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`Tween`, :ref:`Tweener`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser`, :ref:`XRInterface`, :ref:`XRPose`, :ref:`XRPositionalTracker`, :ref:`ZIPPacker`, :ref:`ZIPReader` Base class for reference-counted objects. diff --git a/classes/class_regex.rst b/classes/class_regex.rst index 2bb31f4d0..23e72b670 100644 --- a/classes/class_regex.rst +++ b/classes/class_regex.rst @@ -17,7 +17,7 @@ Class for searching text for patterns using regular expressions. Description ----------- -A regular expression (or regex) is a compact language that can be used to recognise strings that follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For instance, a regex of ``ab[0-9]`` would find any string that is ``ab`` followed by any number from ``0`` to ``9``. For a more in-depth look, you can easily find various tutorials and detailed explanations on the Internet. +A regular expression (or regex) is a compact language that can be used to recognize strings that follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For example, a regex of ``ab[0-9]`` would find any string that is ``ab`` followed by any number from ``0`` to ``9``. For a more in-depth look, you can easily find various tutorials and detailed explanations on the Internet. To begin, the RegEx object needs to be compiled with the search pattern using :ref:`compile` before it can be used. @@ -161,7 +161,9 @@ Returns whether this object has a valid search pattern assigned. - :ref:`RegExMatch` **search** **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| -Searches the text for the compiled pattern. Returns a :ref:`RegExMatch` container of the first matching result if found, otherwise ``null``. The region to search within can be specified without modifying where the start and end anchor would be. +Searches the text for the compiled pattern. Returns a :ref:`RegExMatch` container of the first matching result if found, otherwise ``null``. + +The region to search within can be specified with ``offset`` and ``end``. This is useful when searching for another match in the same ``subject`` by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor ``^`` is not affected by ``offset``, and the character before ``offset`` will be checked for the word boundary ``\b``. ---- @@ -169,7 +171,9 @@ Searches the text for the compiled pattern. Returns a :ref:`RegExMatch` **search_all** **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| -Searches the text for the compiled pattern. Returns an array of :ref:`RegExMatch` containers for each non-overlapping result. If no results were found, an empty array is returned instead. The region to search within can be specified without modifying where the start and end anchor would be. +Searches the text for the compiled pattern. Returns an array of :ref:`RegExMatch` containers for each non-overlapping result. If no results were found, an empty array is returned instead. + +The region to search within can be specified with ``offset`` and ``end``. This is useful when searching for another match in the same ``subject`` by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor ``^`` is not affected by ``offset``, and the character before ``offset`` will be checked for the word boundary ``\b``. ---- @@ -177,7 +181,9 @@ Searches the text for the compiled pattern. Returns an array of :ref:`RegExMatch - :ref:`String` **sub** **(** :ref:`String` subject, :ref:`String` replacement, :ref:`bool` all=false, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| -Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as ``$1`` and ``$name`` are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. +Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as ``$1`` and ``$name`` are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). + +The region to search within can be specified with ``offset`` and ``end``. This is useful when searching for another match in the same ``subject`` by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor ``^`` is not affected by ``offset``, and the character before ``offset`` will be checked for the word boundary ``\b``. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_renderingdevice.rst b/classes/class_renderingdevice.rst index 3085e4e8e..0f01dc4cd 100644 --- a/classes/class_renderingdevice.rst +++ b/classes/class_renderingdevice.rst @@ -2120,6 +2120,10 @@ enum **PipelineSpecializationConstantType**: .. _class_RenderingDevice_constant_LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z: +.. _class_RenderingDevice_constant_LIMIT_MAX_VIEWPORT_DIMENSIONS_X: + +.. _class_RenderingDevice_constant_LIMIT_MAX_VIEWPORT_DIMENSIONS_Y: + enum **Limit**: - **LIMIT_MAX_BOUND_UNIFORM_SETS** = **0** @@ -2192,6 +2196,10 @@ enum **Limit**: - **LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z** = **34** +- **LIMIT_MAX_VIEWPORT_DIMENSIONS_X** = **35** + +- **LIMIT_MAX_VIEWPORT_DIMENSIONS_Y** = **36** + ---- .. _enum_RenderingDevice_MemoryType: @@ -2422,7 +2430,7 @@ Method Descriptions - void **draw_list_set_blend_constants** **(** :ref:`int` draw_list, :ref:`Color` color **)** -Sets blend constants for draw list, blend constants are used only if the graphics pipeline is created with ``DYNAMIC_STATE_BLEND_CONSTANTS`` flag set. +Sets blend constants for draw list, blend constants are used only if the graphics pipeline is created with :ref:`DYNAMIC_STATE_BLEND_CONSTANTS` flag set. ---- diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index aaa3bbe88..1d893bab0 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -35,6 +35,8 @@ In 3D, all visible objects are comprised of a resource and an instance. A resour In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. +\ **Headless mode:** Starting the engine with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` disables all rendering and window management functions. Most functions from ``RenderingServer`` will return dummy values in this case. + Tutorials --------- @@ -159,6 +161,8 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`canvas_item_set_use_parent_material` **(** :ref:`RID` item, :ref:`bool` enabled **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_visibility_layer` **(** :ref:`RID` item, :ref:`int` visibility_layer **)** | ++----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`canvas_item_set_visibility_notifier` **(** :ref:`RID` item, :ref:`bool` enable, :ref:`Rect2` area, :ref:`Callable` enter_callable, :ref:`Callable` exit_callable **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`canvas_item_set_visible` **(** :ref:`RID` item, :ref:`bool` visible **)** | @@ -839,6 +843,8 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`viewport_set_active` **(** :ref:`RID` viewport, :ref:`bool` active **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_canvas_cull_mask` **(** :ref:`RID` viewport, :ref:`int` canvas_cull_mask **)** | ++----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`viewport_set_canvas_stacking` **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`int` layer, :ref:`int` sublayer **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`viewport_set_canvas_transform` **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`Transform2D` offset **)** | @@ -2828,7 +2834,9 @@ enum **CanvasItemTextureRepeat**: .. _class_RenderingServer_constant_CANVAS_GROUP_MODE_DISABLED: -.. _class_RenderingServer_constant_CANVAS_GROUP_MODE_OPAQUE: +.. _class_RenderingServer_constant_CANVAS_GROUP_MODE_CLIP_ONLY: + +.. _class_RenderingServer_constant_CANVAS_GROUP_MODE_CLIP_AND_DRAW: .. _class_RenderingServer_constant_CANVAS_GROUP_MODE_TRANSPARENT: @@ -2836,9 +2844,11 @@ enum **CanvasGroupMode**: - **CANVAS_GROUP_MODE_DISABLED** = **0** -- **CANVAS_GROUP_MODE_OPAQUE** = **1** +- **CANVAS_GROUP_MODE_CLIP_ONLY** = **1** -- **CANVAS_GROUP_MODE_TRANSPARENT** = **2** +- **CANVAS_GROUP_MODE_CLIP_AND_DRAW** = **2** + +- **CANVAS_GROUP_MODE_TRANSPARENT** = **3** ---- @@ -3537,6 +3547,14 @@ Sets if the :ref:`CanvasItem` uses its parent's material. ---- +.. _class_RenderingServer_method_canvas_item_set_visibility_layer: + +- void **canvas_item_set_visibility_layer** **(** :ref:`RID` item, :ref:`int` visibility_layer **)** + +Sets the rendering visibility layer associated with this :ref:`CanvasItem`. Only :ref:`Viewport` nodes with a matching rendering mask will render this :ref:`CanvasItem`. + +---- + .. _class_RenderingServer_method_canvas_item_set_visibility_notifier: - void **canvas_item_set_visibility_notifier** **(** :ref:`RID` item, :ref:`bool` enable, :ref:`Rect2` area, :ref:`Callable` enter_callable, :ref:`Callable` exit_callable **)** @@ -6070,6 +6088,14 @@ If ``true``, sets the viewport active, else sets it inactive. ---- +.. _class_RenderingServer_method_viewport_set_canvas_cull_mask: + +- void **viewport_set_canvas_cull_mask** **(** :ref:`RID` viewport, :ref:`int` canvas_cull_mask **)** + +Sets the rendering mask associated with this :ref:`Viewport`. Only :ref:`CanvasItem` nodes with a matching rendering visibility layer will be rendered by this :ref:`Viewport`. + +---- + .. _class_RenderingServer_method_viewport_set_canvas_stacking: - void **viewport_set_canvas_stacking** **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`int` layer, :ref:`int` sublayer **)** diff --git a/classes/class_resource.rst b/classes/class_resource.rst index 0130ee57c..51affdc05 100644 --- a/classes/class_resource.rst +++ b/classes/class_resource.rst @@ -19,7 +19,9 @@ Base class for all resources. Description ----------- -Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from :ref:`RefCounted`, resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a :ref:`Node`, which is not reference-counted and can be instantiated from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a :ref:`Node` or another resource. +Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from :ref:`RefCounted`, resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. Once loaded from disk, further attempts to load a resource by :ref:`resource_path` returns the same reference. :ref:`PackedScene`, one of the most common :ref:`Object`\ s in a Godot project, is also a resource, uniquely capable of storing and instantiating the :ref:`Node`\ s it contains as many times as desired. + +In GDScript, resources can loaded from disk by their :ref:`resource_path` using :ref:`@GDScript.load` or :ref:`@GDScript.preload`. \ **Note:** In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. @@ -67,9 +69,9 @@ Signals - **changed** **(** **)** -Emitted whenever the resource changes. +Emitted when the resource changes, usually when one of its properties is modified. See also :ref:`emit_changed`. -\ **Note:** This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. +\ **Note:** This signal is not emitted automatically for properties of custom resources. If necessary, a setter needs to be created to emit the signal. ---- @@ -77,6 +79,8 @@ Emitted whenever the resource changes. - **setup_local_to_scene_requested** **(** **)** +Emitted when :ref:`setup_local_to_scene` is called, usually by a newly duplicated resource with :ref:`resource_local_to_scene` set to ``true``. Custom behavior can be defined by connecting this signal. + Property Descriptions --------------------- @@ -92,7 +96,9 @@ Property Descriptions | *Getter* | is_local_to_scene() | +-----------+---------------------------+ -If ``true``, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene. +If ``true``, the resource is duplicated for each instance of all scenes using it. At run-time, the resource can be modified in one scene without affecting other instances (see :ref:`PackedScene.instantiate`). + +\ **Note:** Changing this property at run-time has no effect on already created duplicate resources. ---- @@ -108,7 +114,7 @@ If ``true``, the resource will be made unique in each instance of its local scen | *Getter* | get_name() | +-----------+-----------------+ -The name of the resource. This is an optional identifier. If :ref:`resource_name` is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the :ref:`resource_name` will be displayed as the tab name in the script editor. +An optional name for this resource. When defined, its value is displayed to represent the resource in the Inspector dock. For built-in scripts, the name is displayed as part of the tab name in the script editor. ---- @@ -124,7 +130,9 @@ The name of the resource. This is an optional identifier. If :ref:`resource_name | *Getter* | get_path() | +-----------+-----------------+ -The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index. +The unique path to this resource. If it has been saved to disk, the value will be its filepath. If the resource is exclusively contained within a scene, the value will be the :ref:`PackedScene`'s filepath, followed by an unique identifier. + +\ **Note:** Setting this property manually may fail if a resource with the same path has already been previously loaded. If necessary, use :ref:`take_over_path`. Method Descriptions ------------------- @@ -133,19 +141,19 @@ Method Descriptions - :ref:`RID` **_get_rid** **(** **)** |virtual| +Override this method to return a custom :ref:`RID` when :ref:`get_rid` is called. + ---- .. _class_Resource_method_duplicate: - :ref:`Resource` **duplicate** **(** :ref:`bool` subresources=false **)** |const| -Duplicates the resource, returning a new resource with the exported members copied. **Note:** To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values. +Duplicates this resource, returning a new resource with its ``export``\ ed or :ref:`@GlobalScope.PROPERTY_USAGE_STORAGE` properties copied from the original. -By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing ``true`` to the ``subresources`` argument which will copy the subresources. +If ``subresources`` is ``false``, a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overridden by the :ref:`@GlobalScope.PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE` flag. -\ **Note:** If ``subresources`` is ``true``, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. - -\ **Note:** When duplicating a resource, only ``export``\ ed properties are copied. Other properties will be set to their default value in the new resource. +\ **Note:** For custom resources, this method will fail if :ref:`Object._init` has been defined with required parameters. ---- @@ -153,17 +161,17 @@ By default, sub-resources are shared between resource copies for efficiency. Thi - void **emit_changed** **(** **)** -Emits the :ref:`changed` signal. +Emits the :ref:`changed` signal. This method is called automatically for built-in resources. -If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties). - -The method is equivalent to: +\ **Note:** For custom resources, it's recommended to call this method whenever a meaningful change occurs, such as a modified property. This ensures that custom :ref:`Object`\ s depending on the resource are properly updated. :: - emit_signal("changed") - -\ **Note:** This method is called automatically for built-in resources. + var damage: + set(new_value): + if damage != new_value: + damage = new_value + emit_changed() ---- @@ -171,7 +179,7 @@ The method is equivalent to: - :ref:`Node` **get_local_scene** **(** **)** |const| -If :ref:`resource_local_to_scene` is enabled and the resource was loaded from a :ref:`PackedScene` instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns ``null``. +If :ref:`resource_local_to_scene` is set to ``true`` and the resource has been loaded from a :ref:`PackedScene` instantiation, returns the root :ref:`Node` of the scene where this resource is used. Otherwise, returns ``null``. ---- @@ -179,7 +187,7 @@ If :ref:`resource_local_to_scene` **get_rid** **(** **)** |const| -Returns the RID of the resource (or an empty RID). Many resources (such as :ref:`Texture2D`, :ref:`Mesh`, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. +Returns the :ref:`RID` of this resource (or an empty RID). Many resources (such as :ref:`Texture2D`, :ref:`Mesh`, and so on) are high-level abstractions of resources stored in a specialized server (:ref:`DisplayServer`, :ref:`RenderingServer`, etc.), so this function will return the original :ref:`RID`. ---- @@ -187,9 +195,23 @@ Returns the RID of the resource (or an empty RID). Many resources (such as :ref: - void **setup_local_to_scene** **(** **)** -This method is called when a resource with :ref:`resource_local_to_scene` enabled is loaded from a :ref:`PackedScene` instantiation. Its behavior can be customized by connecting :ref:`setup_local_to_scene_requested` from script. +Emits the :ref:`setup_local_to_scene_requested` signal. If :ref:`resource_local_to_scene` is set to ``true``, this method is called from :ref:`PackedScene.instantiate` by the newly duplicated resource within the scene instance. -For most resources, this method performs no base logic. :ref:`ViewportTexture` performs custom logic to properly set the proxy texture and flags in the local viewport. +For most resources, this method performs no logic of its own. Custom behavior can be defined by connecting :ref:`setup_local_to_scene_requested` from a script, **not** by overriding this method. + +\ **Example:** Assign a random value to ``health`` for every duplicated Resource from an instantiated scene, excluding the original. + +:: + + extends Resource + + var health = 0 + + func _init(): + setup_local_to_scene_requested.connect(randomize_health) + + func randomize_health(): + health = randi_range(10, 40) ---- @@ -197,7 +219,7 @@ For most resources, this method performs no base logic. :ref:`ViewportTexture` path **)** -Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting :ref:`resource_path`, as the latter would error out if another resource was already cached for the given path. +Sets the :ref:`resource_path` to ``path``, potentially overriding an existing cache entry for this path. Further attempts to load an overridden resource by path will instead return this resource. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_resourceformatloader.rst b/classes/class_resourceformatloader.rst index b42462470..b16885f9c 100644 --- a/classes/class_resourceformatloader.rst +++ b/classes/class_resourceformatloader.rst @@ -43,6 +43,8 @@ Methods +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`_load` **(** :ref:`String` path, :ref:`String` original_path, :ref:`bool` use_sub_threads, :ref:`int` cache_mode **)** |virtual| |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_recognize_path` **(** :ref:`String` path, :ref:`StringName` type **)** |virtual| |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_rename_dependencies` **(** :ref:`String` path, :ref:`Dictionary` renames **)** |virtual| |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -134,6 +136,16 @@ The ``cache_mode`` property defines whether and how the cache should be used or ---- +.. _class_ResourceFormatLoader_method__recognize_path: + +- :ref:`bool` **_recognize_path** **(** :ref:`String` path, :ref:`StringName` type **)** |virtual| |const| + +Tells whether or not this loader should load a resource from its resource path for a given type. + +If it is not implemented, the default behavior returns whether the path's extension is within the ones provided by :ref:`_get_recognized_extensions`, and if the type is within the ones provided by :ref:`_get_resource_type`. + +---- + .. _class_ResourceFormatLoader_method__rename_dependencies: - :ref:`int` **_rename_dependencies** **(** :ref:`String` path, :ref:`Dictionary` renames **)** |virtual| |const| diff --git a/classes/class_resourceformatsaver.rst b/classes/class_resourceformatsaver.rst index c93f0f8e2..c76175d5d 100644 --- a/classes/class_resourceformatsaver.rst +++ b/classes/class_resourceformatsaver.rst @@ -29,6 +29,8 @@ Methods +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_recognize` **(** :ref:`Resource` resource **)** |virtual| |const| | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_recognize_path` **(** :ref:`Resource` resource, :ref:`String` path **)** |virtual| |const| | ++---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_save` **(** :ref:`Resource` resource, :ref:`String` path, :ref:`int` flags **)** |virtual| | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -51,6 +53,16 @@ Returns whether the given resource object can be saved by this saver. ---- +.. _class_ResourceFormatSaver_method__recognize_path: + +- :ref:`bool` **_recognize_path** **(** :ref:`Resource` resource, :ref:`String` path **)** |virtual| |const| + +Returns ``true`` if this saver handles a given save path and ``false`` otherwise. + +If this method is not implemented, the default behavior returns whether the path's extension is within the ones provided by :ref:`_get_recognized_extensions`. + +---- + .. _class_ResourceFormatSaver_method__save: - :ref:`int` **_save** **(** :ref:`Resource` resource, :ref:`String` path, :ref:`int` flags **)** |virtual| diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index 173765a59..98da6fe2d 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -60,8 +60,6 @@ Properties +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`bool` | :ref:`meta_underlined` | ``true`` | +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | -+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`int` | :ref:`progress_bar_delay` | ``1000`` | +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`bool` | :ref:`scroll_active` | ``true`` | @@ -95,7 +93,7 @@ Methods ------- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_image` **(** :ref:`Texture2D` image, :ref:`int` width=0, :ref:`int` height=0, :ref:`Color` color=Color(1, 1, 1, 1), :ref:`InlineAlignment` inline_align=5 **)** | +| void | :ref:`add_image` **(** :ref:`Texture2D` image, :ref:`int` width=0, :ref:`int` height=0, :ref:`Color` color=Color(1, 1, 1, 1), :ref:`InlineAlignment` inline_align=5, :ref:`Rect2` region=Rect2(0, 0, 0, 0) **)** | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_text` **(** :ref:`String` text **)** | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -219,61 +217,65 @@ Methods Theme Properties ---------------- -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`default_color` | ``Color(1, 1, 1, 1)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`font_outline_color` | ``Color(1, 1, 1, 1)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`font_selected_color` | ``Color(0, 0, 0, 1)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`font_shadow_color` | ``Color(0, 0, 0, 0)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`selection_color` | ``Color(0.1, 0.1, 1, 0.8)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`table_border` | ``Color(0, 0, 0, 0)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`table_even_row_bg` | ``Color(0, 0, 0, 0)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Color` | :ref:`table_odd_row_bg` | ``Color(0, 0, 0, 0)`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`line_separation` | ``0`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`outline_size` | ``0`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`shadow_offset_x` | ``1`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`shadow_offset_y` | ``1`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`shadow_outline_size` | ``1`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`table_h_separation` | ``3`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`table_v_separation` | ``3`` | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Font` | :ref:`bold_font` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Font` | :ref:`bold_italics_font` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Font` | :ref:`italics_font` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Font` | :ref:`mono_font` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`Font` | :ref:`normal_font` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`bold_font_size` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`bold_italics_font_size` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`italics_font_size` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`mono_font_size` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`int` | :ref:`normal_font_size` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`StyleBox` | :ref:`focus` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ -| :ref:`StyleBox` | :ref:`normal` | | -+---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+ ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`default_color` | ``Color(1, 1, 1, 1)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`font_outline_color` | ``Color(1, 1, 1, 1)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`font_selected_color` | ``Color(0, 0, 0, 0)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`font_shadow_color` | ``Color(0, 0, 0, 0)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`selection_color` | ``Color(0.1, 0.1, 1, 0.8)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`table_border` | ``Color(0, 0, 0, 0)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`table_even_row_bg` | ``Color(0, 0, 0, 0)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`table_odd_row_bg` | ``Color(0, 0, 0, 0)`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`line_separation` | ``0`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`outline_size` | ``0`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`shadow_offset_x` | ``1`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`shadow_offset_y` | ``1`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`shadow_outline_size` | ``1`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`table_h_separation` | ``3`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`table_v_separation` | ``3`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`text_highlight_h_padding` | ``3`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`text_highlight_v_padding` | ``3`` | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Font` | :ref:`bold_font` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Font` | :ref:`bold_italics_font` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Font` | :ref:`italics_font` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Font` | :ref:`mono_font` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`Font` | :ref:`normal_font` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`bold_font_size` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`bold_italics_font_size` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`italics_font_size` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`mono_font_size` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`normal_font_size` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+ Signals ------- @@ -596,22 +598,6 @@ If ``true``, the label underlines meta tags such as ``[url]{text}[/url]``. ---- -.. _class_RichTextLabel_property_override_selected_font_color: - -- :ref:`bool` **override_selected_font_color** - -+-----------+-----------------------------------------+ -| *Default* | ``false`` | -+-----------+-----------------------------------------+ -| *Setter* | set_override_selected_font_color(value) | -+-----------+-----------------------------------------+ -| *Getter* | is_overriding_selected_font_color() | -+-----------+-----------------------------------------+ - -If ``true``, the label uses the custom font color. - ----- - .. _class_RichTextLabel_property_progress_bar_delay: - :ref:`int` **progress_bar_delay** @@ -847,12 +833,14 @@ Method Descriptions .. _class_RichTextLabel_method_add_image: -- void **add_image** **(** :ref:`Texture2D` image, :ref:`int` width=0, :ref:`int` height=0, :ref:`Color` color=Color(1, 1, 1, 1), :ref:`InlineAlignment` inline_align=5 **)** +- void **add_image** **(** :ref:`Texture2D` image, :ref:`int` width=0, :ref:`int` height=0, :ref:`Color` color=Color(1, 1, 1, 1), :ref:`InlineAlignment` inline_align=5, :ref:`Rect2` region=Rect2(0, 0, 0, 0) **)** -Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image and a ``color`` to tint the image. +Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image, a ``color`` to tint the image and a ``region`` to only use parts of the image. If ``width`` or ``height`` is set to 0, the image size will be adjusted in order to keep the original aspect ratio. +If ``width`` and ``height`` are not set, but ``region`` is, the region's rect will be used. + ---- .. _class_RichTextLabel_method_add_text: @@ -1387,10 +1375,10 @@ The default tint of text outline. - :ref:`Color` **font_selected_color** +-----------+-----------------------+ -| *Default* | ``Color(0, 0, 0, 1)`` | +| *Default* | ``Color(0, 0, 0, 0)`` | +-----------+-----------------------+ -The color of selected text, used when :ref:`selection_enabled` is ``true``. +The color of selected text, used when :ref:`selection_enabled` is ``true``. If equal to ``Color(0, 0, 0, 0)``, it will be ignored. ---- @@ -1538,6 +1526,30 @@ The vertical separation of elements in a table. ---- +.. _class_RichTextLabel_theme_constant_text_highlight_h_padding: + +- :ref:`int` **text_highlight_h_padding** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The horizontal padding around a highlighting and background color box. + +---- + +.. _class_RichTextLabel_theme_constant_text_highlight_v_padding: + +- :ref:`int` **text_highlight_v_padding** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The vertical padding around a highlighting and background color box. + +---- + .. _class_RichTextLabel_theme_font_bold_font: - :ref:`Font` **bold_font** diff --git a/classes/class_scenemultiplayer.rst b/classes/class_scenemultiplayer.rst index 1efa86e9a..e63b132df 100644 --- a/classes/class_scenemultiplayer.rst +++ b/classes/class_scenemultiplayer.rst @@ -33,23 +33,53 @@ Properties +---------------------------------+---------------------------------------------------------------------------------------+------------------+ | :ref:`bool` | :ref:`allow_object_decoding` | ``false`` | +---------------------------------+---------------------------------------------------------------------------------------+------------------+ +| :ref:`Callable` | :ref:`auth_callback` | | ++---------------------------------+---------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`auth_timeout` | ``3.0`` | ++---------------------------------+---------------------------------------------------------------------------------------+------------------+ | :ref:`bool` | :ref:`refuse_new_connections` | ``false`` | +---------------------------------+---------------------------------------------------------------------------------------+------------------+ | :ref:`NodePath` | :ref:`root_path` | ``NodePath("")`` | +---------------------------------+---------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`server_relay` | ``true`` | ++---------------------------------+---------------------------------------------------------------------------------------+------------------+ Methods ------- -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`send_bytes` **(** :ref:`PackedByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2, :ref:`int` channel=0 **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`complete_auth` **(** :ref:`int` id **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_peer` **(** :ref:`int` id **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`get_authenticating_peers` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`send_auth` **(** :ref:`int` id, :ref:`PackedByteArray` data **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`send_bytes` **(** :ref:`PackedByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2, :ref:`int` channel=0 **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- +.. _class_SceneMultiplayer_signal_peer_authenticating: + +- **peer_authenticating** **(** :ref:`int` id **)** + +Emitted when this MultiplayerAPI's :ref:`MultiplayerAPI.multiplayer_peer` connects to a new peer and a valid :ref:`auth_callback` is set. In this case, the :ref:`MultiplayerAPI.peer_connected` will not be emitted until :ref:`complete_auth` is called with given peer ``id``. While in this state, the peer will not be included in the list returned by :ref:`MultiplayerAPI.get_peers` (but in the one returned by :ref:`get_authenticating_peers`), and only authentication data will be sent or received. See :ref:`send_auth` for sending authentication data. + +---- + +.. _class_SceneMultiplayer_signal_peer_authentication_failed: + +- **peer_authentication_failed** **(** :ref:`int` id **)** + +Emitted when this MultiplayerAPI's :ref:`MultiplayerAPI.multiplayer_peer` disconnects from a peer for which authentication had not yet completed. See :ref:`peer_authenticating`. + +---- + .. _class_SceneMultiplayer_signal_peer_packet: - **peer_packet** **(** :ref:`int` id, :ref:`PackedByteArray` packet **)** @@ -77,6 +107,36 @@ If ``true``, the MultiplayerAPI will allow encoding and decoding of object durin ---- +.. _class_SceneMultiplayer_property_auth_callback: + +- :ref:`Callable` **auth_callback** + ++----------+--------------------------+ +| *Setter* | set_auth_callback(value) | ++----------+--------------------------+ +| *Getter* | get_auth_callback() | ++----------+--------------------------+ + +The callback to execute when when receiving authentication data sent via :ref:`send_auth`. If the :ref:`Callable` is empty (default), peers will be automatically accepted as soon as they connect. + +---- + +.. _class_SceneMultiplayer_property_auth_timeout: + +- :ref:`float` **auth_timeout** + ++-----------+-------------------------+ +| *Default* | ``3.0`` | ++-----------+-------------------------+ +| *Setter* | set_auth_timeout(value) | ++-----------+-------------------------+ +| *Getter* | get_auth_timeout() | ++-----------+-------------------------+ + +If set to a value greater than ``0.0``, the maximum amount of time peers can stay in the authenticating state, after which the authentication will automatically fail. See the :ref:`peer_authenticating` and :ref:`peer_authentication_failed` signals. + +---- + .. _class_SceneMultiplayer_property_refuse_new_connections: - :ref:`bool` **refuse_new_connections** @@ -109,6 +169,24 @@ The root path to use for RPCs and replication. Instead of an absolute path, a re This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. +---- + +.. _class_SceneMultiplayer_property_server_relay: + +- :ref:`bool` **server_relay** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_server_relay_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_server_relay_enabled() | ++-----------+---------------------------------+ + +Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is ``false``, clients won't be automatically notified of other peers and won't be able to send them packets through the server. + +\ **Note:** Support for this feature may depend on the current :ref:`MultiplayerPeer` configuration. See :ref:`MultiplayerPeer.is_server_relay_supported`. + Method Descriptions ------------------- @@ -120,6 +198,40 @@ Clears the current SceneMultiplayer network state (you shouldn't call this unles ---- +.. _class_SceneMultiplayer_method_complete_auth: + +- :ref:`Error` **complete_auth** **(** :ref:`int` id **)** + +Mark the authentication step as completed for the remote peer identified by ``id``. The :ref:`MultiplayerAPI.peer_connected` signal will be emitted for this peer once the remote side also completes the authentication. No further authentication messages are expected to be received from this peer. + +If a peer disconnects before completing authentication, either due to a network issue, the :ref:`auth_timeout` expiring, or manually calling :ref:`disconnect_peer`, the :ref:`peer_authentication_failed` signal will be emitted instead of :ref:`MultiplayerAPI.peer_disconnected`. + +---- + +.. _class_SceneMultiplayer_method_disconnect_peer: + +- void **disconnect_peer** **(** :ref:`int` id **)** + +Disconnects the peer identified by ``id``, removing it from the list of connected peers, and closing the underlying connection with it. + +---- + +.. _class_SceneMultiplayer_method_get_authenticating_peers: + +- :ref:`PackedInt32Array` **get_authenticating_peers** **(** **)** + +Returns the IDs of the peers currently trying to authenticate with this :ref:`MultiplayerAPI`. + +---- + +.. _class_SceneMultiplayer_method_send_auth: + +- :ref:`Error` **send_auth** **(** :ref:`int` id, :ref:`PackedByteArray` data **)** + +Sends the specified ``data`` to the remote peer identified by ``id`` as part of an authentication message. This can be used to authenticate peers, and control when :ref:`MultiplayerAPI.peer_connected` is emitted (and the remote peer accepted as one of the connected peers). + +---- + .. _class_SceneMultiplayer_method_send_bytes: - :ref:`Error` **send_bytes** **(** :ref:`PackedByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2, :ref:`int` channel=0 **)** diff --git a/classes/class_script.rst b/classes/class_script.rst index 2903550af..3e2716ebc 100644 --- a/classes/class_script.rst +++ b/classes/class_script.rst @@ -19,7 +19,7 @@ A class stored as a resource. Description ----------- -A class stored as a resource. A script extends the functionality of all objects that instance it. +A class stored as a resource. A script extends the functionality of all objects that instantiate it. This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error. diff --git a/classes/class_scrollbar.rst b/classes/class_scrollbar.rst index 71a458487..bd122fbc9 100644 --- a/classes/class_scrollbar.rst +++ b/classes/class_scrollbar.rst @@ -24,9 +24,13 @@ Scrollbars are a :ref:`Range`-based :ref:`Control`, Properties ---------- -+---------------------------+----------------------------------------------------------+----------+ -| :ref:`float` | :ref:`custom_step` | ``-1.0`` | -+---------------------------+----------------------------------------------------------+----------+ ++---------------------------+----------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`custom_step` | ``-1.0`` | ++---------------------------+----------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` (overrides :ref:`Control`) | ++---------------------------+----------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`float` | step | ``0.0`` (overrides :ref:`Range`) | ++---------------------------+----------------------------------------------------------+------------------------------------------------------------------------------+ Signals ------- diff --git a/classes/class_scrollcontainer.rst b/classes/class_scrollcontainer.rst index f99c339b1..9d2dd81f4 100644 --- a/classes/class_scrollcontainer.rst +++ b/classes/class_scrollcontainer.rst @@ -23,7 +23,7 @@ A ScrollContainer node meant to contain a :ref:`Control` child. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar`, :ref:`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 :ref:`Control.custom_minimum_size` of the Control relative to the ScrollContainer. -Works great with a :ref:`Panel` control. You can set ``EXPAND`` 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). +Works great with a :ref:`Panel` control. You can set :ref:`Control.SIZE_EXPAND` 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). Tutorials --------- diff --git a/classes/class_shape2d.rst b/classes/class_shape2d.rst index 4e7a4c226..6ebe7f4dd 100644 --- a/classes/class_shape2d.rst +++ b/classes/class_shape2d.rst @@ -47,6 +47,8 @@ Methods +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Color` color **)** | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_rect` **(** **)** |const| | ++-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -124,6 +126,14 @@ This method needs the transformation matrix for this shape (``local_xform``), th Draws a solid shape onto a :ref:`CanvasItem` with the :ref:`RenderingServer` API filled with the specified ``color``. The exact drawing method is specific for each shape and cannot be configured. +---- + +.. _class_Shape2D_method_get_rect: + +- :ref:`Rect2` **get_rect** **(** **)** |const| + +Returns a :ref:`Rect2` representing the shapes boundary. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_shapecast2d.rst b/classes/class_shapecast2d.rst index e5accbd41..b81c09eab 100644 --- a/classes/class_shapecast2d.rst +++ b/classes/class_shapecast2d.rst @@ -68,6 +68,8 @@ Methods +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider` **(** :ref:`int` index **)** |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_collider_rid` **(** :ref:`int` index **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_shape` **(** :ref:`int` index **)** |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collision_count` **(** **)** |const| | @@ -303,6 +305,14 @@ Returns the collided :ref:`Object` of one of the multiple collisio ---- +.. _class_ShapeCast2D_method_get_collider_rid: + +- :ref:`RID` **get_collider_rid** **(** :ref:`int` index **)** |const| + +Returns the :ref:`RID` of the collided object of one of the multiple collisions at ``index``. + +---- + .. _class_ShapeCast2D_method_get_collider_shape: - :ref:`int` **get_collider_shape** **(** :ref:`int` index **)** |const| diff --git a/classes/class_shapecast3d.rst b/classes/class_shapecast3d.rst index 2f3a5d271..8f01b2e8e 100644 --- a/classes/class_shapecast3d.rst +++ b/classes/class_shapecast3d.rst @@ -70,6 +70,8 @@ Methods +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider` **(** :ref:`int` index **)** |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_collider_rid` **(** :ref:`int` index **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_shape` **(** :ref:`int` index **)** |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collision_count` **(** **)** |const| | @@ -325,6 +327,14 @@ Returns the collided :ref:`Object` of one of the multiple collisio ---- +.. _class_ShapeCast3D_method_get_collider_rid: + +- :ref:`RID` **get_collider_rid** **(** :ref:`int` index **)** |const| + +Returns the :ref:`RID` of the collided object of one of the multiple collisions at ``index``. + +---- + .. _class_ShapeCast3D_method_get_collider_shape: - :ref:`int` **get_collider_shape** **(** :ref:`int` index **)** |const| diff --git a/classes/class_skeletonprofile.rst b/classes/class_skeletonprofile.rst index 264aeb082..eb07b144f 100644 --- a/classes/class_skeletonprofile.rst +++ b/classes/class_skeletonprofile.rst @@ -21,6 +21,11 @@ Description This resource is used in :ref:`EditorScenePostImport`. Some parameters are referring to bones in :ref:`Skeleton3D`, :ref:`Skin`, :ref:`Animation`, and some other nodes are rewritten based on the parameters of ``SkeletonProfile``. +Tutorials +--------- + +- :doc:`Retargeting 3D Skeletons <../tutorials/assets_pipeline/retargeting_3d_skeletons>` + Properties ---------- diff --git a/classes/class_skeletonprofilehumanoid.rst b/classes/class_skeletonprofilehumanoid.rst index a5f1eb148..76486014e 100644 --- a/classes/class_skeletonprofilehumanoid.rst +++ b/classes/class_skeletonprofilehumanoid.rst @@ -19,6 +19,11 @@ Description A :ref:`SkeletonProfile` as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. +Tutorials +--------- + +- :doc:`Retargeting 3D Skeletons <../tutorials/assets_pipeline/retargeting_3d_skeletons>` + Properties ---------- diff --git a/classes/class_slider.rst b/classes/class_slider.rst index 456c804cc..75151a564 100644 --- a/classes/class_slider.rst +++ b/classes/class_slider.rst @@ -26,15 +26,19 @@ Base class for GUI sliders. Properties ---------- -+-------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`editable` | ``true`` | -+-------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`scrollable` | ``true`` | -+-------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`tick_count` | ``0`` | -+-------------------------+-----------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`ticks_on_borders` | ``false`` | -+-------------------------+-----------------------------------------------------------------+-----------+ ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`editable` | ``true`` | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`scrollable` | ``true`` | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` (overrides :ref:`Control`) | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`tick_count` | ``0`` | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`ticks_on_borders` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+------------------------------------------------------------------------------+ Signals ------- diff --git a/classes/class_spinbox.rst b/classes/class_spinbox.rst index 70cb0ad92..92b651123 100644 --- a/classes/class_spinbox.rst +++ b/classes/class_spinbox.rst @@ -62,6 +62,8 @@ Properties +-------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`prefix` | ``""`` | +-------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`select_all_on_focus` | ``false`` | ++-------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`suffix` | ``""`` | +-------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`update_on_text_changed` | ``false`` | @@ -148,6 +150,22 @@ Adds the specified ``prefix`` string before the numerical value of the ``SpinBox ---- +.. _class_SpinBox_property_select_all_on_focus: + +- :ref:`bool` **select_all_on_focus** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_select_all_on_focus(value) | ++-----------+--------------------------------+ +| *Getter* | is_select_all_on_focus() | ++-----------+--------------------------------+ + +If ``true``, the ``SpinBox`` will select the whole text when the :ref:`LineEdit` gains focus. Clicking the up and down arrows won't trigger this behavior. + +---- + .. _class_SpinBox_property_suffix: - :ref:`String` **suffix** diff --git a/classes/class_spotlight3d.rst b/classes/class_spotlight3d.rst index a45b15a97..39342c198 100644 --- a/classes/class_spotlight3d.rst +++ b/classes/class_spotlight3d.rst @@ -58,6 +58,8 @@ Property Descriptions The spotlight's angle in degrees. +\ **Note:** :ref:`spot_angle` is not affected by :ref:`Node3D.scale` (the light's scale or its parent's scale). + ---- .. _class_SpotLight3D_property_spot_angle_attenuation: @@ -106,6 +108,8 @@ The spotlight's light energy attenuation curve. The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the :ref:`spot_attenuation` in use. No matter the :ref:`spot_attenuation` in use, the light will never reach anything outside this range. +\ **Note:** :ref:`spot_range` is not affected by :ref:`Node3D.scale` (the light's scale or its parent's scale). + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_sprite2d.rst b/classes/class_sprite2d.rst index e964be672..117fe1f7e 100644 --- a/classes/class_sprite2d.rst +++ b/classes/class_sprite2d.rst @@ -277,7 +277,9 @@ Method Descriptions - :ref:`Rect2` **get_rect** **(** **)** |const| -Returns a :ref:`Rect2` representing the Sprite2D's boundary in local coordinates. Can be used to detect if the Sprite2D was clicked. Example: +Returns a :ref:`Rect2` representing the Sprite2D's boundary in local coordinates. Can be used to detect if the Sprite2D was clicked. + +\ **Example:**\ .. tabs:: diff --git a/classes/class_standardmaterial3d.rst b/classes/class_standardmaterial3d.rst index 4787de6ad..f54272985 100644 --- a/classes/class_standardmaterial3d.rst +++ b/classes/class_standardmaterial3d.rst @@ -17,7 +17,7 @@ Physically based rendering (PBR) material that can be applied to 3D objects. Description ----------- -StandardMaterial3D's properties are inherited from :ref:`BaseMaterial3D`. +``StandardMaterial3D``'s properties are inherited from :ref:`BaseMaterial3D`. ``StandardMaterial3D`` uses separate textures for ambient occlusion, roughness and metallic maps. To use a single ORM map for all 3 textures, use an :ref:`ORMMaterial3D` instead. Tutorials --------- diff --git a/classes/class_string.rst b/classes/class_string.rst index c0ef6a682..eae665b44 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -38,203 +38,203 @@ Constructors Methods ------- -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`begins_with` **(** :ref:`String` text **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedStringArray` | :ref:`bigrams` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bin_to_int` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`c_escape` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`c_unescape` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`capitalize` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`casecmp_to` **(** :ref:`String` to **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`chr` **(** :ref:`int` char **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`contains` **(** :ref:`String` what **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`count` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`countn` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`dedent` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`ends_with` **(** :ref:`String` text **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`find` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`findn` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_base_dir` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_basename` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_extension` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_file` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_slice` **(** :ref:`String` delimiter, :ref:`int` slice **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_slice_count` **(** :ref:`String` delimiter **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_slicec` **(** :ref:`int` delimiter, :ref:`int` slice **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`hash` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`hex_to_int` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`humanize_size` **(** :ref:`int` size **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`indent` **(** :ref:`String` prefix **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`insert` **(** :ref:`int` position, :ref:`String` what **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_absolute_path` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_relative_path` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_subsequence_of` **(** :ref:`String` text **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_subsequence_ofn` **(** :ref:`String` text **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_filename` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_float` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=false **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_html_color` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_identifier` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_int` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_valid_ip_address` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`join` **(** :ref:`PackedStringArray` parts **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`json_escape` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`left` **(** :ref:`int` length **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`length` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`lpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`lstrip` **(** :ref:`String` chars **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`match` **(** :ref:`String` expr **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`matchn` **(** :ref:`String` expr **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`md5_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`md5_text` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`naturalnocasecmp_to` **(** :ref:`String` to **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`nocasecmp_to` **(** :ref:`String` to **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`num` **(** :ref:`float` number, :ref:`int` decimals=-1 **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`num_int64` **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`num_scientific` **(** :ref:`float` number **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`num_uint64` **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`pad_decimals` **(** :ref:`int` digits **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`pad_zeros` **(** :ref:`int` digits **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`path_join` **(** :ref:`String` file **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`repeat` **(** :ref:`int` count **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`replace` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`replacen` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rfind` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rfindn` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`right` **(** :ref:`int` length **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`rpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`rstrip` **(** :ref:`String` chars **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`sha1_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`sha1_text` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`sha256_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`sha256_text` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`similarity` **(** :ref:`String` text **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`simplify_path` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedStringArray` | :ref:`split` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedFloat32Array` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=true, :ref:`bool` right=true **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`strip_escapes` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`substr` **(** :ref:`int` from, :ref:`int` len=-1 **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`to_ascii_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_camel_case` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`to_float` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`to_int` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_lower` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_pascal_case` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_snake_case` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_upper` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`to_utf16_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`to_utf32_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`to_utf8_buffer` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`trim_prefix` **(** :ref:`String` prefix **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`trim_suffix` **(** :ref:`String` suffix **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`unicode_at` **(** :ref:`int` at **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`uri_decode` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`uri_encode` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`validate_node_name` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`xml_escape` **(** :ref:`bool` escape_quotes=false **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`xml_unescape` **(** **)** |const| | -+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`begins_with` **(** :ref:`String` text **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`bigrams` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bin_to_int` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`c_escape` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`c_unescape` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`capitalize` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`casecmp_to` **(** :ref:`String` to **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`chr` **(** :ref:`int` char **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`contains` **(** :ref:`String` what **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`countn` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`dedent` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`ends_with` **(** :ref:`String` text **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`findn` **(** :ref:`String` what, :ref:`int` from=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_base_dir` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_basename` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_extension` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_slice` **(** :ref:`String` delimiter, :ref:`int` slice **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_slice_count` **(** :ref:`String` delimiter **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_slicec` **(** :ref:`int` delimiter, :ref:`int` slice **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hex_to_int` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`humanize_size` **(** :ref:`int` size **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`indent` **(** :ref:`String` prefix **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`insert` **(** :ref:`int` position, :ref:`String` what **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_absolute_path` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_relative_path` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_subsequence_of` **(** :ref:`String` text **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_subsequence_ofn` **(** :ref:`String` text **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_filename` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_float` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=false **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_html_color` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_identifier` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_int` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_ip_address` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`join` **(** :ref:`PackedStringArray` parts **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`json_escape` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`left` **(** :ref:`int` length **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`length` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`lpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`lstrip` **(** :ref:`String` chars **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`match` **(** :ref:`String` expr **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`matchn` **(** :ref:`String` expr **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`md5_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`md5_text` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`naturalnocasecmp_to` **(** :ref:`String` to **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`nocasecmp_to` **(** :ref:`String` to **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`num` **(** :ref:`float` number, :ref:`int` decimals=-1 **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`num_int64` **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`num_scientific` **(** :ref:`float` number **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`num_uint64` **(** :ref:`int` number, :ref:`int` base=10, :ref:`bool` capitalize_hex=false **)** |static| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`pad_decimals` **(** :ref:`int` digits **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`pad_zeros` **(** :ref:`int` digits **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`path_join` **(** :ref:`String` file **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`repeat` **(** :ref:`int` count **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`replace` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`replacen` **(** :ref:`String` what, :ref:`String` forwhat **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfindn` **(** :ref:`String` what, :ref:`int` from=-1 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`right` **(** :ref:`int` length **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rpad` **(** :ref:`int` min_length, :ref:`String` character=" " **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rstrip` **(** :ref:`String` chars **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`sha1_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`sha1_text` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`sha256_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`sha256_text` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`similarity` **(** :ref:`String` text **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`simplify_path` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`split` **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedFloat32Array` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=true, :ref:`bool` right=true **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`strip_escapes` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`substr` **(** :ref:`int` from, :ref:`int` len=-1 **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`to_ascii_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_camel_case` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`to_float` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_int` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_lower` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_pascal_case` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_snake_case` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_upper` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`to_utf16_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`to_utf32_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`to_utf8_buffer` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`trim_prefix` **(** :ref:`String` prefix **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`trim_suffix` **(** :ref:`String` suffix **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`unicode_at` **(** :ref:`int` at **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`uri_decode` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`uri_encode` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`validate_node_name` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`xml_escape` **(** :ref:`bool` escape_quotes=false **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`xml_unescape` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Operators --------- @@ -248,8 +248,6 @@ Operators +-----------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`operator +` **(** :ref:`String` right **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`operator +` **(** :ref:`int` right **)** | -+-----------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator \<` **(** :ref:`String` right **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator \<=` **(** :ref:`String` right **)** | @@ -541,7 +539,7 @@ Splits a string using a ``delimiter`` and returns a substring at index ``slice`` This is a more performant alternative to :ref:`split` for cases when you need only one element from the array at a fixed index. -Example: +\ **Example:**\ :: @@ -699,7 +697,7 @@ Returns ``true`` if this string contains a valid float. This is inclusive of int - :ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=false **)** |const| -Returns ``true`` if this string contains a valid hexadecimal number. If ``with_prefix`` is ``true``, then a validity of the hexadecimal number is determined by ``0x`` prefix, for instance: ``0xDEADC0DE``. +Returns ``true`` if this string contains a valid hexadecimal number. If ``with_prefix`` is ``true``, then a validity of the hexadecimal number is determined by the ``0x`` prefix, for example: ``0xDEADC0DE``. ---- @@ -755,7 +753,7 @@ Returns ``true`` if this string contains only a well-formatted IPv4 or IPv6 addr Returns a ``String`` which is the concatenation of the ``parts``. The separator between elements is the string providing this method. -Example: +\ **Example:**\ .. tabs:: @@ -786,7 +784,7 @@ Returns a copy of the string with special characters escaped using the JSON stan Returns a number of characters from the left of the string. If negative ``length`` is used, the characters are counted downwards from ``String``'s length. -Examples: +\ **Example:**\ :: @@ -893,7 +891,7 @@ The number of decimal places can be specified with ``decimals``. If ``decimals`` Trailing zeros are not included in the string. The last digit will be rounded and not truncated. -Some examples: +\ **Example:**\ :: @@ -1001,7 +999,7 @@ Returns the index of the **last** case-insensitive occurrence of the specified s Returns a number of characters from the right of the string. If negative ``length`` is used, the characters are counted downwards from ``String``'s length. -Examples: +\ **Example:**\ :: @@ -1020,9 +1018,9 @@ Formats a string to be at least ``min_length`` long by adding ``character``\ s t .. _class_String_method_rsplit: -- :ref:`PackedStringArray` **rsplit** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| +- :ref:`PackedStringArray` **rsplit** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| -Splits the string by a ``delimiter`` string and returns an array of the substrings, starting from right. +Splits the string by a ``delimiter`` string and returns an array of the substrings, starting from right. If ``delimiter`` is an empty string, each substring will be a single character. The splits in the returned array are sorted in the same order as the original string, from left to right. @@ -1030,7 +1028,7 @@ If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the str If ``maxsplit`` is specified, it defines the number of splits to do from the right up to ``maxsplit``. The default value of 0 means that all items are split, thus giving the same result as :ref:`split`. -Example: +\ **Example:**\ .. tabs:: @@ -1118,9 +1116,9 @@ Returns a simplified canonical path. .. _class_String_method_split: -- :ref:`PackedStringArray` **split** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| +- :ref:`PackedStringArray` **split** **(** :ref:`String` delimiter="", :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** |const| -Splits the string by a ``delimiter`` string and returns an array of the substrings. The ``delimiter`` can be of any length. +Splits the string by a ``delimiter`` string and returns an array of the substrings. The ``delimiter`` can be of any length. If ``delimiter`` is an empty string, each substring will be a single character. If ``allow_empty`` is ``true``, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. @@ -1128,7 +1126,7 @@ If ``maxsplit`` is specified, it defines the number of splits to do from the lef If you need only one element from the array at a specific index, :ref:`get_slice` is a more performant option. -Example: +\ **Example:**\ .. tabs:: @@ -1404,10 +1402,6 @@ Operator Descriptions ---- -- :ref:`String` **operator +** **(** :ref:`int` right **)** - ----- - .. _class_String_operator_lt_bool: - :ref:`bool` **operator <** **(** :ref:`String` right **)** diff --git a/classes/class_stylebox.rst b/classes/class_stylebox.rst index b4509de21..16bfebf56 100644 --- a/classes/class_stylebox.rst +++ b/classes/class_stylebox.rst @@ -26,15 +26,15 @@ StyleBox is :ref:`Resource` that provides an abstract base class Properties ---------- -+---------------------------+-----------------------------------------------------------------------------+ -| :ref:`float` | :ref:`content_margin_bottom` | -+---------------------------+-----------------------------------------------------------------------------+ -| :ref:`float` | :ref:`content_margin_left` | -+---------------------------+-----------------------------------------------------------------------------+ -| :ref:`float` | :ref:`content_margin_right` | -+---------------------------+-----------------------------------------------------------------------------+ -| :ref:`float` | :ref:`content_margin_top` | -+---------------------------+-----------------------------------------------------------------------------+ ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_bottom` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_left` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_right` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_top` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ Methods ------- @@ -78,11 +78,13 @@ Property Descriptions - :ref:`float` **content_margin_bottom** -+----------+---------------------------+ -| *Setter* | set_default_margin(value) | -+----------+---------------------------+ -| *Getter* | get_default_margin() | -+----------+---------------------------+ ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *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. @@ -98,11 +100,13 @@ It is up to the code using this style box to decide what these contents are: for - :ref:`float` **content_margin_left** -+----------+---------------------------+ -| *Setter* | set_default_margin(value) | -+----------+---------------------------+ -| *Getter* | get_default_margin() | -+----------+---------------------------+ ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *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. @@ -114,11 +118,13 @@ Refer to :ref:`content_margin_bottom` **content_margin_right** -+----------+---------------------------+ -| *Setter* | set_default_margin(value) | -+----------+---------------------------+ -| *Getter* | get_default_margin() | -+----------+---------------------------+ ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *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. @@ -130,11 +136,13 @@ Refer to :ref:`content_margin_bottom` **content_margin_top** -+----------+---------------------------+ -| *Setter* | set_default_margin(value) | -+----------+---------------------------+ -| *Getter* | get_default_margin() | -+----------+---------------------------+ ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *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. diff --git a/classes/class_styleboxflat.rst b/classes/class_styleboxflat.rst index 1dff13281..a29966d5e 100644 --- a/classes/class_styleboxflat.rst +++ b/classes/class_styleboxflat.rst @@ -27,7 +27,9 @@ This :ref:`StyleBox` can be used to achieve all kinds of looks w - Shadow (with blur and offset) -Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. Example: +Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. + +\ **Example:**\ :: diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst index ff41257cf..859df7c41 100644 --- a/classes/class_surfacetool.rst +++ b/classes/class_surfacetool.rst @@ -149,21 +149,21 @@ Enumerations enum **CustomFormat**: -- **CUSTOM_RGBA8_UNORM** = **0** --- Limits range of data passed to `set_custom` to unsigned normalized 0 to 1 stored in 8 bits per channel. See :ref:`Mesh.ARRAY_CUSTOM_RGBA8_UNORM`. +- **CUSTOM_RGBA8_UNORM** = **0** --- Limits range of data passed to :ref:`set_custom` to unsigned normalized 0 to 1 stored in 8 bits per channel. See :ref:`Mesh.ARRAY_CUSTOM_RGBA8_UNORM`. -- **CUSTOM_RGBA8_SNORM** = **1** --- Limits range of data passed to `set_custom` to signed normalized -1 to 1 stored in 8 bits per channel. See :ref:`Mesh.ARRAY_CUSTOM_RGBA8_SNORM`. +- **CUSTOM_RGBA8_SNORM** = **1** --- Limits range of data passed to :ref:`set_custom` to signed normalized -1 to 1 stored in 8 bits per channel. See :ref:`Mesh.ARRAY_CUSTOM_RGBA8_SNORM`. -- **CUSTOM_RG_HALF** = **2** --- Stores data passed to `set_custom` as half precision floats, and uses only red and green color channels. See :ref:`Mesh.ARRAY_CUSTOM_RG_HALF`. +- **CUSTOM_RG_HALF** = **2** --- Stores data passed to :ref:`set_custom` as half precision floats, and uses only red and green color channels. See :ref:`Mesh.ARRAY_CUSTOM_RG_HALF`. -- **CUSTOM_RGBA_HALF** = **3** --- Stores data passed to `set_custom` as half precision floats and uses all color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGBA_HALF`. +- **CUSTOM_RGBA_HALF** = **3** --- Stores data passed to :ref:`set_custom` as half precision floats and uses all color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGBA_HALF`. -- **CUSTOM_R_FLOAT** = **4** --- Stores data passed to `set_custom` as full precision floats, and uses only red color channel. See :ref:`Mesh.ARRAY_CUSTOM_R_FLOAT`. +- **CUSTOM_R_FLOAT** = **4** --- Stores data passed to :ref:`set_custom` as full precision floats, and uses only red color channel. See :ref:`Mesh.ARRAY_CUSTOM_R_FLOAT`. -- **CUSTOM_RG_FLOAT** = **5** --- Stores data passed to `set_custom` as full precision floats, and uses only red and green color channels. See :ref:`Mesh.ARRAY_CUSTOM_RG_FLOAT`. +- **CUSTOM_RG_FLOAT** = **5** --- Stores data passed to :ref:`set_custom` as full precision floats, and uses only red and green color channels. See :ref:`Mesh.ARRAY_CUSTOM_RG_FLOAT`. -- **CUSTOM_RGB_FLOAT** = **6** --- Stores data passed to `set_custom` as full precision floats, and uses only red, green and blue color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGB_FLOAT`. +- **CUSTOM_RGB_FLOAT** = **6** --- Stores data passed to :ref:`set_custom` as full precision floats, and uses only red, green and blue color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGB_FLOAT`. -- **CUSTOM_RGBA_FLOAT** = **7** --- Stores data passed to `set_custom` as full precision floats, and uses all color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGBA_FLOAT`. +- **CUSTOM_RGBA_FLOAT** = **7** --- Stores data passed to :ref:`set_custom` as full precision floats, and uses all color channels. See :ref:`Mesh.ARRAY_CUSTOM_RGBA_FLOAT`. - **CUSTOM_MAX** = **8** --- Used to indicate a disabled custom channel. @@ -294,6 +294,8 @@ Generates normals from vertices so you do not have to do it manually. If ``flip` \ **Note:** :ref:`generate_normals` only works if the primitive type to be set to :ref:`Mesh.PRIMITIVE_TRIANGLES`. +\ **Note:** :ref:`generate_normals` takes smooth groups into account. If you don't specify any smooth group for each vertex, :ref:`generate_normals` will smooth normals for you. + ---- .. _class_SurfaceTool_method_generate_tangents: diff --git a/classes/class_systemfont.rst b/classes/class_systemfont.rst index 9edc22807..487386111 100644 --- a/classes/class_systemfont.rst +++ b/classes/class_systemfont.rst @@ -211,7 +211,7 @@ Font oversampling factor, if set to ``0.0`` global oversampling factor is used i | *Getter* | get_subpixel_positioning() | +-----------+---------------------------------+ -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 :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO` to automatically enable it based on the font size. +Font glyph subpixel 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 :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO` to automatically enable it based on the font size. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_tabcontainer.rst b/classes/class_tabcontainer.rst index dd8cf7bfa..1cac5558c 100644 --- a/classes/class_tabcontainer.rst +++ b/classes/class_tabcontainer.rst @@ -547,7 +547,7 @@ The size of the tab text outline. The space at the left or right edges of the tab bar, accordingly with the current :ref:`tab_alignment`. -The margin is ignored with ``ALIGNMENT_RIGHT`` if the tabs are clipped (see :ref:`clip_tabs`) or a popup has been set (see :ref:`set_popup`). The margin is always ignored with ``ALIGNMENT_CENTER``. +The margin is ignored with :ref:`TabBar.ALIGNMENT_RIGHT` if the tabs are clipped (see :ref:`clip_tabs`) or a popup has been set (see :ref:`set_popup`). The margin is always ignored with :ref:`TabBar.ALIGNMENT_CENTER`. ---- diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index 503105558..8af85c5e0 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -71,8 +71,6 @@ Properties +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`CursorShape` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control`) | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | -+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`placeholder_text` | ``""`` | +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`scroll_fit_content_height` | ``false`` | @@ -124,8 +122,12 @@ Methods +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`add_caret` **(** :ref:`int` line, :ref:`int` col **)** | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_caret_at_carets` **(** :ref:`bool` below **)** | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_gutter` **(** :ref:`int` at=-1 **)** | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_selection_for_next_occurrence` **(** **)** | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`adjust_carets_after_edit` **(** :ref:`int` caret, :ref:`int` from_line, :ref:`int` from_col, :ref:`int` to_line, :ref:`int` to_col **)** | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`adjust_viewport_to_caret` **(** :ref:`int` caret_index=0 **)** | @@ -176,6 +178,8 @@ Methods +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_gutter_width` **(** :ref:`int` gutter **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`HScrollBar` | :ref:`get_h_scroll_bar` **(** **)** |const| | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_indent_level` **(** :ref:`int` line **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_last_full_visible_line` **(** **)** |const| | @@ -252,6 +256,8 @@ Methods +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_total_visible_line_count` **(** **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VScrollBar` | :ref:`get_v_scroll_bar` **(** **)** |const| | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_version` **(** **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_visible_line_count` **(** **)** |const| | @@ -401,7 +407,7 @@ Theme Properties +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_readonly_color` | ``Color(0.875, 0.875, 0.875, 0.5)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ -| :ref:`Color` | :ref:`font_selected_color` | ``Color(1, 1, 1, 1)`` | +| :ref:`Color` | :ref:`font_selected_color` | ``Color(0, 0, 0, 0)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`search_result_border_color` | ``Color(0.3, 0.3, 0.3, 0.4)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ @@ -1039,22 +1045,6 @@ The width, in pixels, of the minimap. ---- -.. _class_TextEdit_property_override_selected_font_color: - -- :ref:`bool` **override_selected_font_color** - -+-----------+-----------------------------------------+ -| *Default* | ``false`` | -+-----------+-----------------------------------------+ -| *Setter* | set_override_selected_font_color(value) | -+-----------+-----------------------------------------+ -| *Getter* | is_overriding_selected_font_color() | -+-----------+-----------------------------------------+ - -If ``true``, custom ``font_selected_color`` will be used for selected text. - ----- - .. _class_TextEdit_property_placeholder_text: - :ref:`String` **placeholder_text** @@ -1370,6 +1360,14 @@ Adds a new caret at the given location. Returns the index of the new caret, or ` ---- +.. _class_TextEdit_method_add_caret_at_carets: + +- void **add_caret_at_carets** **(** :ref:`bool` below **)** + +Adds an additional caret above or below every caret. If ``below`` is true the new caret will be added below and above otherwise. + +---- + .. _class_TextEdit_method_add_gutter: - void **add_gutter** **(** :ref:`int` at=-1 **)** @@ -1378,6 +1376,14 @@ Register a new gutter to this ``TextEdit``. Use ``at`` to have a specific gutter ---- +.. _class_TextEdit_method_add_selection_for_next_occurrence: + +- void **add_selection_for_next_occurrence** **(** **)** + +Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret. + +---- + .. _class_TextEdit_method_adjust_carets_after_edit: - void **adjust_carets_after_edit** **(** :ref:`int` caret, :ref:`int` from_line, :ref:`int` from_col, :ref:`int` to_line, :ref:`int` to_col **)** @@ -1578,6 +1584,14 @@ Returns the width of the gutter at the given index. ---- +.. _class_TextEdit_method_get_h_scroll_bar: + +- :ref:`HScrollBar` **get_h_scroll_bar** **(** **)** |const| + +Returns the :ref:`HScrollBar` used by ``TextEdit``. + +---- + .. _class_TextEdit_method_get_indent_level: - :ref:`int` **get_indent_level** **(** :ref:`int` line **)** |const| @@ -1888,6 +1902,14 @@ Returns the number of lines that may be drawn. ---- +.. _class_TextEdit_method_get_v_scroll_bar: + +- :ref:`VScrollBar` **get_v_scroll_bar** **(** **)** |const| + +Returns the :ref:`VScrollBar` of the ``TextEdit``. + +---- + .. _class_TextEdit_method_get_version: - :ref:`int` **get_version** **(** **)** |const| @@ -2549,10 +2571,10 @@ Sets the font :ref:`Color` when :ref:`editable` **font_selected_color** +-----------+-----------------------+ -| *Default* | ``Color(1, 1, 1, 1)`` | +| *Default* | ``Color(0, 0, 0, 0)`` | +-----------+-----------------------+ -Sets the :ref:`Color` of the selected text. :ref:`override_selected_font_color` has to be enabled. +Sets the :ref:`Color` of the selected text. If equal to ``Color(0, 0, 0, 0)``, it will be ignored. ---- diff --git a/classes/class_textline.rst b/classes/class_textline.rst index a4ab2ad13..d50b2478b 100644 --- a/classes/class_textline.rst +++ b/classes/class_textline.rst @@ -96,6 +96,8 @@ Property Descriptions | *Getter* | get_horizontal_alignment() | +-----------+---------------------------------+ +Sets text alignment within the line as if the line was horizontal. + ---- .. _class_TextLine_property_direction: diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index e3720418e..ce635cd82 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -413,9 +413,9 @@ enum **FontAntialiasing**: - **FONT_ANTIALIASING_LCD** = **2** --- Font glyphs are rasterized for LCD screens. -LCD sub-pixel layout is determined by the value of ``gui/theme/lcd_subpixel_layout`` project settings. +LCD subpixel layout is determined by the value of ``gui/theme/lcd_subpixel_layout`` project settings. -LCD sub-pixel anti-aliasing mode is suitable only for rendering horizontal, unscaled text in 2D. +LCD subpixel anti-aliasing mode is suitable only for rendering horizontal, unscaled text in 2D. ---- @@ -435,15 +435,15 @@ LCD sub-pixel anti-aliasing mode is suitable only for rendering horizontal, unsc enum **FontLCDSubpixelLayout**: -- **FONT_LCD_SUBPIXEL_LAYOUT_NONE** = **0** --- Unknown or unsupported sub-pixel layout, LCD sub-pixel anti-aliasing is disabled. +- **FONT_LCD_SUBPIXEL_LAYOUT_NONE** = **0** --- Unknown or unsupported subpixel layout, LCD subpixel antialiasing is disabled. -- **FONT_LCD_SUBPIXEL_LAYOUT_HRGB** = **1** --- Horizontal RGB sub-pixel layout. +- **FONT_LCD_SUBPIXEL_LAYOUT_HRGB** = **1** --- Horizontal RGB subpixel layout. -- **FONT_LCD_SUBPIXEL_LAYOUT_HBGR** = **2** --- Horizontal BGR sub-pixel layout. +- **FONT_LCD_SUBPIXEL_LAYOUT_HBGR** = **2** --- Horizontal BGR subpixel layout. -- **FONT_LCD_SUBPIXEL_LAYOUT_VRGB** = **3** --- Vertical RGB sub-pixel layout. +- **FONT_LCD_SUBPIXEL_LAYOUT_VRGB** = **3** --- Vertical RGB subpixel layout. -- **FONT_LCD_SUBPIXEL_LAYOUT_VBGR** = **4** --- Vertical BGR sub-pixel layout. +- **FONT_LCD_SUBPIXEL_LAYOUT_VBGR** = **4** --- Vertical BGR subpixel layout. - **FONT_LCD_SUBPIXEL_LAYOUT_MAX** = **5** @@ -903,7 +903,7 @@ flags **FontStyle**: enum **StructuredTextParser**: -- **STRUCTURED_TEXT_DEFAULT** = **0** --- Use default behavior. Same as ``STRUCTURED_TEXT_NONE`` unless specified otherwise in the control description. +- **STRUCTURED_TEXT_DEFAULT** = **0** --- Use default behavior. Same as :ref:`STRUCTURED_TEXT_NONE` unless specified otherwise in the control description. - **STRUCTURED_TEXT_URI** = **1** --- BiDi override for URI. @@ -1306,7 +1306,7 @@ Returns font style name. - :ref:`SubpixelPositioning` **font_get_subpixel_positioning** **(** :ref:`RID` font_rid **)** |const| -Returns font sub-pixel glyph positioning mode. +Returns font subpixel glyph positioning mode. ---- @@ -1338,7 +1338,7 @@ Returns font cache texture image data. - :ref:`PackedInt32Array` **font_get_texture_offsets** **(** :ref:`RID` font_rid, :ref:`Vector2i` size, :ref:`int` texture_index **)** |const| -Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. +Returns array containing glyph packing data. ---- @@ -1716,7 +1716,7 @@ Sets the font style name. - void **font_set_subpixel_positioning** **(** :ref:`RID` font_rid, :ref:`SubpixelPositioning` subpixel_positioning **)** -Sets font sub-pixel glyph positioning mode. +Sets font subpixel glyph positioning mode. ---- @@ -1732,7 +1732,7 @@ Sets font cache texture image data. - void **font_set_texture_offsets** **(** :ref:`RID` font_rid, :ref:`Vector2i` size, :ref:`int` texture_index, :ref:`PackedInt32Array` offset **)** -Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. +Sets array containing glyph packing data. ---- @@ -2350,7 +2350,7 @@ Sets custom punctuation character list, used for word breaking. If set to empty - void **shaped_text_set_direction** **(** :ref:`RID` shaped, :ref:`Direction` direction=0 **)** -Sets desired text direction. If set to ``TEXT_DIRECTION_AUTO``, direction will be detected based on the buffer contents and current locale. +Sets desired text direction. If set to :ref:`DIRECTION_AUTO`, direction will be detected based on the buffer contents and current locale. \ **Note:** Direction is ignored if server does not support :ref:`FEATURE_BIDI_LAYOUT` feature (supported by :ref:`TextServerAdvanced`). diff --git a/classes/class_texture2d.rst b/classes/class_texture2d.rst index 9dccb6ac6..787211511 100644 --- a/classes/class_texture2d.rst +++ b/classes/class_texture2d.rst @@ -35,7 +35,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_draw_rect` **(** :ref:`RID` to_canvas_item, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate, :ref:`bool` transpose **)** |virtual| |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`_draw_rect_region` **(** :ref:`RID` tp_canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate, :ref:`bool` transpose, :ref:`bool` clip_uv **)** |virtual| |const| | +| void | :ref:`_draw_rect_region` **(** :ref:`RID` to_canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate, :ref:`bool` transpose, :ref:`bool` clip_uv **)** |virtual| |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_height` **(** **)** |virtual| |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -79,7 +79,7 @@ Method Descriptions .. _class_Texture2D_method__draw_rect_region: -- void **_draw_rect_region** **(** :ref:`RID` tp_canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate, :ref:`bool` transpose, :ref:`bool` clip_uv **)** |virtual| |const| +- void **_draw_rect_region** **(** :ref:`RID` to_canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate, :ref:`bool` transpose, :ref:`bool` clip_uv **)** |virtual| |const| ---- diff --git a/classes/class_textureprogressbar.rst b/classes/class_textureprogressbar.rst index 5e41fb7bc..ed27f8e0d 100644 --- a/classes/class_textureprogressbar.rst +++ b/classes/class_textureprogressbar.rst @@ -22,39 +22,41 @@ TextureProgressBar works like :ref:`ProgressBar`, but uses up Properties ---------- -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`fill_mode` | ``0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`bool` | :ref:`nine_patch_stretch` | ``false`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Vector2` | :ref:`radial_center_offset` | ``Vector2(0, 0)`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`radial_fill_degrees` | ``360.0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`float` | :ref:`radial_initial_angle` | ``0.0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`stretch_margin_bottom` | ``0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`stretch_margin_left` | ``0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`stretch_margin_right` | ``0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`int` | :ref:`stretch_margin_top` | ``0`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Texture2D` | :ref:`texture_over` | | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Texture2D` | :ref:`texture_progress` | | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Vector2` | :ref:`texture_progress_offset` | ``Vector2(0, 0)`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Texture2D` | :ref:`texture_under` | | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`tint_over` | ``Color(1, 1, 1, 1)`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`tint_progress` | ``Color(1, 1, 1, 1)`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ -| :ref:`Color` | :ref:`tint_under` | ``Color(1, 1, 1, 1)`` | -+-----------------------------------+-------------------------------------------------------------------------------------------+-----------------------+ ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`int` | :ref:`fill_mode` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``1`` (overrides :ref:`Control`) | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`bool` | :ref:`nine_patch_stretch` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`radial_center_offset` | ``Vector2(0, 0)`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`float` | :ref:`radial_fill_degrees` | ``360.0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`float` | :ref:`radial_initial_angle` | ``0.0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`int` | :ref:`stretch_margin_bottom` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`int` | :ref:`stretch_margin_left` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`int` | :ref:`stretch_margin_right` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`int` | :ref:`stretch_margin_top` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Texture2D` | :ref:`texture_over` | | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Texture2D` | :ref:`texture_progress` | | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`texture_progress_offset` | ``Vector2(0, 0)`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Texture2D` | :ref:`texture_under` | | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Color` | :ref:`tint_over` | ``Color(1, 1, 1, 1)`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Color` | :ref:`tint_progress` | ``Color(1, 1, 1, 1)`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ +| :ref:`Color` | :ref:`tint_under` | ``Color(1, 1, 1, 1)`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ Methods ------- diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index 688aaeb96..6cdfbf6b7 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -229,7 +229,7 @@ Show or hide the TileMap's collision shapes. If set to :ref:`VISIBILITY_MODE_DEF | *Getter* | get_navigation_visibility_mode() | +-----------+---------------------------------------+ -Show or hide the TileMap's collision shapes. If set to :ref:`VISIBILITY_MODE_DEFAULT`, this depends on the show navigation debug settings. +Show or hide the TileMap's navigation meshes. If set to :ref:`VISIBILITY_MODE_DEFAULT`, this depends on the show navigation debug settings. ---- diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index e850bca88..2ff49e7d1 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -23,8 +23,6 @@ Tiles can either be from a :ref:`TileSetAtlasSource`, Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID and their alternative tile ID. - - A TileSet can be configured so that its tiles expose more or less properties. To do so, the TileSet resources uses property layers, that you can add or remove depending on your needs. For example, adding a physics layer allows giving collision shapes to your tiles. Each layer having dedicated properties (physics layer an mask), you may add several TileSet physics layers for each type of collision you need. diff --git a/classes/class_tilesetatlassource.rst b/classes/class_tilesetatlassource.rst index bed2935d3..2892eb5b4 100644 --- a/classes/class_tilesetatlassource.rst +++ b/classes/class_tilesetatlassource.rst @@ -21,12 +21,8 @@ An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas. - - Alternatives version of a tile can be created using :ref:`create_alternative_tile`, which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0. - - Each tile alternate has a set of properties that is defined by the source's :ref:`TileSet` layers. Those properties are stored in a TileData object that can be accessed and modified using :ref:`get_tile_data`. As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using ``TileSetAtlasSource.set("://")``. diff --git a/classes/class_tilesetsource.rst b/classes/class_tilesetsource.rst index 1a3fc78b7..1295377a3 100644 --- a/classes/class_tilesetsource.rst +++ b/classes/class_tilesetsource.rst @@ -25,8 +25,6 @@ Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) an Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base ``TileSetSource`` class only exposes getters for them. - - You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using :ref:`get_tiles_count` and :ref:`get_tile_id`, then over alternative IDs using :ref:`get_alternative_tiles_count` and :ref:`get_alternative_tile_id`. Methods diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst index a80c395e7..64ac8a7bc 100644 --- a/classes/class_transform2d.rst +++ b/classes/class_transform2d.rst @@ -80,6 +80,8 @@ Methods +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Transform2D` xform **)** |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`looking_at` **(** :ref:`Vector2` target=Vector2(0, 0) **)** |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`orthonormalized` **(** **)** |const| | @@ -298,6 +300,14 @@ Returns ``true`` if this transform and ``transform`` are approximately equal, by ---- +.. _class_Transform2D_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this transform is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Transform2D_method_looking_at: - :ref:`Transform2D` **looking_at** **(** :ref:`Vector2` target=Vector2(0, 0) **)** |const| diff --git a/classes/class_transform3d.rst b/classes/class_transform3d.rst index b60105267..28ac71ca7 100644 --- a/classes/class_transform3d.rst +++ b/classes/class_transform3d.rst @@ -70,6 +70,8 @@ Methods +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Transform3D` xform **)** |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform3D` | :ref:`looking_at` **(** :ref:`Vector3` target, :ref:`Vector3` up=Vector3(0, 1, 0) **)** |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform3D` | :ref:`orthonormalized` **(** **)** |const| | @@ -220,6 +222,14 @@ Returns ``true`` if this transform and ``transform`` are approximately equal, by ---- +.. _class_Transform3D_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this transform is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Transform3D_method_looking_at: - :ref:`Transform3D` **looking_at** **(** :ref:`Vector3` target, :ref:`Vector3` up=Vector3(0, 1, 0) **)** |const| diff --git a/classes/class_tree.rst b/classes/class_tree.rst index f3dbea229..0290e7ac5 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -874,7 +874,7 @@ Causes the ``Tree`` to jump to the specified :ref:`TreeItem`. - void **set_column_custom_minimum_width** **(** :ref:`int` column, :ref:`int` min_width **)** -Overrides the calculated minimum width of a column. It can be set to `0` to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio`. +Overrides the calculated minimum width of a column. It can be set to ``0`` to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio`. ---- diff --git a/classes/class_treeitem.rst b/classes/class_treeitem.rst index e7862d9fa..d30ae6e69 100644 --- a/classes/class_treeitem.rst +++ b/classes/class_treeitem.rst @@ -154,6 +154,8 @@ Methods +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_button` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture2D` button **)** | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_button_color` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Color` color **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_button_disabled` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_cell_mode` **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** | @@ -776,6 +778,14 @@ Sets the given column's button :ref:`Texture2D` at index ``butt ---- +.. _class_TreeItem_method_set_button_color: + +- void **set_button_color** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Color` color **)** + +Sets the given column's button color at index ``button_idx`` to ``color``. + +---- + .. _class_TreeItem_method_set_button_disabled: - void **set_button_disabled** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** diff --git a/classes/class_tween.rst b/classes/class_tween.rst index d2438ac36..2a107dc24 100644 --- a/classes/class_tween.rst +++ b/classes/class_tween.rst @@ -434,7 +434,9 @@ Aborts all tweening operations and invalidates the ``Tween``. - :ref:`Tween` **parallel** **(** **)** -Makes the next :ref:`Tweener` run parallelly to the previous one. Example: +Makes the next :ref:`Tweener` run parallelly to the previous one. + +\ **Example:**\ .. tabs:: @@ -555,7 +557,7 @@ Stops the tweening and resets the ``Tween`` to its initial state. This will not Creates and appends a :ref:`CallbackTweener`. This method can be used to call an arbitrary method in any object. Use :ref:`Callable.bind` to bind additional arguments for the call. -Example: object that keeps shooting every 1 second. +\ **Example:** Object that keeps shooting every 1 second: .. tabs:: @@ -572,7 +574,7 @@ Example: object that keeps shooting every 1 second. -Example: turning a sprite red and then blue, with 2 second delay. +\ **Example:** Turning a sprite red and then blue, with 2 second delay: .. tabs:: @@ -600,7 +602,7 @@ Example: turning a sprite red and then blue, with 2 second delay. Creates and appends an :ref:`IntervalTweener`. This method can be used to create delays in the tween animation, as an alternative to using the delay in other :ref:`Tweener`\ s, or when there's no animation (in which case the ``Tween`` acts as a timer). ``time`` is the length of the interval, in seconds. -Example: creating an interval in code execution. +\ **Example:** Creating an interval in code execution: .. tabs:: @@ -619,7 +621,7 @@ Example: creating an interval in code execution. -Example: creating an object that moves back and forth and jumps every few seconds. +\ **Example:** Creating an object that moves back and forth and jumps every few seconds: .. tabs:: @@ -654,7 +656,7 @@ Example: creating an object that moves back and forth and jumps every few second Creates and appends a :ref:`MethodTweener`. This method is similar to a combination of :ref:`tween_callback` and :ref:`tween_property`. It calls a method over time with a tweened value provided as an argument. The value is tweened between ``from`` and ``to`` over the time specified by ``duration``, in seconds. Use :ref:`Callable.bind` to bind additional arguments for the call. You can use :ref:`MethodTweener.set_ease` and :ref:`MethodTweener.set_trans` to tweak the easing and transition of the value or :ref:`MethodTweener.set_delay` to delay the tweening. -Example: making a 3D object look from one point to another point. +\ **Example:** Making a 3D object look from one point to another point: .. tabs:: @@ -671,7 +673,7 @@ Example: making a 3D object look from one point to another point. -Example: setting a text of a :ref:`Label`, using an intermediate method and after a delay. +\ **Example:** Setting the text of a :ref:`Label`, using an intermediate method and after a delay: .. tabs:: @@ -708,7 +710,9 @@ Example: setting a text of a :ref:`Label`, using an intermediate me - :ref:`PropertyTweener` **tween_property** **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Variant` final_val, :ref:`float` duration **)** -Creates and appends a :ref:`PropertyTweener`. This method tweens a ``property`` of an ``object`` between an initial value and ``final_val`` in a span of time equal to ``duration``, in seconds. The initial value by default is the property's value at the time the tweening of the :ref:`PropertyTweener` starts. For example: +Creates and appends a :ref:`PropertyTweener`. This method tweens a ``property`` of an ``object`` between an initial value and ``final_val`` in a span of time equal to ``duration``, in seconds. The initial value by default is the property's value at the time the tweening of the :ref:`PropertyTweener` starts. + +\ **Example:**\ .. tabs:: @@ -731,7 +735,7 @@ will move the sprite to position (100, 200) and then to (200, 300). If you use : \ **Note:** 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 ``"property:component"`` (eg. ``position:x``), where it would only apply to that particular component. -Example: moving object twice from the same position, with different transition types. +\ **Example:** Moving an object twice from the same position, with different transition types: .. tabs:: diff --git a/classes/class_upnp.rst b/classes/class_upnp.rst index 6ef69005f..d4feff138 100644 --- a/classes/class_upnp.rst +++ b/classes/class_upnp.rst @@ -61,7 +61,7 @@ To close a specific port (e.g. after you have finished using it): func _ready(): thread = Thread.new() - thread.start(self, "_upnp_setup", SERVER_PORT) + thread.start(_upnp_setup.bind(SERVER_PORT)) func _exit_tree(): # Wait for thread finish here to handle game exit while the thread is running. @@ -308,7 +308,7 @@ Adds the given :ref:`UPNPDevice` to the list of discovered dev - :ref:`int` **add_port_mapping** **(** :ref:`int` port, :ref:`int` port_internal=0, :ref:`String` desc="", :ref:`String` proto="UDP", :ref:`int` duration=0 **)** |const| -Adds a mapping to forward the external ``port`` (between 1 and 65535, although recommended to use port 1024 or above) on the default gateway (see :ref:`get_gateway`) to the ``internal_port`` on the local machine for the given protocol ``proto`` (either ``TCP`` or ``UDP``, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with :ref:`get_gateway` and call :ref:`add_port_mapping` on it, if any. Note that forwarding a well-known port (below 1024) with UPnP may fail depending on the device. +Adds a mapping to forward the external ``port`` (between 1 and 65535, although recommended to use port 1024 or above) on the default gateway (see :ref:`get_gateway`) to the ``internal_port`` on the local machine for the given protocol ``proto`` (either ``"TCP"`` or ``"UDP"``, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with :ref:`get_gateway` and call :ref:`add_port_mapping` on it, if any. Note that forwarding a well-known port (below 1024) with UPnP may fail depending on the device. Depending on the gateway device, if a mapping for that port already exists, it will either be updated or it will refuse this command due to that conflict, especially if the existing mapping for that port wasn't created via UPnP or points to a different network address (or device) than this one. @@ -334,7 +334,7 @@ Clears the list of discovered devices. - :ref:`int` **delete_port_mapping** **(** :ref:`int` port, :ref:`String` proto="UDP" **)** |const| -Deletes the port mapping for the given port and protocol combination on the default gateway (see :ref:`get_gateway`) if one exists. ``port`` must be a valid port between 1 and 65535, ``proto`` can be either ``TCP`` or ``UDP``. May be refused for mappings pointing to addresses other than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See :ref:`UPNPResult` for possible return values. +Deletes the port mapping for the given port and protocol combination on the default gateway (see :ref:`get_gateway`) if one exists. ``port`` must be a valid port between 1 and 65535, ``proto`` can be either ``"TCP"`` or ``"UDP"``. May be refused for mappings pointing to addresses other than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See :ref:`UPNPResult` for possible return values. ---- diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index 2afc4ee8b..808c04d84 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -100,6 +100,8 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector2` to **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_normalized` **(** **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_zero_approx` **(** **)** |const| | @@ -462,6 +464,14 @@ Returns ``true`` if this vector and ``v`` are approximately equal, by running :r ---- +.. _class_Vector2_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this vector is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Vector2_method_is_normalized: - :ref:`bool` **is_normalized** **(** **)** |const| diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 9c32f4f79..bf9d68ea9 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -96,6 +96,8 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector3` to **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_normalized` **(** **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_zero_approx` **(** **)** |const| | @@ -446,11 +448,19 @@ Returns ``true`` if this vector and ``to`` are approximately equal, by running : ---- +.. _class_Vector3_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this vector is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Vector3_method_is_normalized: - :ref:`bool` **is_normalized** **(** **)** |const| -Returns ``true`` if the vector is normalized, ``false`` otherwise. +Returns ``true`` if the vector is :ref:`normalized`, ``false`` otherwise. ---- @@ -526,7 +536,7 @@ Returns a new vector moved toward ``to`` by the fixed ``delta`` amount. Will not - :ref:`Vector3` **normalized** **(** **)** |const| -Returns the vector scaled to unit length. Equivalent to ``v / v.length()``. +Returns the vector scaled to unit length. Equivalent to ``v / v.length()``. See also :ref:`is_normalized`. ---- @@ -534,12 +544,20 @@ Returns the vector scaled to unit length. Equivalent to ``v / v.length()``. - :ref:`Vector3` **octahedron_decode** **(** :ref:`Vector2` uv **)** |static| +Returns the ``Vector3`` from an octahedral-compressed form created using :ref:`octahedron_encode` (stored as a :ref:`Vector2`). + ---- .. _class_Vector3_method_octahedron_encode: - :ref:`Vector2` **octahedron_encode** **(** **)** |const| +Returns the octahedral-encoded (oct32) form of this ``Vector3`` as a :ref:`Vector2`. Since a :ref:`Vector2` occupies 1/3 less memory compared to ``Vector3``, this form of compression can be used to pass greater amounts of :ref:`normalized` ``Vector3``\ s without increasing storage or memory requirements. See also :ref:`octahedron_decode`. + +\ **Note:** :ref:`octahedron_encode` can only be used for :ref:`normalized` vectors. :ref:`octahedron_encode` does *not* check whether this ``Vector3`` is normalized, and will return a value that does not decompress to the original value if the ``Vector3`` is not normalized. + +\ **Note:** Octahedral compression is *lossy*, although visual differences are rarely perceptible in real world scenarios. + ---- .. _class_Vector3_method_outer: diff --git a/classes/class_vector4.rst b/classes/class_vector4.rst index 8f0a76a18..14f4004aa 100644 --- a/classes/class_vector4.rst +++ b/classes/class_vector4.rst @@ -75,6 +75,8 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector4` with **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_finite` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_normalized` **(** **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_zero_approx` **(** **)** |const| | @@ -353,6 +355,14 @@ Returns ``true`` if this vector and ``with`` are approximately equal, by running ---- +.. _class_Vector4_method_is_finite: + +- :ref:`bool` **is_finite** **(** **)** |const| + +Returns ``true`` if this vector is finite, by calling :ref:`@GlobalScope.is_finite` on each component. + +---- + .. _class_Vector4_method_is_normalized: - :ref:`bool` **is_normalized** **(** **)** |const| diff --git a/classes/class_vector4i.rst b/classes/class_vector4i.rst index b685c8b3c..265a20824 100644 --- a/classes/class_vector4i.rst +++ b/classes/class_vector4i.rst @@ -282,10 +282,22 @@ Returns ``true`` if the vectors are not equal. - :ref:`Vector4i` **operator %** **(** :ref:`Vector4i` right **)** +Gets the remainder of each component of the ``Vector4i`` with the components of the given ``Vector4i``. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using :ref:`@GlobalScope.posmod` instead if you want to handle negative numbers. + +:: + + print(Vector4i(10, -20, 30, -40) % Vector4i(7, 8, 9, 10)) # Prints "(3, -4, 3, 0)" + ---- - :ref:`Vector4i` **operator %** **(** :ref:`int` right **)** +Gets the remainder of each component of the ``Vector4i`` with the the given :ref:`int`. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using :ref:`@GlobalScope.posmod` instead if you want to handle negative numbers. + +:: + + print(Vector4i(10, -20, 30, -40) % 7) # Prints "(3, -6, 2, -5)" + ---- .. _class_Vector4i_operator_mul_Vector4i: diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index 6bbc9bbdb..24b6a1564 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -51,89 +51,91 @@ Tutorials Properties ---------- -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`audio_listener_enable_2d` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`audio_listener_enable_3d` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`DefaultCanvasItemTextureFilter` | :ref:`canvas_item_default_texture_filter` | ``1`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`DefaultCanvasItemTextureRepeat` | :ref:`canvas_item_default_texture_repeat` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`Transform2D` | :ref:`canvas_transform` | | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`disable_3d` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`fsr_sharpness` | ``0.2`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`Transform2D` | :ref:`global_canvas_transform` | | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`gui_disable_input` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`gui_embed_subwindows` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`gui_snap_controls_to_pixels` | ``true`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`handle_input_locally` | ``true`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`mesh_lod_threshold` | ``1.0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`MSAA` | :ref:`msaa_2d` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`MSAA` | :ref:`msaa_3d` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`own_world_3d` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`physics_object_picking` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`positional_shadow_atlas_16_bits` | ``true`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_0` | ``2`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_1` | ``2`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_2` | ``3`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_3` | ``4`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`int` | :ref:`positional_shadow_atlas_size` | ``2048`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`Scaling3DMode` | :ref:`scaling_3d_mode` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`scaling_3d_scale` | ``1.0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`ScreenSpaceAA` | :ref:`screen_space_aa` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`SDFOversize` | :ref:`sdf_oversize` | ``1`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`SDFScale` | :ref:`sdf_scale` | ``1`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`snap_2d_transforms_to_pixel` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`snap_2d_vertices_to_pixel` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`texture_mipmap_bias` | ``0.0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`transparent_bg` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`use_debanding` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`use_occlusion_culling` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`use_taa` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`use_xr` | ``false`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`VRSMode` | :ref:`vrs_mode` | ``0`` | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`Texture2D` | :ref:`vrs_texture` | | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`World2D` | :ref:`world_2d` | | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ -| :ref:`World3D` | :ref:`world_3d` | | -+-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------+ ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`audio_listener_enable_2d` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`audio_listener_enable_3d` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`int` | :ref:`canvas_cull_mask` | ``4294967295`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`DefaultCanvasItemTextureFilter` | :ref:`canvas_item_default_texture_filter` | ``1`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`DefaultCanvasItemTextureRepeat` | :ref:`canvas_item_default_texture_repeat` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`Transform2D` | :ref:`canvas_transform` | | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`disable_3d` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`float` | :ref:`fsr_sharpness` | ``0.2`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`Transform2D` | :ref:`global_canvas_transform` | | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`gui_disable_input` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`gui_embed_subwindows` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`gui_snap_controls_to_pixels` | ``true`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`handle_input_locally` | ``true`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`float` | :ref:`mesh_lod_threshold` | ``1.0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`MSAA` | :ref:`msaa_2d` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`MSAA` | :ref:`msaa_3d` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`own_world_3d` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`physics_object_picking` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`positional_shadow_atlas_16_bits` | ``true`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_0` | ``2`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_1` | ``2`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_2` | ``3`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_3` | ``4`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`int` | :ref:`positional_shadow_atlas_size` | ``2048`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`Scaling3DMode` | :ref:`scaling_3d_mode` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`float` | :ref:`scaling_3d_scale` | ``1.0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`ScreenSpaceAA` | :ref:`screen_space_aa` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`SDFOversize` | :ref:`sdf_oversize` | ``1`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`SDFScale` | :ref:`sdf_scale` | ``1`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`snap_2d_transforms_to_pixel` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`snap_2d_vertices_to_pixel` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`float` | :ref:`texture_mipmap_bias` | ``0.0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`transparent_bg` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`use_debanding` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`use_occlusion_culling` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`use_taa` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`bool` | :ref:`use_xr` | ``false`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`VRSMode` | :ref:`vrs_mode` | ``0`` | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`Texture2D` | :ref:`vrs_texture` | | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`World2D` | :ref:`world_2d` | | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ +| :ref:`World3D` | :ref:`world_3d` | | ++-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ Methods ------- @@ -147,6 +149,8 @@ Methods +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Camera3D` | :ref:`get_camera_3d` **(** **)** |const| | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_canvas_cull_mask_bit` **(** :ref:`int` layer **)** |const| | ++-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`get_final_transform` **(** **)** |const| | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_mouse_position` **(** **)** |const| | @@ -155,6 +159,8 @@ Methods +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_render_info` **(** :ref:`RenderInfoType` type, :ref:`RenderInfo` info **)** | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_screen_transform` **(** **)** |const| | ++-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ViewportTexture` | :ref:`get_texture` **(** **)** |const| | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_viewport_rid` **(** **)** |const| | @@ -179,6 +185,8 @@ Methods +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`push_unhandled_input` **(** :ref:`InputEvent` event, :ref:`bool` in_local_coords=false **)** | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_canvas_cull_mask_bit` **(** :ref:`int` layer, :ref:`bool` enable **)** | ++-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_input_as_handled` **(** **)** | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_positional_shadow_atlas_quadrant_subdiv` **(** :ref:`int` quadrant, :ref:`PositionalShadowAtlasQuadrantSubdiv` subdiv **)** | @@ -607,6 +615,22 @@ If ``true``, the viewport will process 3D audio streams. ---- +.. _class_Viewport_property_canvas_cull_mask: + +- :ref:`int` **canvas_cull_mask** + ++-----------+-----------------------------+ +| *Default* | ``4294967295`` | ++-----------+-----------------------------+ +| *Setter* | set_canvas_cull_mask(value) | ++-----------+-----------------------------+ +| *Getter* | get_canvas_cull_mask() | ++-----------+-----------------------------+ + +The rendering layers in which this ``Viewport`` renders :ref:`CanvasItem` nodes. + +---- + .. _class_Viewport_property_canvas_item_default_texture_filter: - :ref:`DefaultCanvasItemTextureFilter` **canvas_item_default_texture_filter** @@ -1125,6 +1149,10 @@ If ``true``, the viewport should render its background as transparent. | *Getter* | is_using_debanding() | +-----------+--------------------------+ +If ``true``, uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is *not* affected by debanding unless the :ref:`Environment.background_mode` is :ref:`Environment.BG_CANVAS`. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/use_debanding`. + +In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + ---- .. _class_Viewport_property_use_occlusion_culling: @@ -1270,6 +1298,14 @@ Returns the currently active 3D camera. ---- +.. _class_Viewport_method_get_canvas_cull_mask_bit: + +- :ref:`bool` **get_canvas_cull_mask_bit** **(** :ref:`int` layer **)** |const| + +Returns an individual bit on the rendering layer mask. + +---- + .. _class_Viewport_method_get_final_transform: - :ref:`Transform2D` **get_final_transform** **(** **)** |const| @@ -1300,6 +1336,14 @@ Returns the :ref:`PositionalShadowAtlasQuadrantSubdiv` **get_screen_transform** **(** **)** |const| + +Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window. + +---- + .. _class_Viewport_method_get_texture: - :ref:`ViewportTexture` **get_texture** **(** **)** |const| @@ -1436,6 +1480,14 @@ If none of the methods handle the event and :ref:`physics_object_picking` layer, :ref:`bool` enable **)** + +Set/clear individual bits on the rendering layer mask. This simplifies editing this ``Viewport``'s layers. + +---- + .. _class_Viewport_method_set_input_as_handled: - void **set_input_as_handled** **(** **)** diff --git a/classes/class_viewporttexture.rst b/classes/class_viewporttexture.rst index 2beb5c39d..1dd74d1a9 100644 --- a/classes/class_viewporttexture.rst +++ b/classes/class_viewporttexture.rst @@ -21,6 +21,8 @@ Displays the content of a :ref:`Viewport` node as a dynamic :ref To create a ViewportTexture in code, use the :ref:`Viewport.get_texture` method on the target viewport. +\ **Note:** When local to scene, this texture uses :ref:`Resource.setup_local_to_scene` to set the proxy texture and flags in the local viewport. + Tutorials --------- @@ -35,9 +37,11 @@ Tutorials Properties ---------- -+---------------------------------+--------------------------------------------------------------------+------------------+ -| :ref:`NodePath` | :ref:`viewport_path` | ``NodePath("")`` | -+---------------------------------+--------------------------------------------------------------------+------------------+ ++---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`bool` | resource_local_to_scene | ``true`` (overrides :ref:`Resource`) | ++---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`viewport_path` | ``NodePath("")`` | ++---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+ Property Descriptions --------------------- diff --git a/classes/class_visibleonscreenenabler2d.rst b/classes/class_visibleonscreenenabler2d.rst index 086b5d992..1a0d2471c 100644 --- a/classes/class_visibleonscreenenabler2d.rst +++ b/classes/class_visibleonscreenenabler2d.rst @@ -12,7 +12,12 @@ VisibleOnScreenEnabler2D **Inherits:** :ref:`VisibleOnScreenNotifier2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` +Automatically disables another node if not visible on screen. +Description +----------- + +VisibleOnScreenEnabler2D detects when it is visible on screen (just like :ref:`VisibleOnScreenNotifier2D`) and automatically enables or disables the target node. The target node is disabled when ``VisibleOnScreenEnabler2D`` is not visible on screen (including when :ref:`CanvasItem.visible` is ``false``), and enabled when the enabler is visible. The disabling is achieved by changing :ref:`Node.process_mode`. Properties ---------- @@ -36,11 +41,11 @@ Enumerations enum **EnableMode**: -- **ENABLE_MODE_INHERIT** = **0** +- **ENABLE_MODE_INHERIT** = **0** --- Corresponds to :ref:`Node.PROCESS_MODE_INHERIT`. -- **ENABLE_MODE_ALWAYS** = **1** +- **ENABLE_MODE_ALWAYS** = **1** --- Corresponds to :ref:`Node.PROCESS_MODE_ALWAYS`. -- **ENABLE_MODE_WHEN_PAUSED** = **2** +- **ENABLE_MODE_WHEN_PAUSED** = **2** --- Corresponds to [constant Node.PROCESS_MODE_WHEN_PAUSED. Property Descriptions --------------------- @@ -57,6 +62,8 @@ Property Descriptions | *Getter* | get_enable_mode() | +-----------+------------------------+ +Determines how the node is enabled. Corresponds to :ref:`ProcessMode`. Disabled node uses :ref:`Node.PROCESS_MODE_DISABLED`. + ---- .. _class_VisibleOnScreenEnabler2D_property_enable_node_path: @@ -71,6 +78,8 @@ Property Descriptions | *Getter* | get_enable_node_path() | +-----------+-----------------------------+ +The path to the target node, relative to the ``VisibleOnScreenEnabler2D``. The target node is cached; it's only assigned when setting this property (if the ``VisibleOnScreenEnabler2D`` is inside scene tree) and every time the ``VisibleOnScreenEnabler2D`` enters the scene tree. If the path is invalid, nothing will happen. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_visualinstance3d.rst b/classes/class_visualinstance3d.rst index 0464d2946..d8c859cae 100644 --- a/classes/class_visualinstance3d.rst +++ b/classes/class_visualinstance3d.rst @@ -24,9 +24,9 @@ The ``VisualInstance3D`` is used to connect a resource to a visual representatio Properties ---------- -+-----------------------+-------------------------------------------------------+ -| :ref:`int` | :ref:`layers` | -+-----------------------+-------------------------------------------------------+ ++-----------------------+-------------------------------------------------------+-------+ +| :ref:`int` | :ref:`layers` | ``1`` | ++-----------------------+-------------------------------------------------------+-------+ Methods ------- @@ -42,8 +42,6 @@ Methods +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_layer_mask_value` **(** :ref:`int` layer_number **)** |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`get_transformed_aabb` **(** **)** |const| | -+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_base` **(** :ref:`RID` base **)** | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_layer_mask_value` **(** :ref:`int` layer_number, :ref:`bool` value **)** | @@ -56,11 +54,13 @@ Property Descriptions - :ref:`int` **layers** -+----------+-----------------------+ -| *Setter* | set_layer_mask(value) | -+----------+-----------------------+ -| *Getter* | get_layer_mask() | -+----------+-----------------------+ ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_layer_mask(value) | ++-----------+-----------------------+ +| *Getter* | get_layer_mask() | ++-----------+-----------------------+ The render layer(s) this ``VisualInstance3D`` is drawn on. @@ -81,7 +81,7 @@ Method Descriptions - :ref:`AABB` **get_aabb** **(** **)** |const| -Returns the :ref:`AABB` (also known as the bounding box) for this ``VisualInstance3D``. See also :ref:`get_transformed_aabb`. +Returns the :ref:`AABB` (also known as the bounding box) for this ``VisualInstance3D``. ---- @@ -109,16 +109,6 @@ Returns whether or not the specified layer of the :ref:`layers` **get_transformed_aabb** **(** **)** |const| - -Returns the transformed :ref:`AABB` (also known as the bounding box) for this ``VisualInstance3D``. - -Transformed in this case means the :ref:`AABB` plus the position, rotation, and scale of the :ref:`Node3D`'s :ref:`Transform3D`. See also :ref:`get_aabb`. - ----- - .. _class_VisualInstance3D_method_set_base: - void **set_base** **(** :ref:`RID` base **)** diff --git a/classes/class_visualshadernodefloatparameter.rst b/classes/class_visualshadernodefloatparameter.rst index fe6ef0b4b..1c4c0f209 100644 --- a/classes/class_visualshadernodefloatparameter.rst +++ b/classes/class_visualshadernodefloatparameter.rst @@ -106,7 +106,7 @@ Enables usage of the :ref:`default_value`. Parameters are exposed as properties in the :ref:`ShaderMaterial` and can be assigned from the inspector or from a script. +A parameter represents a variable in the shader which is set externally, i.e. from the :ref:`ShaderMaterial`. Parameters are exposed as properties in the :ref:`ShaderMaterial` and can be assigned from the Inspector or from a script. Properties ---------- diff --git a/classes/class_voxelgidata.rst b/classes/class_voxelgidata.rst index 1189540cf..f6b7adff4 100644 --- a/classes/class_voxelgidata.rst +++ b/classes/class_voxelgidata.rst @@ -19,7 +19,7 @@ Description ``VoxelGIData`` contains baked voxel global illumination for use in a :ref:`VoxelGI` node. ``VoxelGIData`` also offers several properties to adjust the final appearance of the global illumination. These properties can be adjusted at run-time without having to bake the :ref:`VoxelGI` node again. -\ **Note:** To prevent text-based scene files (``.tscn``) from growing too much and becoming slow to load and save, always save ``VoxelGIData`` to an external binary resource file (``.res``) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the ``VoxelGIData`` resource, choosing **Edit**, clicking the floppy disk icon at the top of the inspector then choosing **Save As...**. +\ **Note:** To prevent text-based scene files (``.tscn``) from growing too much and becoming slow to load and save, always save ``VoxelGIData`` to an external binary resource file (``.res``) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the ``VoxelGIData`` resource, choosing **Edit**, clicking the floppy disk icon at the top of the Inspector then choosing **Save As...**. Tutorials --------- diff --git a/classes/class_vslider.rst b/classes/class_vslider.rst index 7da28e194..563f63655 100644 --- a/classes/class_vslider.rst +++ b/classes/class_vslider.rst @@ -110,6 +110,8 @@ The background of the area below the grabber. - :ref:`StyleBox` **grabber_area_highlight** +The background of the area below the grabber, to the left of the grabber. + ---- .. _class_VSlider_theme_style_slider: diff --git a/classes/class_webrtcmultiplayerpeer.rst b/classes/class_webrtcmultiplayerpeer.rst index c180eab8a..56708e227 100644 --- a/classes/class_webrtcmultiplayerpeer.rst +++ b/classes/class_webrtcmultiplayerpeer.rst @@ -21,7 +21,7 @@ This class constructs a full mesh of :ref:`WebRTCPeerConnection` via :ref:`add_peer` or remove them via :ref:`remove_peer`. Peers must be added in :ref:`WebRTCPeerConnection.STATE_NEW` state to allow it to create the appropriate channels. This class will not create offers nor set descriptions, it will only poll them, and notify connections and disconnections. -\ :ref:`MultiplayerPeer.connection_succeeded` and :ref:`MultiplayerPeer.server_disconnected` will not be emitted unless ``server_compatibility`` is ``true`` in :ref:`initialize`. Beside that data transfer works like in a :ref:`MultiplayerPeer`. +When creating the peer via :ref:`create_client` or :ref:`create_server` the :ref:`MultiplayerPeer.is_server_relay_supported` method will return ``true`` enabling peer exchange and packet relaying when supported by the :ref:`MultiplayerAPI` implementation. \ **Note:** When exporting to Android, make sure to enable the ``INTERNET`` 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. @@ -31,7 +31,11 @@ Methods +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`add_peer` **(** :ref:`WebRTCPeerConnection` peer, :ref:`int` peer_id, :ref:`int` unreliable_lifetime=1 **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`close` **(** **)** | +| :ref:`Error` | :ref:`create_client` **(** :ref:`int` peer_id, :ref:`Array` channels_config=[] **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_mesh` **(** :ref:`int` peer_id, :ref:`Array` channels_config=[] **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_server` **(** :ref:`Array` channels_config=[] **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_peer` **(** :ref:`int` peer_id **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -39,8 +43,6 @@ Methods +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_peer` **(** :ref:`int` peer_id **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`initialize` **(** :ref:`int` peer_id, :ref:`bool` server_compatibility=false, :ref:`Array` channels_config=[] **)** | -+---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_peer` **(** :ref:`int` peer_id **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -57,11 +59,31 @@ Three channels will be created for reliable, unreliable, and ordered transport. ---- -.. _class_WebRTCMultiplayerPeer_method_close: +.. _class_WebRTCMultiplayerPeer_method_create_client: -- void **close** **(** **)** +- :ref:`Error` **create_client** **(** :ref:`int` peer_id, :ref:`Array` channels_config=[] **)** -Close all the add peer connections and channels, freeing all resources. +Initialize the multiplayer peer as a client with the given ``peer_id`` (must be between 2 and 2147483647). In this mode, you should only call :ref:`add_peer` once and with ``peer_id`` of ``1``. This mode enables :ref:`MultiplayerPeer.is_server_relay_supported`, allowing the upper :ref:`MultiplayerAPI` layer to perform peer exchange and packet relaying. + +You can optionally specify a ``channels_config`` array of :ref:`TransferMode` which will be used to create extra channels (WebRTC only supports one transfer mode per channel). + +---- + +.. _class_WebRTCMultiplayerPeer_method_create_mesh: + +- :ref:`Error` **create_mesh** **(** :ref:`int` peer_id, :ref:`Array` channels_config=[] **)** + +Initialize the multiplayer peer as a mesh (i.e. all peers connect to each other) with the given ``peer_id`` (must be between 1 and 2147483647). + +---- + +.. _class_WebRTCMultiplayerPeer_method_create_server: + +- :ref:`Error` **create_server** **(** :ref:`Array` channels_config=[] **)** + +Initialize the multiplayer peer as a server (with unique ID of ``1``). This mode enables :ref:`MultiplayerPeer.is_server_relay_supported`, allowing the upper :ref:`MultiplayerAPI` layer to perform peer exchange and packet relaying. + +You can optionally specify a ``channels_config`` array of :ref:`TransferMode` which will be used to create extra channels (WebRTC only supports one transfer mode per channel). ---- @@ -89,20 +111,6 @@ Returns ``true`` if the given ``peer_id`` is in the peers map (it might not be c ---- -.. _class_WebRTCMultiplayerPeer_method_initialize: - -- :ref:`Error` **initialize** **(** :ref:`int` peer_id, :ref:`bool` server_compatibility=false, :ref:`Array` channels_config=[] **)** - -Initialize the multiplayer peer with the given ``peer_id`` (must be between 1 and 2147483647). - -If ``server_compatibilty`` is ``false`` (default), the multiplayer peer will be immediately in state :ref:`MultiplayerPeer.CONNECTION_CONNECTED` and :ref:`MultiplayerPeer.connection_succeeded` will not be emitted. - -If ``server_compatibilty`` is ``true`` the peer will suppress all :ref:`MultiplayerPeer.peer_connected` signals until a peer with id :ref:`MultiplayerPeer.TARGET_PEER_SERVER` connects and then emit :ref:`MultiplayerPeer.connection_succeeded`. After that the signal :ref:`MultiplayerPeer.peer_connected` will be emitted for every already connected peer, and any new peer that might connect. If the server peer disconnects after that, signal :ref:`MultiplayerPeer.server_disconnected` will be emitted and state will become :ref:`MultiplayerPeer.CONNECTION_CONNECTED`. - -You can optionally specify a ``channels_config`` array of :ref:`TransferMode` which will be used to create extra channels (WebRTC only supports one transfer mode per channel). - ----- - .. _class_WebRTCMultiplayerPeer_method_remove_peer: - void **remove_peer** **(** :ref:`int` peer_id **)** diff --git a/classes/class_websocketclient.rst b/classes/class_websocketclient.rst deleted file mode 100644 index fe4789aa1..000000000 --- a/classes/class_websocketclient.rst +++ /dev/null @@ -1,176 +0,0 @@ -:github_url: hide - -.. DO NOT EDIT THIS FILE!!! -.. Generated automatically from Godot engine sources. -.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. -.. XML source: https://github.com/godotengine/godot/tree/master/modules/websocket/doc_classes/WebSocketClient.xml. - -.. _class_WebSocketClient: - -WebSocketClient -=============== - -**Inherits:** :ref:`WebSocketMultiplayerPeer` **<** :ref:`MultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`RefCounted` **<** :ref:`Object` - -A WebSocket client implementation. - -Description ------------ - -This class implements a WebSocket client compatible with any RFC 6455-compliant WebSocket server. - -This client can be optionally used as a multiplayer peer for the :ref:`MultiplayerAPI`. - -After starting the client (:ref:`connect_to_url`), you will need to :ref:`MultiplayerPeer.poll` it at regular intervals (e.g. inside :ref:`Node._process`). - -You will receive appropriate signals when connecting, disconnecting, or when new data is available. - -\ **Note:** When exporting to Android, make sure to enable the ``INTERNET`` 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. - -Properties ----------- - -+-----------------------------------------------+----------------------------------------------------------------------------------------+ -| :ref:`X509Certificate` | :ref:`trusted_tls_certificate` | -+-----------------------------------------------+----------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`verify_tls` | -+-----------------------------------------------+----------------------------------------------------------------------------------------+ - -Methods -------- - -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`connect_to_url` **(** :ref:`String` url, :ref:`PackedStringArray` protocols=PackedStringArray(), :ref:`bool` gd_mp_api=false, :ref:`PackedStringArray` custom_headers=PackedStringArray() **)** | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`disconnect_from_host` **(** :ref:`int` code=1000, :ref:`String` reason="" **)** | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Signals -------- - -.. _class_WebSocketClient_signal_connection_closed: - -- **connection_closed** **(** :ref:`bool` was_clean_close **)** - -Emitted when the connection to the server is closed. ``was_clean_close`` will be ``true`` if the connection was shutdown cleanly. - ----- - -.. _class_WebSocketClient_signal_connection_error: - -- **connection_error** **(** **)** - -Emitted when the connection to the server fails. - ----- - -.. _class_WebSocketClient_signal_connection_established: - -- **connection_established** **(** :ref:`String` protocol **)** - -Emitted when a connection with the server is established, ``protocol`` will contain the sub-protocol agreed with the server. - ----- - -.. _class_WebSocketClient_signal_data_received: - -- **data_received** **(** **)** - -Emitted when a WebSocket message is received. - -\ **Note:** This signal is *not* emitted when used as high-level multiplayer peer. - ----- - -.. _class_WebSocketClient_signal_server_close_request: - -- **server_close_request** **(** :ref:`int` code, :ref:`String` reason **)** - -Emitted when the server requests a clean close. You should keep polling until you get a :ref:`connection_closed` signal to achieve the clean close. See :ref:`WebSocketPeer.close` for more details. - -Property Descriptions ---------------------- - -.. _class_WebSocketClient_property_trusted_tls_certificate: - -- :ref:`X509Certificate` **trusted_tls_certificate** - -+----------+------------------------------------+ -| *Setter* | set_trusted_tls_certificate(value) | -+----------+------------------------------------+ -| *Getter* | get_trusted_tls_certificate() | -+----------+------------------------------------+ - -If specified, this :ref:`X509Certificate` will be the only one accepted when connecting to an TLS host. Any other certificate provided by the server will be regarded as invalid. - -\ **Note:** Specifying a custom ``trusted_tls_certificate`` is not supported in Web exports due to browsers' restrictions. - ----- - -.. _class_WebSocketClient_property_verify_tls: - -- :ref:`bool` **verify_tls** - -+----------+-------------------------------+ -| *Setter* | set_verify_tls_enabled(value) | -+----------+-------------------------------+ -| *Getter* | is_verify_tls_enabled() | -+----------+-------------------------------+ - -If ``true``, TLS certificate verification is enabled. - -\ **Note:** You must specify the certificates to be used in the Project Settings for it to work when exported. - -Method Descriptions -------------------- - -.. _class_WebSocketClient_method_connect_to_url: - -- :ref:`Error` **connect_to_url** **(** :ref:`String` url, :ref:`PackedStringArray` protocols=PackedStringArray(), :ref:`bool` gd_mp_api=false, :ref:`PackedStringArray` custom_headers=PackedStringArray() **)** - -Connects to the given URL requesting one of the given ``protocols`` as sub-protocol. If the list empty (default), no sub-protocol will be requested. - -If ``true`` is passed as ``gd_mp_api``, the client will behave like a multiplayer peer for the :ref:`MultiplayerAPI`, connections to non-Godot servers will not work, and :ref:`data_received` will not be emitted. - -If ``false`` is passed instead (default), you must call :ref:`PacketPeer` functions (``put_packet``, ``get_packet``, etc.) on the :ref:`WebSocketPeer` returned via ``get_peer(1)`` and not on this object directly (e.g. ``get_peer(1).put_packet(data)``). - -You can optionally pass a list of ``custom_headers`` to be added to the handshake HTTP request. - -\ **Note:** To avoid mixed content warnings or errors in Web, you may have to use a ``url`` that starts with ``wss://`` (secure) instead of ``ws://``. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for ``wss://`` connections, as it won't match with the TLS certificate. - -\ **Note:** Specifying ``custom_headers`` is not supported in Web exports due to browsers' restrictions. - ----- - -.. _class_WebSocketClient_method_disconnect_from_host: - -- void **disconnect_from_host** **(** :ref:`int` code=1000, :ref:`String` reason="" **)** - -Disconnects this client from the connected host. See :ref:`WebSocketPeer.close` for more information. - ----- - -.. _class_WebSocketClient_method_get_connected_host: - -- :ref:`String` **get_connected_host** **(** **)** |const| - -Returns the IP address of the currently connected host. - ----- - -.. _class_WebSocketClient_method_get_connected_port: - -- :ref:`int` **get_connected_port** **(** **)** |const| - -Returns the IP port of the currently connected host. - -.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` -.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` -.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` -.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` -.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` -.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_websocketmultiplayerpeer.rst b/classes/class_websocketmultiplayerpeer.rst index 6eaf2bc5c..73d73472e 100644 --- a/classes/class_websocketmultiplayerpeer.rst +++ b/classes/class_websocketmultiplayerpeer.rst @@ -12,8 +12,6 @@ WebSocketMultiplayerPeer **Inherits:** :ref:`MultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`WebSocketClient`, :ref:`WebSocketServer` - Base class for WebSocket server and client. Description @@ -23,29 +21,156 @@ Base class for WebSocket server and client, allowing them to be used as multipla \ **Note:** When exporting to Android, make sure to enable the ``INTERNET`` 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. +Properties +---------- + ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`PackedStringArray` | :ref:`handshake_headers` | ``PackedStringArray()`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`handshake_timeout` | ``3.0`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`inbound_buffer_size` | ``65535`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`max_queued_packets` | ``2048`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`outbound_buffer_size` | ``65535`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`PackedStringArray` | :ref:`supported_protocols` | ``PackedStringArray()`` | ++---------------------------------------------------+-------------------------------------------------------------------------------------------+-------------------------+ + Methods ------- -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`WebSocketPeer` | :ref:`get_peer` **(** :ref:`int` peer_id **)** |const| | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`set_buffers` **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** | -+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_client` **(** :ref:`String` url, :ref:`bool` verify_tls=true, :ref:`X509Certificate` tls_certificate=null **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_server` **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`CryptoKey` tls_key=null, :ref:`X509Certificate` tls_certificate=null **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`WebSocketPeer` | :ref:`get_peer` **(** :ref:`int` peer_id **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_peer_address` **(** :ref:`int` id **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_peer_port` **(** :ref:`int` id **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Signals -------- +Property Descriptions +--------------------- -.. _class_WebSocketMultiplayerPeer_signal_peer_packet: +.. _class_WebSocketMultiplayerPeer_property_handshake_headers: -- **peer_packet** **(** :ref:`int` peer_source **)** +- :ref:`PackedStringArray` **handshake_headers** -Emitted when a packet is received from a peer. ++-----------+------------------------------+ +| *Default* | ``PackedStringArray()`` | ++-----------+------------------------------+ +| *Setter* | set_handshake_headers(value) | ++-----------+------------------------------+ +| *Getter* | get_handshake_headers() | ++-----------+------------------------------+ -\ **Note:** This signal is only emitted when the client or server is configured to use Godot multiplayer API. +The extra headers to use during handshake. See :ref:`WebSocketPeer.handshake_headers` for more details. + +---- + +.. _class_WebSocketMultiplayerPeer_property_handshake_timeout: + +- :ref:`float` **handshake_timeout** + ++-----------+------------------------------+ +| *Default* | ``3.0`` | ++-----------+------------------------------+ +| *Setter* | set_handshake_timeout(value) | ++-----------+------------------------------+ +| *Getter* | get_handshake_timeout() | ++-----------+------------------------------+ + +The maximum time each peer can stay in a connecting state before being dropped. + +---- + +.. _class_WebSocketMultiplayerPeer_property_inbound_buffer_size: + +- :ref:`int` **inbound_buffer_size** + ++-----------+--------------------------------+ +| *Default* | ``65535`` | ++-----------+--------------------------------+ +| *Setter* | set_inbound_buffer_size(value) | ++-----------+--------------------------------+ +| *Getter* | get_inbound_buffer_size() | ++-----------+--------------------------------+ + +The inbound buffer size for connected peers. See :ref:`WebSocketPeer.inbound_buffer_size` for more details. + +---- + +.. _class_WebSocketMultiplayerPeer_property_max_queued_packets: + +- :ref:`int` **max_queued_packets** + ++-----------+-------------------------------+ +| *Default* | ``2048`` | ++-----------+-------------------------------+ +| *Setter* | set_max_queued_packets(value) | ++-----------+-------------------------------+ +| *Getter* | get_max_queued_packets() | ++-----------+-------------------------------+ + +The maximum number of queued packets for connected peers. See :ref:`WebSocketPeer.max_queued_packets` for more details. + +---- + +.. _class_WebSocketMultiplayerPeer_property_outbound_buffer_size: + +- :ref:`int` **outbound_buffer_size** + ++-----------+---------------------------------+ +| *Default* | ``65535`` | ++-----------+---------------------------------+ +| *Setter* | set_outbound_buffer_size(value) | ++-----------+---------------------------------+ +| *Getter* | get_outbound_buffer_size() | ++-----------+---------------------------------+ + +The outbound buffer size for connected peers. See :ref:`WebSocketPeer.outbound_buffer_size` for more details. + +---- + +.. _class_WebSocketMultiplayerPeer_property_supported_protocols: + +- :ref:`PackedStringArray` **supported_protocols** + ++-----------+--------------------------------+ +| *Default* | ``PackedStringArray()`` | ++-----------+--------------------------------+ +| *Setter* | set_supported_protocols(value) | ++-----------+--------------------------------+ +| *Getter* | get_supported_protocols() | ++-----------+--------------------------------+ + +The supported WebSocket sub-protocols. See :ref:`WebSocketPeer.supported_protocols` for more details. Method Descriptions ------------------- +.. _class_WebSocketMultiplayerPeer_method_create_client: + +- :ref:`Error` **create_client** **(** :ref:`String` url, :ref:`bool` verify_tls=true, :ref:`X509Certificate` tls_certificate=null **)** + +Starts a new multiplayer client connecting to the given ``url``. If ``verify_tls`` is ``false`` certificate validation will be disabled. If specified, the ``tls_certificate`` will be used to verify the TLS host. + +\ **Note**: It is recommended to specify the scheme part of the URL, i.e. the ``url`` should start with either ``ws://`` or ``wss://``. + +---- + +.. _class_WebSocketMultiplayerPeer_method_create_server: + +- :ref:`Error` **create_server** **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`CryptoKey` tls_key=null, :ref:`X509Certificate` tls_certificate=null **)** + +Starts a new multiplayer server listening on the given ``port``. You can optionally specify a ``bind_address``, and provide a ``tls_key`` and ``tls_certificate`` to use TLS. + +---- + .. _class_WebSocketMultiplayerPeer_method_get_peer: - :ref:`WebSocketPeer` **get_peer** **(** :ref:`int` peer_id **)** |const| @@ -54,17 +179,19 @@ Returns the :ref:`WebSocketPeer` associated to the given `` ---- -.. _class_WebSocketMultiplayerPeer_method_set_buffers: +.. _class_WebSocketMultiplayerPeer_method_get_peer_address: -- :ref:`Error` **set_buffers** **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** +- :ref:`String` **get_peer_address** **(** :ref:`int` id **)** |const| -Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under ``network/limits``. For server, values are meant per connected peer. +Returns the IP address of the given peer. -The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. +---- -Buffer sizes are expressed in KiB, so ``4 = 2^12 = 4096 bytes``. All parameters will be rounded up to the nearest power of two. +.. _class_WebSocketMultiplayerPeer_method_get_peer_port: -\ **Note:** Web exports only use the input buffer since the output one is managed by browsers. +- :ref:`int` **get_peer_port** **(** :ref:`int` id **)** |const| + +Returns the remote port of the given peer. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_websocketpeer.rst b/classes/class_websocketpeer.rst index 2fb5fae21..712aaaabd 100644 --- a/classes/class_websocketpeer.rst +++ b/classes/class_websocketpeer.rst @@ -12,37 +12,99 @@ WebSocketPeer **Inherits:** :ref:`PacketPeer` **<** :ref:`RefCounted` **<** :ref:`Object` -A class representing a specific WebSocket connection. +A WebSocket connection. Description ----------- -This class represents a specific WebSocket connection, allowing you to do lower level operations with it. +This class represents WebSocket connection, and can be used as a WebSocket client (RFC 6455-compliant) or as a remote peer of a WebSocket server. -You can choose to write to the socket in binary or text mode, and you can recognize the mode used for writing by the other peer. +You can send WebSocket binary frames using :ref:`PacketPeer.put_packet`, and WebSocket text frames using :ref:`send` (prefer text frames when interacting with text-based API). You can check the frame type of the last packet via :ref:`was_string_packet`. + +To start a WebSocket client, first call :ref:`connect_to_url`, then regularly call :ref:`poll` (e.g. during :ref:`Node` process). You can query the socket state via :ref:`get_ready_state`, get the number of pending packets using :ref:`PacketPeer.get_available_packet_count`, and retrieve them via :ref:`PacketPeer.get_packet`. + + +.. tabs:: + + .. code-tab:: gdscript + + extends Node + + var socket = WebSocketPeer.new() + + func _ready(): + socket.connect_to_url("wss://example.com") + + func _process(delta): + socket.poll() + var state = socket.get_ready_state() + if state == WebSocketPeer.STATE_OPEN: + while socket.get_available_packet_count(): + print("Packet: ", socket.get_packet()) + elif state == WebSocketPeer.STATE_CLOSING: + # Keep polling to achieve proper close. + pass + elif state == WebSocketPeer.STATE_CLOSED: + var code = socket.get_close_code() + var reason = socket.get_close_reason() + print("WebSocket closed with code: %d, reason %s. Clean: %s" % [code, reason, code != -1]) + set_process(false) # Stop processing. + + + +To use the peer as part of a WebSocket server refer to :ref:`accept_stream` and the online tutorial. + +Properties +---------- + ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`PackedStringArray` | :ref:`handshake_headers` | ``PackedStringArray()`` | ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`inbound_buffer_size` | ``65535`` | ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`max_queued_packets` | ``2048`` | ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`outbound_buffer_size` | ``65535`` | ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`PackedStringArray` | :ref:`supported_protocols` | ``PackedStringArray()`` | ++---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ Methods ------- -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`close` **(** :ref:`int` code=1000, :ref:`String` reason="" **)** | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_current_outbound_buffered_amount` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`WriteMode` | :ref:`get_write_mode` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_connected_to_host` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_no_delay` **(** :ref:`bool` enabled **)** | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_write_mode` **(** :ref:`WriteMode` mode **)** | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`was_string_packet` **(** **)** |const| | -+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`accept_stream` **(** :ref:`StreamPeer` stream **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** :ref:`int` code=1000, :ref:`String` reason="" **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_url` **(** :ref:`String` url, :ref:`bool` verify_tls=true, :ref:`X509Certificate` trusted_tls_certificate=null **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_close_code` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_close_reason` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_outbound_buffered_amount` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`State` | :ref:`get_ready_state` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_requested_url` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_selected_protocol` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`send` **(** :ref:`PackedByteArray` message, :ref:`WriteMode` write_mode=1 **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`send_text` **(** :ref:`String` message **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_no_delay` **(** :ref:`bool` enabled **)** | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`was_string_packet` **(** **)** |const| | ++----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ @@ -59,21 +121,162 @@ enum **WriteMode**: - **WRITE_MODE_BINARY** = **1** --- Specifies that WebSockets messages should be transferred as binary payload (any byte combination is allowed). +---- + +.. _enum_WebSocketPeer_State: + +.. _class_WebSocketPeer_constant_STATE_CONNECTING: + +.. _class_WebSocketPeer_constant_STATE_OPEN: + +.. _class_WebSocketPeer_constant_STATE_CLOSING: + +.. _class_WebSocketPeer_constant_STATE_CLOSED: + +enum **State**: + +- **STATE_CONNECTING** = **0** --- Socket has been created. The connection is not yet open. + +- **STATE_OPEN** = **1** --- The connection is open and ready to communicate. + +- **STATE_CLOSING** = **2** --- The connection is in the process of closing. This means a close request has been sent to the remote peer but confirmation has not been received. + +- **STATE_CLOSED** = **3** --- The connection is closed or couldn't be opened. + +Property Descriptions +--------------------- + +.. _class_WebSocketPeer_property_handshake_headers: + +- :ref:`PackedStringArray` **handshake_headers** + ++-----------+------------------------------+ +| *Default* | ``PackedStringArray()`` | ++-----------+------------------------------+ +| *Setter* | set_handshake_headers(value) | ++-----------+------------------------------+ +| *Getter* | get_handshake_headers() | ++-----------+------------------------------+ + +The extra HTTP headers to be sent during the WebSocket handshake. + +\ **Note:** Not supported in Web exports due to browsers' restrictions. + +---- + +.. _class_WebSocketPeer_property_inbound_buffer_size: + +- :ref:`int` **inbound_buffer_size** + ++-----------+--------------------------------+ +| *Default* | ``65535`` | ++-----------+--------------------------------+ +| *Setter* | set_inbound_buffer_size(value) | ++-----------+--------------------------------+ +| *Getter* | get_inbound_buffer_size() | ++-----------+--------------------------------+ + +The size of the input buffer in bytes (roughly the maximum amount of memory that will be allocated for the inbound packets). + +---- + +.. _class_WebSocketPeer_property_max_queued_packets: + +- :ref:`int` **max_queued_packets** + ++-----------+-------------------------------+ +| *Default* | ``2048`` | ++-----------+-------------------------------+ +| *Setter* | set_max_queued_packets(value) | ++-----------+-------------------------------+ +| *Getter* | get_max_queued_packets() | ++-----------+-------------------------------+ + +The maximum amount of packets that will be allowed in the queues (both inbound and outbound). + +---- + +.. _class_WebSocketPeer_property_outbound_buffer_size: + +- :ref:`int` **outbound_buffer_size** + ++-----------+---------------------------------+ +| *Default* | ``65535`` | ++-----------+---------------------------------+ +| *Setter* | set_outbound_buffer_size(value) | ++-----------+---------------------------------+ +| *Getter* | get_outbound_buffer_size() | ++-----------+---------------------------------+ + +The size of the input buffer in bytes (roughly the maximum amount of memory that will be allocated for the outbound packets). + +---- + +.. _class_WebSocketPeer_property_supported_protocols: + +- :ref:`PackedStringArray` **supported_protocols** + ++-----------+--------------------------------+ +| *Default* | ``PackedStringArray()`` | ++-----------+--------------------------------+ +| *Setter* | set_supported_protocols(value) | ++-----------+--------------------------------+ +| *Getter* | get_supported_protocols() | ++-----------+--------------------------------+ + +The WebSocket sub-protocols allowed during the WebSocket handshake. + Method Descriptions ------------------- +.. _class_WebSocketPeer_method_accept_stream: + +- :ref:`Error` **accept_stream** **(** :ref:`StreamPeer` stream **)** + +Accepts a peer connection performing the HTTP handshake as a WebSocket server. The ``stream`` must be a valid TCP stream retrieved via :ref:`TCPServer.take_connection`, or a TLS stream accepted via :ref:`StreamPeerTLS.accept_stream`. + +\ **Note:** Not supported in Web exports due to browsers' restrictions. + +---- + .. _class_WebSocketPeer_method_close: - void **close** **(** :ref:`int` code=1000, :ref:`String` reason="" **)** -Closes this WebSocket connection. ``code`` is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). ``reason`` is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). +Closes this WebSocket connection. ``code`` is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). ``reason`` is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). If ``code`` is negative, the connection will be closed immediately without notifying the remote peer. -\ **Note:** To achieve a clean close, you will need to keep polling until either :ref:`WebSocketClient.connection_closed` or :ref:`WebSocketServer.client_disconnected` is received. +\ **Note:** To achieve a clean close, you will need to keep polling until :ref:`STATE_CLOSED` is reached. \ **Note:** The Web export might not support all status codes. Please refer to browser-specific documentation for more details. ---- +.. _class_WebSocketPeer_method_connect_to_url: + +- :ref:`Error` **connect_to_url** **(** :ref:`String` url, :ref:`bool` verify_tls=true, :ref:`X509Certificate` trusted_tls_certificate=null **)** + +Connects to the given URL. If ``verify_tls`` is ``false`` certificate validation will be disabled. If specified, the ``trusted_tls_certificate`` will be the only one accepted when connecting to a TLS host. + +\ **Note:** To avoid mixed content warnings or errors in Web, you may have to use a ``url`` that starts with ``wss://`` (secure) instead of ``ws://``. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for ``wss://`` connections, as it won't match with the TLS certificate. + +---- + +.. _class_WebSocketPeer_method_get_close_code: + +- :ref:`int` **get_close_code** **(** **)** |const| + +Returns the received WebSocket close frame status code, or ``-1`` when the connection was not cleanly closed. Only call this method when :ref:`get_ready_state` returns :ref:`STATE_CLOSED`. + +---- + +.. _class_WebSocketPeer_method_get_close_reason: + +- :ref:`String` **get_close_reason** **(** **)** |const| + +Returns the received WebSocket close frame status reason string. Only call this method when :ref:`get_ready_state` returns :ref:`STATE_CLOSED`. + +---- + .. _class_WebSocketPeer_method_get_connected_host: - :ref:`String` **get_connected_host** **(** **)** |const| @@ -102,19 +305,51 @@ Returns the current amount of data in the outbound websocket buffer. **Note:** W ---- -.. _class_WebSocketPeer_method_get_write_mode: +.. _class_WebSocketPeer_method_get_ready_state: -- :ref:`WriteMode` **get_write_mode** **(** **)** |const| +- :ref:`State` **get_ready_state** **(** **)** |const| -Gets the current selected write mode. See :ref:`WriteMode`. +Returns the ready state of the connection. See :ref:`State`. ---- -.. _class_WebSocketPeer_method_is_connected_to_host: +.. _class_WebSocketPeer_method_get_requested_url: -- :ref:`bool` **is_connected_to_host** **(** **)** |const| +- :ref:`String` **get_requested_url** **(** **)** |const| -Returns ``true`` if this peer is currently connected. +Returns the URL requested by this peer. The URL is derived from the ``url`` passed to :ref:`connect_to_url` or from the HTTP headers when acting as server (i.e. when using :ref:`accept_stream`). + +---- + +.. _class_WebSocketPeer_method_get_selected_protocol: + +- :ref:`String` **get_selected_protocol** **(** **)** |const| + +Returns the selected WebSocket sub-protocol for this connection or an empty string if the sub-protocol has not been selected yet. + +---- + +.. _class_WebSocketPeer_method_poll: + +- void **poll** **(** **)** + +Updates the connection state and receive incoming packets. Call this function regularly to keep it in a clean state. + +---- + +.. _class_WebSocketPeer_method_send: + +- :ref:`Error` **send** **(** :ref:`PackedByteArray` message, :ref:`WriteMode` write_mode=1 **)** + +Sends the given ``message`` using the desired ``write_mode``. When sending a :ref:`String`, prefer using :ref:`send_text`. + +---- + +.. _class_WebSocketPeer_method_send_text: + +- :ref:`Error` **send_text** **(** :ref:`String` message **)** + +Sends the given ``message`` using WebSocket text mode. Prefer this method over :ref:`PacketPeer.put_packet` when interacting with third-party text-based API (e.g. when using :ref:`JSON` formatted messages). ---- @@ -128,14 +363,6 @@ Disable Nagle's algorithm on the underling TCP socket (default). See :ref:`Strea ---- -.. _class_WebSocketPeer_method_set_write_mode: - -- void **set_write_mode** **(** :ref:`WriteMode` mode **)** - -Sets the socket to use the given :ref:`WriteMode`. - ----- - .. _class_WebSocketPeer_method_was_string_packet: - :ref:`bool` **was_string_packet** **(** **)** |const| diff --git a/classes/class_websocketserver.rst b/classes/class_websocketserver.rst deleted file mode 100644 index eadeb1357..000000000 --- a/classes/class_websocketserver.rst +++ /dev/null @@ -1,252 +0,0 @@ -:github_url: hide - -.. DO NOT EDIT THIS FILE!!! -.. Generated automatically from Godot engine sources. -.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. -.. XML source: https://github.com/godotengine/godot/tree/master/modules/websocket/doc_classes/WebSocketServer.xml. - -.. _class_WebSocketServer: - -WebSocketServer -=============== - -**Inherits:** :ref:`WebSocketMultiplayerPeer` **<** :ref:`MultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`RefCounted` **<** :ref:`Object` - -A WebSocket server implementation. - -Description ------------ - -This class implements a WebSocket server that can also support the high-level multiplayer API. - -After starting the server (:ref:`listen`), you will need to :ref:`MultiplayerPeer.poll` it at regular intervals (e.g. inside :ref:`Node._process`). When clients connect, disconnect, or send data, you will receive the appropriate signal. - -\ **Note:** Not available in Web exports. - -\ **Note:** When exporting to Android, make sure to enable the ``INTERNET`` 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. - -Properties ----------- - -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ -| :ref:`String` | :ref:`bind_ip` | ``"*"`` | -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ -| :ref:`X509Certificate` | :ref:`ca_chain` | | -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ -| :ref:`float` | :ref:`handshake_timeout` | ``3.0`` | -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ -| :ref:`CryptoKey` | :ref:`private_key` | | -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ -| :ref:`X509Certificate` | :ref:`tls_certificate` | | -+-----------------------------------------------+----------------------------------------------------------------------------+---------+ - -Methods -------- - -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`disconnect_peer` **(** :ref:`int` id, :ref:`int` code=1000, :ref:`String` reason="" **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_peer_address` **(** :ref:`int` id **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_peer_port` **(** :ref:`int` id **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_peer` **(** :ref:`int` id **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_listening` **(** **)** |const| | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`PackedStringArray` protocols=PackedStringArray(), :ref:`bool` gd_mp_api=false **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_extra_headers` **(** :ref:`PackedStringArray` headers=PackedStringArray() **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop` **(** **)** | -+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Signals -------- - -.. _class_WebSocketServer_signal_client_close_request: - -- **client_close_request** **(** :ref:`int` id, :ref:`int` code, :ref:`String` reason **)** - -Emitted when a client requests a clean close. You should keep polling until you get a :ref:`client_disconnected` signal with the same ``id`` to achieve the clean close. See :ref:`WebSocketPeer.close` for more details. - ----- - -.. _class_WebSocketServer_signal_client_connected: - -- **client_connected** **(** :ref:`int` id, :ref:`String` protocol, :ref:`String` resource_name **)** - -Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client, and "resource_name" will be the resource name of the URI the peer used. - -"resource_name" is a path (at the very least a single forward slash) and potentially a query string. - ----- - -.. _class_WebSocketServer_signal_client_disconnected: - -- **client_disconnected** **(** :ref:`int` id, :ref:`bool` was_clean_close **)** - -Emitted when a client disconnects. ``was_clean_close`` will be ``true`` if the connection was shutdown cleanly. - ----- - -.. _class_WebSocketServer_signal_data_received: - -- **data_received** **(** :ref:`int` id **)** - -Emitted when a new message is received. - -\ **Note:** This signal is *not* emitted when used as high-level multiplayer peer. - -Property Descriptions ---------------------- - -.. _class_WebSocketServer_property_bind_ip: - -- :ref:`String` **bind_ip** - -+-----------+--------------------+ -| *Default* | ``"*"`` | -+-----------+--------------------+ -| *Setter* | set_bind_ip(value) | -+-----------+--------------------+ -| *Getter* | get_bind_ip() | -+-----------+--------------------+ - -When not set to ``*`` will restrict incoming connections to the specified IP address. Setting ``bind_ip`` to ``127.0.0.1`` will cause the server to listen only to the local host. - ----- - -.. _class_WebSocketServer_property_ca_chain: - -- :ref:`X509Certificate` **ca_chain** - -+----------+---------------------+ -| *Setter* | set_ca_chain(value) | -+----------+---------------------+ -| *Getter* | get_ca_chain() | -+----------+---------------------+ - -When using TLS (see :ref:`private_key` and :ref:`tls_certificate`), you can set this to a valid :ref:`X509Certificate` to be provided as additional CA chain information during the TLS handshake. - ----- - -.. _class_WebSocketServer_property_handshake_timeout: - -- :ref:`float` **handshake_timeout** - -+-----------+------------------------------+ -| *Default* | ``3.0`` | -+-----------+------------------------------+ -| *Setter* | set_handshake_timeout(value) | -+-----------+------------------------------+ -| *Getter* | get_handshake_timeout() | -+-----------+------------------------------+ - -The time in seconds before a pending client (i.e. a client that has not yet finished the HTTP handshake) is considered stale and forcefully disconnected. - ----- - -.. _class_WebSocketServer_property_private_key: - -- :ref:`CryptoKey` **private_key** - -+----------+------------------------+ -| *Setter* | set_private_key(value) | -+----------+------------------------+ -| *Getter* | get_private_key() | -+----------+------------------------+ - -When set to a valid :ref:`CryptoKey` (along with :ref:`tls_certificate`) will cause the server to require TLS instead of regular TCP (i.e. the ``wss://`` protocol). - ----- - -.. _class_WebSocketServer_property_tls_certificate: - -- :ref:`X509Certificate` **tls_certificate** - -+----------+----------------------------+ -| *Setter* | set_tls_certificate(value) | -+----------+----------------------------+ -| *Getter* | get_tls_certificate() | -+----------+----------------------------+ - -When set to a valid :ref:`X509Certificate` (along with :ref:`private_key`) will cause the server to require TLS instead of regular TCP (i.e. the ``wss://`` protocol). - -Method Descriptions -------------------- - -.. _class_WebSocketServer_method_disconnect_peer: - -- void **disconnect_peer** **(** :ref:`int` id, :ref:`int` code=1000, :ref:`String` reason="" **)** - -Disconnects the peer identified by ``id`` from the server. See :ref:`WebSocketPeer.close` for more information. - ----- - -.. _class_WebSocketServer_method_get_peer_address: - -- :ref:`String` **get_peer_address** **(** :ref:`int` id **)** |const| - -Returns the IP address of the given peer. - ----- - -.. _class_WebSocketServer_method_get_peer_port: - -- :ref:`int` **get_peer_port** **(** :ref:`int` id **)** |const| - -Returns the remote port of the given peer. - ----- - -.. _class_WebSocketServer_method_has_peer: - -- :ref:`bool` **has_peer** **(** :ref:`int` id **)** |const| - -Returns ``true`` if a peer with the given ID is connected. - ----- - -.. _class_WebSocketServer_method_is_listening: - -- :ref:`bool` **is_listening** **(** **)** |const| - -Returns ``true`` if the server is actively listening on a port. - ----- - -.. _class_WebSocketServer_method_listen: - -- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`PackedStringArray` protocols=PackedStringArray(), :ref:`bool` gd_mp_api=false **)** - -Starts listening on the given port. - -You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested. - -If ``true`` is passed as ``gd_mp_api``, the server will behave like a multiplayer peer for the :ref:`MultiplayerAPI`, connections from non-Godot clients will not work, and :ref:`data_received` will not be emitted. - -If ``false`` is passed instead (default), you must call :ref:`PacketPeer` functions (``put_packet``, ``get_packet``, etc.), on the :ref:`WebSocketPeer` returned via ``get_peer(id)`` to communicate with the peer with given ``id`` (e.g. ``get_peer(id).get_available_packet_count``). - ----- - -.. _class_WebSocketServer_method_set_extra_headers: - -- void **set_extra_headers** **(** :ref:`PackedStringArray` headers=PackedStringArray() **)** - -Sets additional headers to be sent to clients during the HTTP handshake. - ----- - -.. _class_WebSocketServer_method_stop: - -- void **stop** **(** **)** - -Stops the server and clear its state. - -.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` -.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` -.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` -.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` -.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` -.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_webxrinterface.rst b/classes/class_webxrinterface.rst index b1c38984a..612e7d71f 100644 --- a/classes/class_webxrinterface.rst +++ b/classes/class_webxrinterface.rst @@ -37,16 +37,16 @@ Here's the minimum code required to start an immersive VR session: func _ready(): # We assume this node has a button as a child. # This button is for the user to consent to entering immersive VR mode. - $Button.connect("pressed", self, "_on_Button_pressed") + $Button.pressed.connect(self._on_Button_pressed) webxr_interface = XRServer.find_interface("WebXR") if webxr_interface: # WebXR uses a lot of asynchronous callbacks, so we connect to various # signals in order to receive them. - webxr_interface.connect("session_supported", self, "_webxr_session_supported") - webxr_interface.connect("session_started", self, "_webxr_session_started") - webxr_interface.connect("session_ended", self, "_webxr_session_ended") - webxr_interface.connect("session_failed", self, "_webxr_session_failed") + webxr_interface.session_supported.connect(self._webxr_session_supported) + webxr_interface.session_started.connect(self._webxr_session_started) + webxr_interface.session_ended.connect(self._webxr_session_ended) + webxr_interface.session_failed.connect(self._webxr_session_failed) # This returns immediately - our _webxr_session_supported() method # (which we connected to the "session_supported" signal above) will diff --git a/classes/class_window.rst b/classes/class_window.rst index a532cc5f0..b7429e14d 100644 --- a/classes/class_window.rst +++ b/classes/class_window.rst @@ -328,7 +328,7 @@ enum **Mode**: - **MODE_MINIMIZED** = **1** --- Minimized window mode, i.e. ``Window`` is not visible and available on window manager's window list. Normally happens when the minimize button is pressed. -- **MODE_MAXIMIZED** = **2** --- 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 pressed. +- **MODE_MAXIMIZED** = **2** --- Maximized window mode, i.e. ``Window`` will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed. - **MODE_FULLSCREEN** = **3** --- Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project. diff --git a/classes/class_xrinterface.rst b/classes/class_xrinterface.rst index 08331b14f..77c379e87 100644 --- a/classes/class_xrinterface.rst +++ b/classes/class_xrinterface.rst @@ -254,7 +254,7 @@ Returns the name of this interface (OpenXR, OpenVR, OpenHMD, ARKit, etc). - :ref:`PackedVector3Array` **get_play_area** **(** **)** |const| -Returns an array of vectors that denotes the physical play area mapped to the virtual space around the :ref:`XROrigin3D` point. The points form a convex polygon that can be used to react to or visualise the play area. This returns an empty array if this feature is not supported or if the information is not yet available. +Returns an array of vectors that denotes the physical play area mapped to the virtual space around the :ref:`XROrigin3D` point. The points form a convex polygon that can be used to react to or visualize the play area. This returns an empty array if this feature is not supported or if the information is not yet available. ---- @@ -302,7 +302,7 @@ While currently not used, you can activate additional interfaces. You may wish t - :ref:`bool` **is_initialized** **(** **)** |const| -Is ``true`` if this interface has been initialised. +Is ``true`` if this interface has been initialized. ---- diff --git a/classes/class_xrinterfaceextension.rst b/classes/class_xrinterfaceextension.rst index 7d0417172..b99b7e995 100644 --- a/classes/class_xrinterfaceextension.rst +++ b/classes/class_xrinterfaceextension.rst @@ -261,7 +261,7 @@ Initializes the interface, returns ``true`` on success. - :ref:`bool` **_is_initialized** **(** **)** |virtual| |const| -Returns ``true`` if this interface has been initialised. +Returns ``true`` if this interface has been initialized. ---- diff --git a/classes/class_xrorigin3d.rst b/classes/class_xrorigin3d.rst index a2a1064dc..e7a378370 100644 --- a/classes/class_xrorigin3d.rst +++ b/classes/class_xrorigin3d.rst @@ -33,13 +33,31 @@ Tutorials Properties ---------- -+---------------------------+-----------------------------------------------------------+---------+ -| :ref:`float` | :ref:`world_scale` | ``1.0`` | -+---------------------------+-----------------------------------------------------------+---------+ ++---------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`current` | ``false`` | ++---------------------------+-----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`world_scale` | ``1.0`` | ++---------------------------+-----------------------------------------------------------+-----------+ Property Descriptions --------------------- +.. _class_XROrigin3D_property_current: + +- :ref:`bool` **current** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_current(value) | ++-----------+--------------------+ +| *Getter* | is_current() | ++-----------+--------------------+ + +Is this XROrigin3D node the current origin used by the :ref:`XRServer`? + +---- + .. _class_XROrigin3D_property_world_scale: - :ref:`float` **world_scale** diff --git a/classes/class_xrpose.rst b/classes/class_xrpose.rst index 1f9e106f5..a90ca8897 100644 --- a/classes/class_xrpose.rst +++ b/classes/class_xrpose.rst @@ -60,7 +60,7 @@ enum **TrackingConfidence**: - **XR_TRACKING_CONFIDENCE_NONE** = **0** --- No tracking information is available for this pose. -- **XR_TRACKING_CONFIDENCE_LOW** = **1** --- Tracking information may be inaccurate or estimated. For instance with inside out tracking this would indicate a controller may be (partially) obscured. +- **XR_TRACKING_CONFIDENCE_LOW** = **1** --- Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured. - **XR_TRACKING_CONFIDENCE_HIGH** = **2** --- Tracking information is deemed accurate and up to date. @@ -131,7 +131,7 @@ The name of this pose. Pose names are often driven by an action map setup by the - ``root`` defines a root location, often used for tracked objects that do not have further nodes. -- ``aim`` defines the tip of a controller with the orientation pointing outwards, for instance: add your raycasts to this. +- ``aim`` defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this. - ``grip`` defines the location where the user grips the controller diff --git a/classes/class_xrserver.rst b/classes/class_xrserver.rst index 4c4d89d38..194323abf 100644 --- a/classes/class_xrserver.rst +++ b/classes/class_xrserver.rst @@ -214,7 +214,7 @@ Registers a new :ref:`XRPositionalTracker` that track This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. -For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. +For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. @@ -222,7 +222,7 @@ This method allows you to center your tracker on the location of the HMD. It wil For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. -You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. +You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. ---- @@ -230,7 +230,7 @@ You should call this method after a few seconds have passed. For instance, when - :ref:`XRInterface` **find_interface** **(** :ref:`String` name **)** |const| -Finds an interface by its ``name``. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. +Finds an interface by its ``name``. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. ---- diff --git a/classes/class_zippacker.rst b/classes/class_zippacker.rst new file mode 100644 index 000000000..af8c9067f --- /dev/null +++ b/classes/class_zippacker.rst @@ -0,0 +1,124 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/modules/zip/doc_classes/ZIPPacker.xml. + +.. _class_ZIPPacker: + +ZIPPacker +========= + +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` + +Allows the creation of zip files. + +Description +----------- + +This class implements a writer that allows storing the multiple blobs in a zip archive. + +:: + + func write_zip_file(): + var writer := ZIPPacker.new() + var err := writer.open("user://archive.zip") + if err != OK: + return err + writer.start_file("hello.txt") + writer.write_file("Hello World".to_utf8_buffer()) + writer.close_file() + + writer.close() + return OK + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`close` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`close_file` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open` **(** :ref:`String` path, :ref:`ZipAppend` append=0 **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start_file` **(** :ref:`String` path **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`write_file` **(** :ref:`PackedByteArray` data **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ZIPPacker_ZipAppend: + +.. _class_ZIPPacker_constant_APPEND_CREATE: + +.. _class_ZIPPacker_constant_APPEND_CREATEAFTER: + +.. _class_ZIPPacker_constant_APPEND_ADDINZIP: + +enum **ZipAppend**: + +- **APPEND_CREATE** = **0** + +- **APPEND_CREATEAFTER** = **1** + +- **APPEND_ADDINZIP** = **2** + +Method Descriptions +------------------- + +.. _class_ZIPPacker_method_close: + +- :ref:`Error` **close** **(** **)** + +Closes the underlying resources used by this instance. + +---- + +.. _class_ZIPPacker_method_close_file: + +- :ref:`Error` **close_file** **(** **)** + +Stops writing to a file within the archive. + +It will fail if there is no open file. + +---- + +.. _class_ZIPPacker_method_open: + +- :ref:`Error` **open** **(** :ref:`String` path, :ref:`ZipAppend` append=0 **)** + +Opens a zip file for writing at the given path using the specified write mode. + +This must be called before everything else. + +---- + +.. _class_ZIPPacker_method_start_file: + +- :ref:`Error` **start_file** **(** :ref:`String` path **)** + +Starts writing to a file within the archive. Only one file can be written at the same time. + +Must be called after :ref:`open`. + +---- + +.. _class_ZIPPacker_method_write_file: + +- :ref:`Error` **write_file** **(** :ref:`PackedByteArray` data **)** + +Write the given ``data`` to the file. + +Needs to be called after :ref:`start_file`. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_zipreader.rst b/classes/class_zipreader.rst new file mode 100644 index 000000000..f479f801a --- /dev/null +++ b/classes/class_zipreader.rst @@ -0,0 +1,88 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/modules/zip/doc_classes/ZIPReader.xml. + +.. _class_ZIPReader: + +ZIPReader +========= + +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` + +Allows reading the content of a zip file. + +Description +----------- + +This class implements a reader that can extract the content of individual files inside a zip archive. + +:: + + func read_zip_file(): + var reader := ZIPReader.new() + var err := reader.open("user://archive.zip") + if err == OK: + return PackedByteArray() + var res := reader.read_file("hello.txt") + reader.close() + return res + +Methods +------- + ++---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`close` **(** **)** | ++---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`get_files` **(** **)** | ++---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open` **(** :ref:`String` path **)** | ++---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`read_file` **(** :ref:`String` path, :ref:`bool` case_sensitive=true **)** | ++---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ZIPReader_method_close: + +- :ref:`Error` **close** **(** **)** + +Closes the underlying resources used by this instance. + +---- + +.. _class_ZIPReader_method_get_files: + +- :ref:`PackedStringArray` **get_files** **(** **)** + +Returns the list of names of all files in the loaded archive. + +Must be called after :ref:`open`. + +---- + +.. _class_ZIPReader_method_open: + +- :ref:`Error` **open** **(** :ref:`String` path **)** + +Opens the zip archive at the given ``path`` and reads its file index. + +---- + +.. _class_ZIPReader_method_read_file: + +- :ref:`PackedByteArray` **read_file** **(** :ref:`String` path, :ref:`bool` case_sensitive=true **)** + +Loads the whole content of a file in the loaded zip archive into memory and returns it. + +Must be called after :ref:`open`. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`